OpenSPG

KAG: Build Knowledge-Grounded Reasoning and Q&A Systems

KAG combines knowledge graphs, text retrieval, and language models for factual and multi-step Q&A over professional-domain knowledge bases. It suits teams that can model domain knowledge and operate the OpenSPG engine alongside a Python toolkit.

QuietPythonApache-2.0FrameworkRAGKnowledge Graph
View on GitHub Compare
Stars
9.1k
Forks
722
Stars, last 30 days
+64
Last commit
8 months ago
Contributors
23

Our take

Quietno commits in the last 90 days and no release in a year

Health score

40/100

How it is scored
Activity
19
Community
67
Issues
53
Pull requests
20

+64 stars in the last 30 days

KAG offers a distinctive graph-and-text reasoning approach for specialist knowledge bases, but its quiet recent development makes project activity worth checking before a new production commitment.

Good fit if

  • Your use case needs multi-hop factual answers that combine domain rules, graph facts, and source text.
  • Your team can install and operate OpenSPG and work with a Python toolkit.
  • You value an Apache-2.0 project with multiple contributors and no measured dependence on a single contributor.

Look elsewhere if

  • You need a project with recent commits, releases, or merged pull requests: the measured project status is Quiet, with no commits in the last 90 days and no release in a year.
  • You need a standalone RAG package without the OpenSPG engine and its supporting services.
  • Your requirements depend on the KAG model component, which the README says is planned for gradual future release.
All health signals
Last commit2026-01-28 (8 months ago)
Commits, last 90 days0
Releases, last 12 months0 (latest v0.8.0, 2025-06-28)
Contributors23 (top contributor: 34% of commits)
Issues closed, last 90 days2
Pull requests merged, last 90 days0
Project age2 years

Checked on 2026-10-09 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

9,175

Forks

721

Change since Nov 17, 2026: +3 stars·-1 forks

Overview

KAG is a framework for building factual question-answering and logical reasoning systems over specialized knowledge bases. It combines the OpenSPG knowledge-graph engine with language models to address gaps in conventional vector-based RAG, including ambiguity in similarity-based retrieval and noise in graph construction.

Its approach links graph knowledge to source text and guides retrieval and reasoning with logical forms. This is aimed at teams working with structured records, documents, and expert rules that need traceable, multi-hop answers rather than general-purpose chat.

Key Features

  • Represents structured data, unstructured text, and domain expertise in a shared knowledge model.
  • Links graph structures with original text blocks to support retrieval with source context.
  • Supports both schema-free extraction and schema-constrained construction of domain knowledge.
  • Uses planning, reasoning, and retrieval operators to turn questions into multi-step solution processes.
  • Combines exact-match and text retrieval with knowledge-graph reasoning, language reasoning, and numerical calculation.
  • Supports integration of public data sources, including web search and LBS through MCP, as described for the 0.8 release.

Use Cases

  • Domain experts can build question-answering systems over internal policies, manuals, and business rules when answers require combining facts across documents.
  • Data teams can connect structured transactions or statistics with unstructured records to answer questions spanning both sources.
  • Knowledge-engineering teams can encode expert concepts and constraints in a schema, then use them alongside extracted information.
  • Developers building MCP-based agent workflows can expose KAG-powered inference and Q&A as part of a larger workflow.

What you need

Detected in the repository

  • Python (from setup.py)
  • A test suite and automated checks on GitHub Actions

License in plain words

Apache-2.0permissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the license, the NOTICE file and a note of your changes
  • Share your changes: no
  • Includes an explicit patent grant from the contributors:

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Install the toolkit in a Python 3.10 environment after setting up the OpenSPG engine and dependent images:

git clone https://github.com/OpenSPG/KAG.git
cd KAG
pip install -e .

See the README and developer usage guide for engine setup and configuration details.

Alternatives

  • graphrag: GraphRAG builds graph context from unstructured text, while KAG targets professional-domain knowledge with explicit knowledge modeling and logical reasoning.
  • graphrag: TigerGraph GraphRAG centers on TigerGraph-backed graph queries and vector retrieval, while KAG uses the OpenSPG engine for domain knowledge and reasoning.
  • gitnexus: GitNexus answers codebase questions from a repository dependency graph, while KAG targets factual, multi-step Q&A over professional-domain knowledge.
ProjectLanguageLicenseStarsStatus
KAGPythonApache-2.09.1kQuiet
graphragPythonMIT36.4kActive
graphragPythonAGPL-3.023Active
gitnexusTypeScript–175Active

Considerations

The repository is not archived, but measured activity is quiet: there have been no commits in the last 90 days, no release in the past year, and no merged pull requests in that period. Two issues were closed in the last 90 days. The project has 23 measured contributors and is not flagged as contributor-concentrated, though teams should still verify maintenance activity against their own adoption timeline.

The Python package is not the whole runtime. The documented setup depends on the OpenSPG engine and dependent images, with Docker Compose used in the product installation instructions. The README also identifies kag-model as a component intended for future open-source release. KAG is licensed under Apache-2.0; review that license against your distribution and compliance requirements.

Found this useful?

Share it with someone who would like KAG.

Comparisons