// rag · gusye1234/nano-graphrag

nano-graphrag

nano-graphrag — проект с открытым исходным кодом из категории «RAG и базы знаний» от gusye1234 (gusye1234/nano-graphrag на GitHub). У него 3 993 звезды на GitHub и 432 форка, он распространяется по лицензии MIT и последний раз обновлялся на GitHub 27 января 2026.

nano-graphrag: a small, hackable GraphRAG implementation in about 1,100 lines — no Microsoft GraphRAG bulk

★ 4,0 тыс. звёзд⑂ 432 форкаMITобновлено янв. 2026
▦ визуал — в README этого проекта нет встраиваемого скриншота,
поэтому здесь заглушка. Руководство ниже в любом случае полное.
// факты о проекте

Факты о проекте

Репозиторий
gusye1234/nano-graphrag
Звёзды GitHub
3 993
Форки
432
Лицензия
MIT
Последнее обновление на GitHub
27 января 2026
Тип страницы
Полное руководство по установке
// как это работает

Как это работает

  1. Set your model access

    Export your OpenAI key (or configure Azure, Bedrock, or a local Ollama setup from the examples).

  2. Install the package

    Install from PyPI, or clone and install in editable mode to hack on the core.

  3. Insert your text

    Create a GraphRAG instance with a working directory and insert your documents.

  4. Query in modes

    Ask questions in local, global, and naive modes to compare graph-aware versus plain retrieval.

// возможности

Почему его любят

Tiny, readable core

Roughly 1,100 lines implement the full GraphRAG pipeline — built to be hacked.

Local and global query modes

Entity-centric (local), community/theme-centric (global), and plain vector (naive) answering.

Incremental insertion

New text is deduplicated by md5 hashing and merged into the existing graph.

Async API

ainsert and aquery mirror the sync API for async applications.

Pluggable components

Swap chunking, LLM, and embedding functions and prompts; choose nano-vectordb, faiss, hnswlib, or milvus-lite, and networkx or Neo4j storage.

Multiple model backends

OpenAI by default, with Azure OpenAI, Amazon Bedrock, and Ollama examples.

Advertisement
// запустите сами

Запустите сами

  1. Clone the repository

    Clone the project and enter its directory (or install from PyPI in the next step).

    git clone https://github.com/gusye1234/nano-graphrag.git
    cd nano-graphrag
  2. Install and set your key

    Install the package and export your OpenAI API key.

    pip install nano-graphrag
     export OPENAI_API_KEY="your-key"
  3. Insert and query

    Index a text file and ask a question in local mode, following the README quickstart.

    from nano_graphrag import GraphRAG, QueryParam
    graph_func = GraphRAG(working_dir="./dickens")
    graph_func.insert(open("book.txt").read())
    print(graph_func.query("What are the top themes?", param=QueryParam(mode="local")))
// сценарии использования

Что можно создать

Advertisement
// вопросы и ответы

Вопросы и ответы

Who maintains nano-graphrag?

Developer gusye1234 maintains nano-graphrag as an independent, community project inspired by Microsoft's GraphRAG.

Is it free?

Yes, MIT-licensed. Model calls bill to your own OpenAI/Azure/Bedrock keys, or run locally via Ollama examples.

Does it need a paid API key?

By default it expects an OpenAI API key; the repo includes examples for Azure OpenAI, Bedrock, and local Ollama models if you prefer.

How does it compare to Microsoft GraphRAG?

Microsoft's is the full research platform with extensive configuration. nano-graphrag trades breadth for a ~1,100-line core you can fully read and modify, with the same local/global query idea.

How do I get started?

Run `pip install nano-graphrag`, set OPENAI_API_KEY, create GraphRAG(working_dir=...), insert text, and query with QueryParam(mode="local").

// продолжить изучение

Похожие инструменты

RAG и базы знаний

graphrag

Microsoft's graph-based RAG: index a corpus into a knowledge graph, then query it with an LLM

★ 36,3 тыс. звёздMIT
Смотреть руководство →
RAG и базы знаний

llmware

Unified framework for enterprise RAG pipelines with small, specialized models - local, private and secure.

★ 14,8 тыс. звёздApache-2.0
Смотреть руководство →
RAG и базы знаний

swirl-search

Federated AI search and RAG across 100+ apps — answers with sources, without moving your data

★ 3,0 тыс. звёздApache-2.0
Смотреть руководство →
RAG и базы знаний

PaddleOCR

Lightweight OCR toolkit turning PDFs and images into structured, LLM-ready data in 100+ languages

★ 90,8 тыс. звёздApache-2.0
Смотреть руководство →
RAG и базы знаний

docs-mcp

Self-hosted rag & knowledge: cometchat docs search + implementation bundles: add cha.

★ 97 звёздApache-2.0
Смотреть руководство →
RAG и базы знаний

AppFlowy-Web

Open-source AI workspace for projects, wikis, and team docs.

★ 335 звёздAGPL-3.0
Смотреть руководство →
// альтернативы

Альтернативы: RAG и базы знаний

Другие проекты из категории «RAG и базы знаний» с наибольшим числом звёзд в каталоге LibreAI — реалистичный список альтернатив, если nano-graphrag вам не подходит.

// ещё в категории rag

Больше проектов: RAG и базы знаний

Соседние проекты из категории «RAG и базы знаний» в каталоге, ближайшие по числу звёзд к nano-graphrag — продолжайте изучать полку по обе стороны от него.

Получить nano-graphrag

Бесплатно и открыто — забирайте исходный код, ставьте звезду репозиторию и начинайте создавать.