KAG

Stale
GitHub Python Apache-2.0

Description

KAG is a logical form-guided reasoning and retrieval framework based on OpenSPG engine and LLMs for building logical reasoning and factual Q&A solutions for professional domain knowledge bases, effectively overcoming the limitations of traditional RAG vector similarity models.

Key Features

  • Bidirectional knowledge-text indexing: KG nodes cross-reference original text chunks for complete context preservation
  • Logic form-guided hybrid reasoning: transforms natural language into formal logical inference combining exact match, text retrieval, numerical computation, and semantic reasoning
  • Schema-constrained knowledge construction: supports both free-form information extraction and structured domain expert knowledge representation
  • Conceptual semantic alignment: leverages semantic reasoning to mitigate noise from OpenIE extraction
  • Multi-hop factual Q&A: supports complex cross-entity multi-hop reasoning scenarios
  • Dual-mode private and public knowledge bases: integrates LBS, WebSearch and other public data sources via MCP protocol

Use Cases

💡 Medical domain Q&A: combining clinical guidelines and case knowledge bases for evidence-based medical reasoning
💡 Legal compliance review: cross-referencing regulations in a knowledge base for compliance assessment
💡 Enterprise knowledge management: integrating unstructured documents with structured business data into a unified knowledge graph
💡 Financial research analysis: extracting facts from reports and performing logical reasoning to generate investment insights

Strengths & Limitations

Strengths

  • High community interest (9.0k stars)
  • Permissive open-source license (Apache-2.0)

⚠️ Limitations

  • No updates in over 7 months

Categories

Quick Start

1. Install Docker and Docker Compose
2. Download docker-compose.yml and start services: docker compose up
3. Access the KAG interface via Web UI
4. Create a knowledge base and upload documents
5. Choose Simple Mode or Deep Reasoning mode for Q&A

Related Projects

GraphRAG

35.8k · Python
Active A+

A modular graph-based Retrieval-Augmented Generation system by Microsoft that uses LLMs to extract structured knowledge graphs from text, enabling global and local community summarization queries.

graphragragknowledge-graph +3
  • · Knowledge Graph Construction — Auto-extract entities and relations from unstructured text using LLMs
  • · Community Detection & Summarization — Leiden algorithm-based graph community detection with hierarchical summaries
  • · Global Queries — Answer cross-document reasoning questions via community summaries

LightRAG

39.3k · Python
Active A+

LightRAG is a simple and fast Retrieval-Augmented Generation framework using graph-enhanced retrieval, published at EMNLP 2025.

raggraphretrieval +2
  • · Graph-enhanced retrieval — Dual-level retrieval (local/global) using knowledge graph entities and relationships, more precise than vector search
  • · Four text chunking strategies — Fixed, Recursive, Vector, and Paragraph chunking adapted to different document types
  • · Multi-backend storage — Neo4j, PostgreSQL, MongoDB, OpenSearch, JSON KV Store and other storage backends supported

RAG Techniques

29.3k · Jupyter Notebook
Active A+

NirDiamant's RAG_Techniques repository systematically collects and demonstrates cutting-edge retrieval-augmented generation techniques and engineering practices.

ragretrievaltechniques +2
  • · Systematic taxonomy — techniques organised by simple / advanced / modular levels for targeted learning
  • · Runnable notebooks — every technique ships with a Jupyter notebook and minimal runnable code
  • · Evaluation & comparison — retrieval quality and answer quality evaluation scripts with visualisation

R2R

8.0k · Python
Stale B

A production-ready Agentic RAG system with RESTful API, featuring multimodal document ingestion, hybrid search, knowledge graph construction, and agent-driven retrieval-augmented generation workflows.

ragretrievalknowledge-graph +3
  • · Production-ready Agentic RAG system with RESTful API for retrieval-augmented generation workflows
  • · Multimodal document ingestion supporting .txt, .pdf, .json, .png, .mp3 and more formats
  • · Hybrid search combining semantic and keyword search with reciprocal rank fusion