https://github.com/circlemind-ai/fast-graphrag Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} circlemind-ai / fast-graphrag Public * Notifications You must be signed in to change notification settings * Fork 71 * Star 1.7k RAG that intelligently adapts to your use case, data, and queries License MIT license 1.7k stars 71 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 9 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights circlemind-ai/fast-graphrag main BranchesTags [ ] Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 120 Commits .github .github .vscode .vscode examples examples fast_graphrag fast_graphrag tests tests .gitignore .gitignore CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTING.md LICENSE LICENSE README.md README.md banner.png banner.png demo.gif demo.gif mock_data.txt mock_data.txt poetry.lock poetry.lock pyproject.toml pyproject.toml View all files Repository files navigation * README * Code of conduct * MIT license circlemind fast-graphrag fast-graphrag is released under the MIT license. PRs welcome! Circlemind Page [6874747073] Streamlined and promptable Fast GraphRAG framework designed for interpretable, high-precision, agent-driven retrieval workflows. Looking for a Managed Service? >> Install | Quickstart | Community | Report Bug | Request Feature Note Using The Wizard of Oz, fast-graphrag costs $0.08 vs. graphrag $0.48 -- a 6x costs saving that further improves with data size and number of insertions. Stay tuned for the official benchmarks, and join us as a contributor! Features * Interpretable and Debuggable Knowledge: Graphs offer a human-navigable view of knowledge that can be queried, visualized, and updated. * Fast, Low-cost, and Efficient: Designed to run at scale without heavy resource or cost requirements. * Dynamic Data: Automatically generate and refine graphs to best fit your domain and ontology needs. * Incremental Updates: Supports real-time updates as your data evolves. * Intelligent Exploration: Leverages PageRank-based graph exploration for enhanced accuracy and dependability. * Asynchronous & Typed: Fully asynchronous, with complete type support for robust and predictable workflows. Fast GraphRAG is built to fit seamlessly into your retrieval pipeline, giving you the power of advanced RAG, without the overhead of building and designing agentic workflows. Install Install from PyPi (recommended) pip install fast-graphrag Install from source # clone this repo first cd fast_graphrag poetry install Quickstart Set the OpenAI API key in the environment: export OPENAI_API_KEY="sk-..." Download a copy of A Christmas Carol by Charles Dickens: curl https://raw.githubusercontent.com/circlemind-ai/fast-graphrag/refs/heads/main/mock_data.txt > ./book.txt Use the Python snippet below: 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.", "How does Dickens use the different spirits (Past, Present, and Future) to guide Scrooge?", "Why does Dickens choose to divide the story into \"staves\" rather than chapters?" ] ENTITY_TYPES = ["Character", "Animal", "Place", "Object", "Activity", "Event"] grag = GraphRAG( working_dir="./book_example", domain=DOMAIN, example_queries="\n".join(EXAMPLE_QUERIES), entity_types=ENTITY_TYPES ) with open("./book.txt") as f: grag.insert(f.read()) print(grag.query("Who is Scrooge?").response) The next time you initialize fast-graphrag from the same working directory, it will retain all the knowledge automatically. Examples Please refer to the examples folder for a list of tutorial on common use cases of the library: * custom_llm.py: a brief example on how to configure fast-graphrag to run with different OpenAI API compatible language models and embedders. Contributing Whether it's big or small, we love contributions. Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Check out our guide to see how to get started. Not sure where to get started? You can join our Discord and ask us any questions there. Philosophy Our mission is to increase the number of successful GenAI applications in the world. To do that, we build memory and data tools that enable LLM apps to leverage highly specialized retrieval pipelines without the complexity of setting up and maintaining agentic workflows. Open-source or Managed Service This repo is under the MIT License. See LICENSE.txt for more information. The fastest and most reliable way to get started with Fast GraphRAG is using our managed service. Your first 100 requests are free every month, after which you pay based on usage. circlemind fast-graphrag demo To learn more about our managed service, book a demo or see our docs. About RAG that intelligently adapts to your use case, data, and queries Resources Readme License MIT license Code of conduct Code of conduct Activity Custom properties Stars 1.7k stars Watchers 10 watching Forks 71 forks Report repository Releases No releases published Packages 0 No packages published Contributors 5 * @liukidar * @antoniocirclemind * @jorenham * @YuhangSong * @ZeyuTeng96 Languages * Python 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.