AI Personal Learning
and practical guidance

Fast GraphRAG: A Highly Accurate and Low-Cost Graphical Search Enhancement Generation Tool

General Introduction

Fast GraphRAG is an open source tool developed by Circlemind AI to enable efficient and accurate retrieval augmentation generation (RAG) through knowledge graph and PageRank algorithms. The tool intelligently adapts to the user's usage scenarios, data and query requirements, providing an interpretable, cost-effective and efficient retrieval workflow.Fast GraphRAG is designed to run at scale without significant resources or costs, and supports real-time data updating and dynamic data generation, making it suitable for a variety of domains with knowledge management and information retrieval needs.

Using Fast-GraphRAG only costs, compared to the original 0.48, a savings of almost 6 times! And this cost-effectiveness increases further as the data size and number of inserts increase.

Fast GraphRAG: A Highly Accurate and Low-Cost Graphical Retrieval Enhancement Generation Tool-1

 

Function List

  • Interpretable and debuggable knowledge graphs: Provide human navigable views of knowledge that can be queried, visualized and updated.
  • High efficiency and low cost: Designed for large-scale operation without significant resources or costs.
  • Dynamic Data Generation: Automatically generate and optimize maps to best fit your domain and ontology needs.
  • incremental update: Supports real-time updates, adjusting as data changes.
  • Intelligent Exploration: Utilize PageRank algorithm for graph exploration to improve accuracy and reliability.
  • Asynchronous and type support: Fully asynchronous with full type support to ensure robust and predictable workflows.

 

Comparing LightRAG, GraphRAG and VectorDBs

consult (a document etc)

# Queries Method All queries % Multihop only %
51
VectorDB 0.49 0.32
LightRAG 0.47 0.32
GraphRAG 0.75 0.68
Circlemind 0.96 0.95
101
VectorDB 0.42 0.23
LightRAG 0.45 0.28
GraphRAG 0.73 0.64
Circlemind 0.93 0.90

Data insertion

Method Time (minutes)
VectorDB ~0.3
LightRAG ~25
GraphRAG ~40
Circlemind ~1.5

In the query test, Fast GraphRAG achieves high accuracy of 96% and 95% in all queries and multi-hop queries, respectively, compared to VectorDB RAG Nearly four times higher.


Additionally, Fast GraphRAG measured insertion times for a benchmark test of the dataset (about 800 blocks): insertion time for Fast GraphRAG was about 1.5 minutes, which is 27 times faster than GraphRAG, and retrieval accuracy was improved by more than 401 TP3T.

 

Using Help

Installation process

  1. Installation from source (recommended for best performance)::
   # Clone this repository
git clone https://github.com/circlemind-ai/fast-graphrag
cd fast-graphrag
poetry install
  1. Installation from PyPi (recommended stability)::
   pip install fast-graphrag

Quick Start

  1. Set the OpenAI API key:
   export OPENAI_API_KEY="sk-..."
  1. Download the text of A Christmas Carol:
   curl https://raw.githubusercontent.com/circlemind-ai/fast-graphrag/refs/heads/main/mock_data.txt > . /book.txt
  1. Optional: Set the concurrent request limit:
   export CONCURRENT_TASK_LIMIT=8
  1. Use the following Python code snippet:
   from fast_graphrag import GraphRAG
DOMAIN = "Analyze this story Focus on how they interact with each other, the locations they explore, and their relationships."
EXAMPLE_QUERIES = [
"Who are the main characters?", "What locations are mentioned?
"What locations are mentioned?", "How do the characters interact?
"How do the characters interact?"
]
grag = GraphRAG(

example_queries=EXAMPLE_QUERIES, config=GraphRAG.
config=GraphRAG.Config(
llm_service=OpenAILLMService(
model="your-llm-model",
base_url="llm.api.url.com",
api_key="your-api-key", mode=instructor.
mode=instructor.
Mode.JSON, api_version="your-llm-api_version", client="openai or aztec
client="openai or azure"
),
embedding_service=OpenAIEmbeddingService(
model="your-embedding-model",
base_url="emb.api.url.com",
base_url="emb.api.url.com", api_key="your-api-key",
embedding_dim=512,

client="openai or azure"
),
),
)

Main function operation flow

  1. Knowledge Graph Generation: By defining domains and example queries, GraphRAG will automatically generate a knowledge graph adapted to your needs.
  2. Queries and visualizations: Query using the generated knowledge graph and view the results through visualization tools.
  3. real time update: As data changes, GraphRAG supports real-time updating of the knowledge graph to ensure that information is current and accurate.
  4. Intelligent Exploration: Utilizing the PageRank algorithm, GraphRAG is able to intelligently explore the knowledge graph to improve retrieval accuracy and reliability.
May not be reproduced without permission:Chief AI Sharing Circle " Fast GraphRAG: A Highly Accurate and Low-Cost Graphical Search Enhancement Generation Tool

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish