graphrag-local-ollama  by TheAiSingularity

Graph RAG implementation using local models via Ollama

Created 1 year ago
1,077 stars

Top 35.3% 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

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.