#236236th of 242 in Agent frameworks and SDKs

kg-gen

Python library that extracts knowledge graphs from text or chats using LLMs

Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.

Stars
1.3k
License
no license
Last commit
Mar 2026
Last release
Nov 2025
Language
Python
Stars, last 29 weeks+188
6 May 2026: 1,111 stars13 May 2026: 1,119 stars20 May 2026: 1,144 stars27 May 2026: 1,174 stars3 Jun 2026: 1,178 stars10 Jun 2026: 1,183 stars17 Jun 2026: 1,192 stars24 Jun 2026: 1,195 stars1 Jul 2026: 1,202 stars8 Jul 2026: 1,209 stars15 Jul 2026: 1,216 stars22 Jul 2026: 1,222 stars29 Jul 2026: 1,228 stars5 Aug 2026: 1,234 stars12 Aug 2026: 1,239 stars19 Aug 2026: 1,245 stars26 Aug 2026: 1,250 stars2 Sept 2026: 1,256 stars9 Sept 2026: 1,257 stars16 Sept 2026: 1,260 stars23 Sept 2026: 1,264 stars30 Sept 2026: 1,272 stars7 Oct 2026: 1,273 stars14 Oct 2026: 1,277 stars21 Oct 2026: 1,278 stars28 Oct 2026: 1,283 stars4 Nov 2026: 1,288 stars11 Nov 2026: 1,292 stars18 Nov 2026: 1,296 stars25 Nov 2026: 1,299 stars

1,111 on 6 May 20261,299 on 25 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

kg-gen is a Python package that turns a string or a list of chat messages into a knowledge graph of entities, edges and relations. It calls models through LiteLLM and uses DSPy for structured output. It supports chunking large inputs, clustering similar entities and relations, merging graphs, and HTML visualization, and ships an MCP server (`kggen mcp`) for agent memory.

Who it is for: Developers building graph-based RAG, synthetic data or agent memory pipelines

Strengths

  • Works with any LiteLLM provider, including OpenAI, Anthropic, Gemini, Deepseek and local Ollama
  • Accepts plain strings or role-tagged message arrays, with chunk_size for large inputs
  • Entity and edge clustering, plus aggregate() to merge graphs from separate texts
  • Built-in visualize() HTML output; paper and MINE benchmark included

Weaknesses

  • Extraction quality depends on the chosen model; every run needs LLM calls
  • No graph database integration or query layer described; output is in-memory graph objects
  • Chunking and clustering add model calls, so cost on large corpora is unclear
  • Last release (2025-11) predates the latest commit (2026-03)

What it needs

  • GPU optional
  • Docker
  • Needs LiteLLM, DSPy
  • Models: OpenAI, Anthropic, Gemini, Deepseek, Ollama

Also in Agent frameworks and SDKs

See all 242
Also in Agent frameworks and SDKs
RankProjectScore
#234betalgo/openaiCommunity .NET client library for the OpenAI API3k starsMIT13 out of 100
#235autopromptPrompt optimizer that tunes prompts against synthetic edge-case benchmarks3k starsApache-2.012 out of 100
#237gptswarmPython library that builds LLM agents as graphs and optimizes their connections Live demo ↗ (opens in a new tab)1.1k starsMIT9 out of 100
#238webarenaSelf-hostable web environment and benchmark for evaluating browser-based agents1.6k starsApache-2.0no commits in a year6 out of 100
#239webthinkerDeep research agent where a reasoning model searches, browses and drafts reports1.5k starsMIT6 out of 100