Skip to main content
Version: 0.0.8 (stable)

Architecture

Agentic GraphRAG connects enterprise knowledge, conversation history, and decision traces in one graph. Ingestion builds the knowledge layer from source documents. Agents use the graph to find evidence, answer questions, record task events and steps, and save supported decisions.

Why it exists​

A vector search finds passages that resemble a question, but it does not connect facts across passages. A graph adds those links while retaining the source text needed to support an answer.

Agentic GraphRAG stores the facts as a graph and keeps the source text next to them. A question can use both: the passage that states a fact, and the entities that connect passages.

The components separate source parsing, graph construction, search, conversation history, and decision recording. You can replace embedding components through their interfaces. Neo4j or FalkorDB stores the graph and its indexes behind the same GraphStore interface.

How it works​

Graph.add sends documents through ingestion into the graph store. The built-in agent and MCP server read evidence, record conversation history, and manage decision traces. A document change flags affected decisions for review. The caller supplies the embedder, schema, and LLM.Graph.add sends documents through ingestion into the graph store. The built-in agent and MCP server read evidence, record conversation history, and manage decision traces. A document change flags affected decisions for review. The caller supplies the embedder, schema, and LLM.

Graph.add writes enterprise knowledge through ingestion. Agents and MCP clients read evidence, record conversation history, and manage decision traces.

Ingestion loads each source as a document, chunks its text, extracts entities and relations, resolves the extracted entities, then stores the graph and embeddings. The Ingestion pipeline page explains how these stages handle updates and failures.

At query time, one task-scoped agent discovers and fetches evidence from the graph, then writes an answer that cites only the evidence it fetched. The agent records messages, tool calls, and tool results as conversation history, and it stores decisions with explicit supports in the same graph. Agent loop describes when the agent searches again and where its limits apply.

You call Graph.add for the first flow and build_agent for the second. An MCP client reaches the same graph through agrag-mcp.

Example​

A note says that Ada Lovelace worked with Charles Babbage in London on the Analytical Engine. The loader makes one document. The chunker makes one chunk. The extractor finds entities such as two people, one place and one product. The store writes the document, the chunk and the entities, and links the chunk to each entity. A later question about Babbage finds the chunk through the Babbage entity, and the answer cites that chunk.

Design choices

Embeddings stay in the selected graph store by default. Optionally, one exclusive external vector store (Qdrant, Milvus, or Weaviate) stores vectors instead, with no graph-side copy. The graph keeps structure and provenance in either placement. Search joins external vector hits to graph nodes before applying visibility and scope filters.

Graph.open takes the store, the embedder, the extractor and the schema as arguments, because the library has no global configuration for them. Two graphs in one process can use different stores. A test can pass a fake.

The schema is required because extraction, validation and storage all use it. Without one, each stage guesses what an entity is. DEFAULT_SCHEMA gives a starting point.

The public APIs are async because ingestion and search wait on models and databases, and async calls let those waits run together.