{"id":23818,"library":"graphrag","title":"GraphRAG","description":"GraphRAG is a graph-based retrieval-augmented generation (RAG) system by Microsoft. The current version is 3.0.9, with frequent patch releases. Requires Python >=3.11, <3.14.","status":"active","version":"3.0.9","language":"python","source_language":"en","source_url":"https://github.com/microsoft/graphrag","tags":["rag","graph","nlp","llm","microsoft"],"install":[{"cmd":"pip install graphrag","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Used for LLM calls; must be pinned due to past compromise (CVE)","package":"litellm","optional":false}],"imports":[{"note":"In v3.0.0+, the index package was restructured; direct import from graphrag is deprecated.","wrong":"from graphrag import Indexer","symbol":"Indexer","correct":"from graphrag.index import Indexer"},{"note":"Renamed in v3.0.0 from query_engine to query.","wrong":"from graphrag.query_engine import QueryEngine","symbol":"QueryEngine","correct":"from graphrag.query import QueryEngine"},{"note":"Pipeline module restructured; use run_pipeline from index.run.","wrong":"from graphrag.pipeline import run","symbol":"run_pipeline","correct":"from graphrag.index.run import run_pipeline"}],"quickstart":{"code":"import os\nos.environ.pop(\"OPENAI_API_KEY\", None)  # placeholder; set your key via env var\nfrom graphrag.index import Indexer\nfrom graphrag.query import QueryEngine\n# Index documents (requires a data directory and config)\n# Run: graphrag init --force to create default config\nprint(\"GraphRAG ready\")","lang":"python","description":"Minimal import and setup for GraphRAG. Note: Full indexing requires a config file and data directory; run `graphrag init --force` first."},"warnings":[{"fix":"Update imports to match new package structure (e.g., graphrag.index, graphrag.query, graphrag.cache, etc.)","message":"v3.0.0 introduced a monorepo restructure: many import paths changed. Use `from graphrag.index` instead of `from graphrag`. Old imports will break.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use `from graphrag.query import QueryEngine`","message":"The `QueryEngine` from `graphrag.query_engine` has been moved to `graphrag.query`. The old path may be removed in a future release.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Keep litellm pinned via GraphRAG's requirements; do not override.","message":"The `litellm` dependency was compromised in the past; GraphRAG pins a specific safe version. Do not upgrade litellm independently.","severity":"gotcha","affected_versions":">=3.0.7"},{"fix":"Upgrade to v3.0.2+ for Python 3.13 compatibility.","message":"Python 3.13 support was added in v3.0.2, but v3.0.0-v3.0.1 did not support it. Python 3.11 is the minimum.","severity":"breaking","affected_versions":"<3.0.2, >=3.11"},{"fix":"Run `graphrag init --force` after upgrading to regenerate config.","message":"The `graphrag init --force` command is required to reinitialize config after upgrading to v3.0.0; otherwise configs may be incompatible.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install graphrag` and ensure you are using Python >=3.11.","cause":"The library is not installed or Python environment is wrong.","error":"ModuleNotFoundError: No module named 'graphrag'"},{"fix":"Use `from graphrag.index import Indexer` instead of `from graphrag import Indexer`.","cause":"Import path changed in v3.0.0; Indexer is now in graphrag.index.","error":"AttributeError: module 'graphrag' has no attribute 'Indexer'"},{"fix":"Run `graphrag init --force` in your project directory to create default config.yaml.","cause":"Missing configuration file; GraphRAG requires a config file to run indexing or queries.","error":"OSError: [Errno 2] No such file or directory: 'config.yaml'"},{"fix":"Check the 'embedding.model' field in config.yaml and ensure you have the correct model name (e.g., text-embedding-ada-002).","cause":"The embedding model specified in config is not recognized or not installed.","error":"ValueError: Unknown embedding model: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}