@DanKornas: Your text corpus shouldn’t stay trapped in paragraphs. kg-gen is a Python package for extracting knowledge graphs from …

X AI KOLs Timeline Tools

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.

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
Original Article
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