KARMA is a natural language processing framework that leverages a coordinated multi-agent system to automatically extract, validate, and integrate scientific knowledge into structured knowledge graphs. By employing specialized Large Language Model (LLM) agents, KARMA ensures high-quality knowledge extraction while maintaining semantic consistency.
Note
A primitive version of KARMA has released, we are still working on updating the pipeline. Feel free to provide suggestions.
- Multi-Agent Architecture: Coordinated system of specialized agents for robust knowledge extraction
- Quality-Focused: Multi-stage validation with confidence, clarity, and relevance scoring
- Domain-Adaptive: Specialized for scientific literature processing
- Scalable: Handles both single documents and large-scale batch processing
- PDF and text parsing
- Context-aware content segmentation
- Content summarization
- Entity recognition
- Relationship identification
- Semantic triple formation
- Conflict Resolution
- Multi-dimensional scoring system
- Domain relevance validation
To quickly get started with KARMA, you can run the provided script
python karma_pipeline.py \
--input path/to/document.pdf \
--api_key your-openai-api-key \
--model gpt-4o \
--output results.json
KARMA generates knowledge triples with quality metrics:
{
"results": [
{
"head": "KARMA",
"relation": "uses",
"tail": "Multi-Agent LLMs",
"confidence": 0.85,
"clarity": 0.92,
"relevance": 0.78
},
...
]
}
- Python 3.8+
- Dependencies:
openai>=1.0.0
: LLM integrationPyPDF2>=3.0.0
: PDF processingspacy>=3.0.0
: NLP processingnetworkx>=2.6.0
: Knowledge graph operationstyping-extensions>=4.0.0
: Type hints
We welcome contributions!
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and feedback:
- Open an issue
- Email: yxlu0613@gmail.com
@article{lu2025karma, title={KARMA: Leveraging Multi-Agent LLMs for Automated Knowledge Graph Enrichment}, author={Lu, Yuxing and Wang, Jinzhuo}, journal={arXiv preprint arXiv:2502.06472}, year={2025} }
- All LLMs we ues in our experiments
- PubMed
- All contributors and users