Skip to main content

Give your agents answers they can prove.

Build a knowledge graph from your documents. Then ask it questions. Agentic GraphRAG plans, researches, and verifies each answer, and cites its sources.

uv pip install agentic-graphrag

Python 3.11+  ·  Apache-2.0  ·  Works with Neo4j, Qdrant, and Weaviate

Ingest
  1. Sources
  2. Load and chunk
  3. Extract
  4. Resolve
  5. Graph and vector stores
Ask
  1. Question
  2. Plan
  3. Retrieve
  4. Verify
  5. Cited answer

Both flows read and write the same graph and vector indexes.

See it work

build_graph.py
schema = GraphSchema(...) # you name the
# entities, relations, and patterns

graph = await Graph.open(
schema=schema,
graph_store=build_graph_store("neo4j"),
embedder=build_embedder(
"ibm-granite/granite-embedding-small-english-r2"),
extractor=GlinerExtractor(),
)
result = await graph.add(text=(
"Satya Nadella works at Microsoft. "
"Bill Gates founded Microsoft. "
"Microsoft is headquartered in Redmond."
))
print("entities extracted:",
result.extraction.entities_extracted)
entities extracted: 6
relations extracted: 3

The first run downloads two local models, about 385 MB.

ask.py
agent = build_agent(
engine=engine,
llm_settings=llm_settings,
graph_schema=schema,
)
question = (
"Who founded the company "
"that Satya Nadella works at?"
)
result = await agent.ainvoke(
{"messages": [{"role": "user",
"content": question}]}
)
print(answer.content)
Satya Nadella works at Microsoft (E1, E3), which was
founded by Bill Gates (E2, E3, C1).
evidence keys: E1, E2, E3, E4, C1, V1

Example output; answers vary with your model. Every claim cites its evidence: E keys are entities, C keys chunks, V keys graph-query values.

Run the full Quickstart — a free Neo4j Aura instance, two models, and about ten minutes.

What it does

Loads your files

One Graph.add() call reads text, Markdown, HTML, CSV, JSON, and, with Docling, PDF, Word, PowerPoint, and images.

Extracts with a schema you define

You name the entity types, the relation types, and the valid patterns. A local GLiNER model runs first, and an LLM takes over only for weak chunks.

Merges duplicates with care

Exact, fuzzy, embedding, and LLM-checked tiers compare mentions. An uncertain or failed comparison never merges, and matches are stored as edges so both entities stay in the graph.

Retrieves across graph and vectors

Entity, chunk, community, text-to-Cypher, and graph-expansion search run together. Reciprocal rank fusion and reranking order the results.

Answers with citations

An agent plans sub-questions, researches them, and verifies the evidence. Each claim points to a source, and OpenTelemetry records the run.

Scores itself on your questions

Judged evals measure extraction, resolution, answers, and agent trajectories against your own gold sets, so regressions surface before your users see them.

Ready to try it?

Get started