KAG (Knowledge Augmented Generation)
Type: full-code · Vendor: Ant Group (OpenSPG) · Language: Python · License: Apache-2.0 · Status: active · Status in practice: emerging
Knowledge-augmented generation framework built on the OpenSPG knowledge graph engine that translates natural-language questions into logical forms over a schema-constrained KG and combines retrieval, KG reasoning, and numerical calculation in a hybrid reasoning engine.
Description. KAG (Knowledge Augmented Generation, arXiv 2409.13731, ACM Web Conf 2025) is Ant Group's logical-form-guided RAG framework, built on the OpenSPG knowledge graph engine. KAG attacks the noise problem of OpenIE-based approaches (HippoRAG, GraphRAG) by using a schema-constrained KG with semantic alignment. It introduces mutual indexing between KG nodes and source chunks, and a hybrid reasoning engine that orchestrates four operator types — retrieval, KG reasoning, language reasoning, numerical calculation — by translating NL questions into logical forms. Published numbers significantly outperform NaiveRAG and HippoRAG on multi-hop QA (HotpotQA F1 +19.6%, 2Wiki +33.5%).
Agent loop shape. Offline: domain schema is defined in SPG, sources are processed into a schema-constrained KG with chunk-level mutual indexing. Online: the user question is translated to a logical form by the planner; the logical form orchestrates a sequence of operator calls (retrieval, KG reasoning, language reasoning, numerical calculation); operator outputs feed the generator. The bidirectional KG↔chunk index lets graph traversal pull supporting evidence from text.
Primary use cases
- professional-domain QA where schema-constrained knowledge is available (legal, medical, finance)
- multi-hop reasoning over KG + text with quantifiable accuracy gains over RAG and HippoRAG
- decision-support systems where rigorous fact-grounding is required
- knowledge-graph construction with semantic alignment to reduce OpenIE noise
Key concepts
- Schema-constrained KG → knowledge-graph-memory (docs) — Knowledge representation bound by an explicit domain schema, distinct from OpenIE-extracted graphs.
- Mutual KG ↔ chunk indexing — Bidirectional anchor between graph nodes and source text fragments.
- Logical-form-guided reasoning → plan-and-execute — NL questions are translated to logical forms that orchestrate planner / reasoning / retrieval operators.
- Hybrid reasoning engine — Four operator types — retrieval, KG reasoning, language reasoning, numerical calculation — composed by the logical form.
Patterns this full-code implements —
Neighbourhood
Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.