#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.
Watch puts kg-gen on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.kg-gen is on your watch list. Its new releases and problems show there.
- Stars
- 1.3k
- License
- no license
- Last commit
- Mar 2026
- Last release
- Nov 2025
- Language
- Python
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| Rank | Project | Score |
|---|---|---|
| #234 | betalgo/openaiCommunity .NET client library for the OpenAI API | 13 out of 100 |
| #235 | autopromptPrompt optimizer that tunes prompts against synthetic edge-case benchmarks | 12 out of 100 |
| #237 | gptswarmPython library that builds LLM agents as graphs and optimizes their connections | 9 out of 100 |
| #238 | webarenaSelf-hostable web environment and benchmark for evaluating browser-based agents | 6 out of 100 |
| #239 | webthinkerDeep research agent where a reasoning model searches, browses and drafts reports | 6 out of 100 |