Discover and explore top open-source AI tools and projects—updated daily.
rahulnykPython library for text-to-knowledge graph conversion
Top 100.0% on SourcePulse
A Python library designed to transform arbitrary text into structured knowledge graphs, leveraging user-defined ontologies and Large Language Models (LLMs). It targets researchers, developers, and power users seeking to analyze textual data, uncover hidden relationships, and enable advanced applications like Graph Retrieval Augmented Generation (GRAG) for more profound document interaction. The primary benefit is enhanced text comprehension and the creation of queryable, interconnected knowledge structures.
How It Works
The core approach involves defining a graph ontology using Pydantic models for entity labels and relationships. Input text is segmented into manageable chunks (800-1200 tokens recommended) to accommodate LLM context windows. Each chunk is processed by a selected LLM client (OpenAI or Groq) via a GraphMaker instance, which uses tuned prompts to extract entities and relationships conforming to the ontology. The library includes robust error handling for LLM responses, automatically correcting JSON parsing failures. The output is a list of Edge objects representing the knowledge graph, which can optionally be persisted to Neo4j for further analysis, visualization, or RAG implementation.
Quick Start & Requirements
pip install knowledge-graph-makerGROQ_API_KEY or OPENAI_API_KEY.NEO4J_USERNAME, NEO4J_PASSWORD, NEO4J_URI.Highlighted Details
Maintenance & Community
No specific details regarding maintainers, community channels (like Discord/Slack), sponsorships, or roadmap were provided in the README excerpt.
Licensing & Compatibility
The license type is not explicitly stated in the provided README content. This omission requires further investigation before commercial use or integration into closed-source projects.
Limitations & Caveats
The accuracy of the generated knowledge graph is contingent upon the chosen LLM, the defined ontology, and the quality of the input text. LLM context window limitations necessitate text chunking, potentially leading to fragmented graph segments if not managed carefully. API rate limits for LLM services may require implementing delays between processing chunks.
1 year ago
Inactive
varunshenoy
neo4j-labs