graphrag-local-ollama  by TheAiSingularity

Graph RAG implementation using local models via Ollama

created 1 year ago
1,037 stars

Top 36.8% on sourcepulse

GitHubView on GitHub
Project Summary

This repository adapts Microsoft's GraphRAG for local LLM inference via Ollama, targeting developers and researchers who want to build knowledge graphs and perform question answering on private datasets without relying on costly cloud APIs. It offers a cost-effective and efficient alternative for complex RAG tasks.

How It Works

The core approach extends GraphRAG by integrating with Ollama, a local LLM runner. It leverages Ollama to serve both the language model for text generation and the embedding model for document indexing. The system builds a graph-based index by first extracting entities and relationships to form a knowledge graph, then generating community summaries for related entities. This allows it to handle "global" questions about the entire dataset, a task traditional RAG struggles with, by summarizing partial responses derived from community summaries.

Quick Start & Requirements

  • Install: pip install -e . within a conda environment (Python 3.10 recommended).
  • Prerequisites: Ollama installed and running, with at least one LLM (e.g., mistral) and one embedding model (e.g., nomic-embed-text) pulled via Ollama.
  • Setup: Requires cloning the repo, creating an input directory, copying data, initializing the index, and configuring settings.yaml with local Ollama endpoints.
  • Docs: GraphRAG paper

Highlighted Details

  • Supports local LLMs and embedding models via Ollama (e.g., Llama3, Mistral, Gemma2, Phi3).
  • Enables cost-effective inference by eliminating reliance on external APIs.
  • Implements the GraphRAG methodology for handling global sensemaking questions.
  • Allows graph visualization via GraphML export and tools like Gephi.

Maintenance & Community

The project welcomes community contributions. It cites the original Microsoft GraphRAG repository and Ollama as key dependencies.

Licensing & Compatibility

The repository's license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would require clarification of the licensing terms.

Limitations & Caveats

The README recommends Python 3.10 specifically for installation, suggesting potential compatibility issues with other versions. The "global" query method is explicitly stated as the only supported method.

Health Check
Last commit

10 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
74 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind).

LightRAG by HKUDS

1.0%
19k
RAG framework for fast, simple retrieval-augmented generation
created 10 months ago
updated 20 hours ago
Feedback? Help us improve.