@DanKornas: Your text corpus shouldn’t stay trapped in paragraphs. kg-gen is a Python package for extracting knowledge graphs from …
Summary
kg-gen is an open-source Python package that uses language models (via LiteLLM and DSPy) to extract knowledge graphs from plain text or conversation messages, featuring chunking, clustering, and flexible provider routing.
View Cached Full Text
Cached at: 05/21/26, 05:39 PM
Your text corpus shouldn’t stay trapped in paragraphs.
kg-gen is a Python package for extracting knowledge graphs from plain text or conversation-style message arrays.
It helps you turn raw text into entities, edge labels, and relations by using language models for structured extraction, with LiteLLM for provider routing and DSPy for structured output generation.
Key features:
• Text-to-graph extraction – turns a string into entities, relation types, and subject-relation-object triples • Large-text chunking – process longer inputs in smaller chunks with a chunk_size parameter • Entity + relation clustering – group similar entities and edges during generation or after • Message-array processing – handles role/content messages while preserving order and boundaries • Model-provider flexibility – routes calls through LiteLLM for OpenAI, Ollama, Anthropic, Gemini, Deepseek, and others
It’s open-source (MIT license).
Link in the reply
Similar Articles
KG2Cypher: Data-Centric Pipeline for Building Enterprise Text-to-Cypher Systems
KG2Cypher presents a data-centric pipeline for building enterprise text-to-Cypher systems from existing knowledge graphs. It uses LLMs to generate natural language question-Cypher pairs, validated by an LLM judge and human review, and achieves significant performance improvements on Korean enterprise datasets with LoRA-based fine-tuning.
@DataChaz: Messy documents in. Complex knowledge graphs out. One command line. If your pipeline simply compiles data into generic …
Hyper-Extract is an open-source framework that converts messy documents into typed knowledge structures, supporting multiple graph architectures like GraphRAG, LightRAG, and KG-Gen, with 10+ extraction engines and 80+ YAML templates for various domains.
@DanKornas: Build a knowledge-base agent without starting with a vector DB Knowledge Agent Template is an open-source file-system a…
An open-source knowledge agent template that avoids vector databases by using file-based search (grep, find, cat) and supports multiple platforms like web chat, GitHub, and Discord bots.
@DanKornas: Agent tutorials are noisy. This repo gives you the path. LangGraph 101 is a hands-on tutorial repo for learning LangCha…
LangGraph 101 is an open-source tutorial repo for learning LangChain, LangGraph, and Deep Agents through notebooks and runnable agent examples, organized into fundamental and production-patterns tracks.
@AlphaSignalAI: LLM Knowledge Bases Something I'm finding very useful recently: using LLMs to build personal knowledge bases for variou…
Google's Open Knowledge Format (OKF) proposes a portable standard for organizational knowledge to help AI agents retrieve correct context, addressing fragmentation across data catalogs, wikis, and code.