OpenSPG

    OpenSPG/KAG

    KAG is a logical form-guided reasoning and retrieval framework based on OpenSPG engine and LLMs. It is used to build logical reasoning and factual Q&A solutions for professional domain knowledge bases. It can effectively overcome the shortcomings of the traditional RAG vector similarity calculation model.

    9.2K stars
    719 forks
    75 GitHub watchers
    Updated Nov 10, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    No releases in the last 90 days; the most recent was 500 days ago, with 23 contributors on GitHub.

    Use Cases & Benefits

    • Provides a logical form-guided reasoning and retrieval framework integrating knowledge graphs and large language models for professional domain Q&A solutions.
    • Overcomes traditional retrieval-augmented generation (RAG) limitations by combining logical reasoning, multi-hop fact retrieval, and noise-resistant knowledge alignment.
    • Use for building domain-specific knowledge-enhanced LLM services that require precise logical and factual question answering.
    • Use for integrating structured and unstructured enterprise data into a unified knowledge graph supporting complex multi-step reasoning.
    • Use for developing hybrid reasoning engines that combine retrieval, knowledge graph inference, language reasoning, and numerical calculation.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    Apache 2.0

    Permissive: commercial use, modification and redistribution are allowed with attribution; includes an explicit patent grant from contributors.

    Community files

    • README: present

    Watch-outs

    • No commits in the last six months (last push Jan 2026).

    General guidance from repository metadata, not legal advice. How we score

    From the README

    KAG is a logical reasoning and Q&A framework based on the OpenSPG engine and large language models, which is used to build logical reasoning and Q&A solutions for vertical domain knowledge bases. KAG can effectively overcome the ambiguity of traditional RAG vector similarity calculation and the noise problem of GraphRAG introduced by OpenIE. KAG supports logical reasoning and multi-hop fact Q&A, etc., and is significantly better than the current SOTA method.

    The goal of KAG is to build a knowledge-enhanced LLM service framework in professional domains, supporting logical reasoning, factual Q&A, etc. KAG fully integrates the logical and factual characteristics of the KGs. Its core features include:

    ⭐️ Star our repository to stay up-to-date with exciting new features and improvements! Get instant notifications for new releases! 🌟

    In the context of private knowledge bases, unstructured data, structured information, and business expert experience often coexist. KAG references the DIKW hierarchy to upgrade SPG to a version that is friendly to LLMs.

    For unstructured data such as news, events, logs, and books, as well as structured data like transactions, statistics, and approvals, along with business experience and domain knowledge rules, KAG employs techniques such as layout analysis, knowledge extraction, property normalization, and semantic alignment to integrate raw business data and expert rules into a unified business knowledge graph.

    Excerpt from the OpenSPG/KAG README on GitHub (Apache-2.0 license). © its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    719+14

    Open issues

    174-1

    Compared with peers in LLM

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 8, by 7-day star growth

    OpenSPG/KAG compared with LLM repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    NVIDIA/auto-ontology11.4K+8.5K75—
    thedotmack/claude-mem115.8K+4.7K75today
    DietrichGebert/ponytail188.4K+4.4K7512 days ago
    affaan-m/ECC300.8K+4.3K7540 days ago
    Graphify-Labs/graphify145.7K+3.8K75today
    OpenSPG/KAG9.2K—75500 days ago
    Category median145.7K+4.4K75—

    Discover Repositories

    Search across tracked repositories by name or description