Knowledge graph extraction library powered by LLMs
Project description
Synapse V2
Incremental Repository Memory for AI Systems
Modern AI coding assistants can reason about code, but they repeatedly forget the repository they are working on.
Every new conversation often starts from scratch, requiring the model to rediscover architecture, features, design decisions, and project evolution from thousands of lines of code.
Synapse V2 treats a Git repository as a continuously evolving source of knowledge rather than a static snapshot.
Instead of reprocessing an entire repository every time, Synapse incrementally builds and maintains a Repository Memory that can be reused across conversations, tools, and AI systems.
Why Synapse?
Large software repositories contain years of engineering knowledge spread across:
- Source code
- Commit history
- Architectural evolution
- Engineering decisions
- Feature additions
- Documentation
Traditional repository summarization tools typically analyze only the latest state of a repository.
As repositories grow, repeatedly asking an LLM to understand the repository becomes increasingly expensive and inefficient.
The repository already contains its own history.
The challenge is transforming that history into a compact, durable memory representation.
Repository Memory Pipeline
Git Repository
│
▼
Repository Changes
│
▼
Knowledge Extraction
│
▼
Repository Memory
│
▼
Future Incremental Updates
Rather than producing a one-time summary, Synapse continuously maintains a semantic memory of the repository.
What Synapse Extracts
Synapse attempts to preserve long-term repository knowledge including:
- Repository purpose
- Architecture
- Engineering decisions
- Design principles
- User-facing features
- Current capabilities
- Architectural evolution
The objective is not to summarize every commit, but to construct a stable repository ontology that evolves alongside the project.
Installation
Requirements
- Python 3.10+
- Git
- Ollama
Install the required model (recommended):
ollama pull qwen3:14b-q4_K_M
Install Synapse:
pip install synapse-pkg
Usage
Initialize Synapse inside any Git repository:
synapse init
This creates the .synapse/ directory containing:
.synapse/
├── metadata.json
├── context.json
├── compressed_context.json
└── config.json
Set up and select the local Ollama model:
synapse setup
Build the initial Repository Context and Repository Memory:
synapse knowledge
On the first execution, Synapse processes the repository history.
Future executions process only commits that have not previously been analyzed, automatically updating the Repository Memory.
Incremental Processing
The first execution processes the repository history.
Subsequent executions process only commits that have not previously been analyzed.
First Run
─────────
Entire Repository
│
▼
Repository Memory
Future Runs
───────────
New Commits
│
▼
Updated Repository Memory
Repository metadata stores the last processed commit, allowing future executions to continue from where the previous run ended.
Adaptive Processing Strategy
Different repositories require different processing strategies.
Synapse automatically selects one of three strategies.
Log Strategy
Used for repositories with a relatively small amount of new history.
Each commit is processed individually, preserving architectural evolution with the highest fidelity.
Evolution Diff Strategy
For larger repositories, Synapse periodically compares snapshots of repository evolution instead of processing every individual commit.
This significantly reduces processing cost while preserving long-term architectural changes.
Full Repository Diff
For extremely large repositories (currently more than 100,000 commits), Synapse processes a single diff between the last processed commit and the current HEAD.
This provides a scalable fallback that allows Synapse to continue operating efficiently even on repositories with extremely large histories.
Repository Context
Synapse maintains two persistent representations.
Repository Context
A structured historical representation containing processed repository changes.
This serves as the historical source of truth during repository processing.
Repository Memory
A continuously evolving semantic representation optimized for LLM consumption.
The memory is intentionally compact while preserving durable architectural understanding.
Why This Matters
Without persistent repository memory:
Repository
│
▼
Language Model
│
▼
Forget
With Synapse:
Repository
│
▼
Repository Memory
│
▼
Any Language Model
Repository understanding becomes reusable instead of being reconstructed every conversation.
Current Features
- Git repository initialization
- Automatic repository processing
- Incremental repository updates
- Adaptive processing strategy selection
- Repository Context generation
- Repository Memory generation
- Large commit splitting
- Automatic metadata tracking
- Persistent repository memory
Testing
Synapse V2 is currently in alpha and is undergoing testing on repositories of varying sizes and commit histories.
Current testing focuses on:
- Repository memory quality
- Incremental update correctness
- Processing strategy selection
- Large commit handling
- Repository scalability
- LLM extraction consistency
- Memory compression quality
Performance benchmarks will be published after testing has been completed across multiple repositories and hardware configurations.
Current Status
Synapse V2 is currently in alpha.
The repository ingestion pipeline is complete, and the current focus is improving repository memory quality, ontology consistency, and extraction accuracy through real-world testing.
Future Work
Repository Memory is intended to become the foundation for additional capabilities built on persistent repository understanding.
The exact direction of future versions is still evolving, with the immediate focus remaining on improving the quality, scalability, and usefulness of Repository Memory.
Vision
Language models provide reasoning.
Repositories contain knowledge.
Synapse aims to separate repository memory from the language model itself.
The long-term goal is to create a reusable, incremental, portable memory layer that evolves alongside software projects and can be shared across different AI systems without repeatedly reconstructing repository understanding.
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-2.0.0a6.tar.gz.
File metadata
- Download URL: synapse_pkg-2.0.0a6.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d310120d7f4f5f8ef629b191fb5ae3ec58f3de2a618921b4b75d61bed9ade2b0
|
|
| MD5 |
ddd9de30c6dafc27f9dbea4a7db3e510
|
|
| BLAKE2b-256 |
e68ca706ec6bb1726504f6da1563f2fdd296bbbb59ce404518bf953782c7c49b
|
File details
Details for the file synapse_pkg-2.0.0a6-py3-none-any.whl.
File metadata
- Download URL: synapse_pkg-2.0.0a6-py3-none-any.whl
- Upload date:
- Size: 15.1 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 |
e4ebbae5de8da30a6ba9a062ccb551ab81d20783a681e89f417e01ac12554dbf
|
|
| MD5 |
cbfb5c2900dd588490587df321d9a9ea
|
|
| BLAKE2b-256 |
a6b2b970977bc7cd47895430d67bf6d4613ab965d6eeec49ea7ca06433f8c12e
|