Knowledge graph extraction library powered by LLMs
Project description
🧠 Synapse
Transform natural language into a persistent knowledge graph.
Synapse is a Python library that converts unstructured text into a structured knowledge graph by extracting concepts and relationships from natural language.
Instead of storing information as raw text, Synapse organizes information into a graph structure that can be queried, traversed, and extended for building intelligent systems and memory systems.
✨ Features
- Natural language → structured relationships
- Persistent graph storage
- Duplicate prevention
- Case-insensitive querying
- Multi-hop relationship traversal
- Local-first architecture
- Provider-agnostic design
- Extensible memory engine
📦 Installation
pip install synapse-ai
⚡ Quick Start
from synapse import Synapse
brain = Synapse()
brain.add(
"CEO of Apple met Microsoft executives in Seattle."
)
brain.save()
print(
brain.get_relations("Apple")
)
print(
brain.get_indirect_relations("CEO of Apple")
)
Example
Input
Python is used for AI and TensorFlow is used in AI.
Extracted Graph
{
"python": [
("used_for", "ai")
],
"tensorflow": [
("used_in", "ai")
]
}
Project Structure
synapse/
├── __init__.py
├── synapse.py
├── graph.py
├── query.py
├── processor.py
├── extractor.py
├── persistence.py
└── utils.py
⚙️ Design Principles
- Simplicity over complexity
- Local-first architecture
- Incremental development
- Extensibility
- No overengineering
📌 Current Status
✅ V1 Complete
Implemented features:
- Text ingestion
- Relationship extraction
- Graph construction
- Graph persistence
- Query system
- Multi-hop traversal
- Python package support
- Provider-agnostic extractor architecture
🗺️ Roadmap
V2 — Conversational Memory Layer
Build a conversational interface on top of the graph.
Planned capabilities:
- Memory-backed conversations
- Graph-aware retrieval
- Contextual question answering
- Better reasoning over stored knowledge
- Persistent long-term memory
V3 — Agentic Knowledge Graph
Integrate coding agents and sandboxed environments.
Planned capabilities:
- Claude Code integration
- Codex integration
- Live graph construction during conversations
- Automatic graph updates
- Multi-session memory
- Knowledge graph visualization
V4 — Portable Intelligence
Turn Synapse into a transferable memory engine.
Planned capabilities:
- Import knowledge graphs
- Export knowledge graphs
- Transfer memory between LLMs
- Local execution
- Offline mode
- Personal AI memory system
Example:
Claude
↓
Knowledge Graph
↓
Export
↓
GPT
↓
Continue with the same memory
🚀 Vision
Modern AI systems own the intelligence, but they also own the memory.
Synapse aims to separate the two.
The long-term goal is to make memory portable, persistent, and independent of any single model provider.
Memory should belong to the user, not the model.
🧑💻 Author
Piyush Garg
AI/ML enthusiast interested in:
- Knowledge Graphs
- LLM Systems
- Intelligent Agents
- Machine Learning Infrastructure
Building systems at the intersection of memory and intelligence.
📄 License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synapse_pkg-0.1.1.tar.gz.
File metadata
- Download URL: synapse_pkg-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d1111161b0518af6e9feabf2e06be2835556468360668ee1f8ddd49b1d5433
|
|
| MD5 |
b2b92e0bf9ff5aeec5c25ca7211ae1e0
|
|
| BLAKE2b-256 |
5eee490e24f762f47d811b26aaf2080626122fcb202e581bbb7077f11c5c321f
|
File details
Details for the file synapse_pkg-0.1.1-py3-none-any.whl.
File metadata
- Download URL: synapse_pkg-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af5d3b22cefdaaeed9bfacb1d392e1c5f18d47822b0a497dd0bae11e852010c4
|
|
| MD5 |
0893e050ddb48933baf31ce61d7aed6b
|
|
| BLAKE2b-256 |
d9f7d38d3732b2e01364affd151b7c06730909282caf4a272e5cb9871b32295e
|