opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

GraphRAG that costs $0.08 per book instead of $0.48
GitHub RepoImpressions5

Project Description

View on GitHub

GraphRAG That Won't Blow Your API Budget

You've probably looked at GraphRAG and thought the concept was solid but the price tag wasn't. Building knowledge graphs from your documents sounds great until you see the per-book cost and realize you'd need a small grant to process your whole corpus. Fast GraphRAG is an attempt to fix that, and the numbers in its README are worth paying attention to.

What It Does

Fast GraphRAG is a framework for building graph-based retrieval-augmented generation pipelines. Instead of just embedding chunks of text and doing vector similarity search, it constructs a graph of entities and relationships extracted from your data, then uses that graph to answer queries with more context and precision.

The project describes itself as "streamlined and promptable," designed for interpretable, high-precision, agent-driven retrieval workflows. It's fully asynchronous and typed, which means you get predictable behavior and can run things concurrently without wrestling with callback soup. The core idea is that graphs give you a human-navigable view of knowledge—you can query it, visualize it, and update it as your data changes.

It's a Python library (requires Python 3.10.1 or higher) that fits into an existing retrieval pipeline. You define a domain, provide example queries and entity types, and it handles the graph construction and exploration. No need to build your own agentic workflow from scratch.

Why It's Cool

The headline here is cost. According to the README, processing The Wizard of Oz with fast-graphrag costs $0.08 versus $0.48 with graphrag—a 6x savings. That gap apparently widens as your data grows and as you do more insertions. If you're working with large document collections, that's not a rounding error. That's the difference between a proof of concept and something you can actually deploy.

  • PageRank-based graph exploration. This is the mechanism behind the accuracy claims. Rather than blindly traversing the graph, it uses PageRank to prioritize which nodes and relationships matter most for a given query. It's a clever reuse of an old idea (PageRank has been around since the late '90s) applied to a newer problem.

  • Incremental updates. You don't have to rebuild the whole graph when new data arrives. The framework supports real-time updates, which matters if you're dealing with a stream of documents or a knowledge base that changes frequently.

  • Dynamic graph refinement. The graph isn't static. It automatically generates and refines itself to fit your domain and ontology. You give it entity types and a domain description, and it adapts.

  • Interpretability. Graphs are inherently more debuggable than embeddings. You can look at the nodes and edges and see why a particular answer was retrieved. That's a big deal when you're trying to explain to stakeholders why the system said what it said.

  • Asynchronous and typed. Everything is async, which means you can process documents in parallel without blocking. And the type support means your IDE will actually help you instead of leaving you guessing.

The project also supports concurrent task limits via an environment variable, which is useful if you're running local models and don't want to overwhelm your hardware.

How to Try It

Installation is straightforward. You can install from PyPI for stability:

pip install fast-graphrag

Or from source if you want the best performance:

git clone https://github.com/circlemind-ai/fast-graphrag.git
cd fast_graphrag
poetry install

You'll need an OpenAI API key set in your environment:

export OPENAI_API_KEY="sk-..."

The quickstart walks you through processing A Christmas Carol. First, download the sample text:

curl https://raw.githubusercontent.com/circlemind-ai/fast-graphrag/refs/heads/main/mock_data.txt > ./book.txt

Then set up your graph:

from fast_graphrag import GraphRAG

DOMAIN = "Analyze this story and identify the characters. Focus on how they interact with each other, the locations they explore, and their relationships."

EXAMPLE_QUERIES = [
    "What is the significance of Christmas Eve in A Christmas Carol?",
    "How does the setting of Victorian London contribute to the story's themes?",
    "Describe the chain of events that leads to Scrooge's transformation."
]

ENTITY_TYPES = ["Character", "Animal", "Place", "Object", "Activity", "Event"]

grag = GraphRAG(
    working_dir="./book_example",
    domain=DOMAIN,
    example_queries=EXAMPLE_QUERIES,
    entity_types=ENTITY_TYPES
)

From there, you can insert documents and query the graph. The README has the full example, and the repo includes a Discord community if you get stuck.

One optional setting worth noting: you can control concurrent LLM requests with export CONCURRENT_TASK_LIMIT=8. That's handy if you're running a local model and don't want to melt your GPU.

Check out the full project at github.com/circlemind-ai/fast-graphrag.

Final Thoughts

Fast GraphRAG is aimed at developers who want the benefits of graph-based retrieval without the cost and complexity that usually come with it. The 6x cost savings claim is the kind of thing that gets your attention, and the feature set—incremental updates, PageRank exploration, async support—suggests this isn't just a stripped-down version of something else. It's a different approach.

If you've been curious about GraphRAG but couldn't justify the expense, this is worth a look. The library is MIT-licensed, actively developed, and the quickstart gets you running in a few minutes. It won't solve every retrieval problem, but for document-heavy use cases where cost matters, it's a solid option to have in your toolkit.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 1a5785c7-2ba9-47ff-a530-8b7ffbf873c6Last updated: September 20, 2026 at 02:46 AM