Agentic GraphRAG (Vertical Domain)
No Neo4j: LangExtract builds a Python-dict knowledge graph of entities + relations alongside a Chroma store, and a 3-tool agent picks vector / graph / hybrid retrieval with multi-hop traversal. Extractions carry char_interval for traceability.
Switch questions and watch the LangChain agent pick vector / graph / hybrid retrieval: the graph path lights up the knowledge-graph entities hop by hop, and each answer carries char_interval source citations.
Why this local version exists
The knowledge graph (a Python dict of entities + relations), the three tools, and the char_interval citations are the real pipeline behavior on a sample private-loan contract. No live DeepSeek / Chroma — the routing and multi-hop traversal are what matter.
Watch the agent route vector / graph / hybrid
Switch questions and the agent picks the retrieval tool. The graph path lights up entities hop by hop; answers carry char_interval citations.
Pick a question
Knowledge graph (Python dict)
What to try
Run the fact question and watch it route to vector_search_tool only.
Run the relational question and watch graph_search_tool traverse the KG hop by hop.
Run the compound question and watch hybrid_search_tool fuse vector hits + graph hops.
What this demo proves
You know when a graph is needed (relations / multi-hop) and when Neo4j is over-engineering — here the graph is a Python dict.
You design agentic retrieval routing: the agent picks vector / graph / hybrid per question, not a hard-coded path.
You keep source grounding (char_interval) end-to-end, so every claim is auditable.
Extraction
LangExtract 1.1.1 + DeepSeek deepseek-chat · classes 实体 / 数据指标 / 关系描述
Stores
Chroma (text-embedding-v4, 1024-dim) + a Python-dict knowledge graph
Agent
LangChain create_agent · 3 tools: vector / graph (1–2 hop) / hybrid