https://github.com/thejenildgohel/synapse
MCP server: Persistent AI memory + knowledge graph + code search. Local-first. Pure SQLite. npm install -g synapse-cortex
https://github.com/thejenildgohel/synapse
agent-memory ai-agents ai-memory code-intelligence knowledge-graph llm local-first mcp memory model-context-protocol sqlite typescript
Last synced: 16 days ago
JSON representation
MCP server: Persistent AI memory + knowledge graph + code search. Local-first. Pure SQLite. npm install -g synapse-cortex
- Host: GitHub
- URL: https://github.com/thejenildgohel/synapse
- Owner: TheJenilDGohel
- License: mit
- Created: 2026-04-20T16:52:45.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-22T10:24:28.000Z (21 days ago)
- Last Synced: 2026-05-22T16:15:04.407Z (21 days ago)
- Topics: agent-memory, ai-agents, ai-memory, code-intelligence, knowledge-graph, llm, local-first, mcp, memory, model-context-protocol, sqlite, typescript
- Language: TypeScript
- Homepage: https://thejenildgohel.github.io/synapse
- Size: 2.11 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
Synapse
The memory palace for AI agents.
A powerful, self-contained AI context layer combining persistent memory, temporal knowledge graphs, and hybrid code intelligence into a single local engine.
100% Local. Zero Cloud. Private by Design.
---
## šļø The Philosophy: Intelligence in its Place
AI agents today are orators without a palace. Every session starts from nothing ā no memory of past decisions, no map of the codebase, no record of what failed. The signal dies, and you pay the "context tax" every time you re-explain your project.
**Synapse is the memory palace for your AI agents.**
We give every piece of knowledge a place: a code symbol, an architectural decision, a lesson learned, a dependency relationship. Your agent walks the palace and finds exactly what it needs ā entirely on your machine.
---
## ā” See It In Action
**Without Synapse ā the AI starts from zero every session:**
> **User:** "Refactor the auth service like we decided last week"
> **AI:** "I don't have context from previous sessions. Could you remind me what was decided?"
**With Synapse ā the AI picks up exactly where you left off:**
> **User:** "Refactor the auth service like we decided last week"
> **AI:** *[recalls stored decision]* "Based on the architectural decision recorded on May 14th to migrate from session tokens to JWT with refresh-token rotation, here's the refactor for AuthService..."
**Code search that understands intent, not just strings:**
```bash
# grep finds: nothing (no literal "rate limit" in the handler name)
grep -r "rate limit handler" ./src
# Synapse hybrid search finds: the actual implementation
# ā RateLimitMiddleware.ts (semantic: rate limiting logic)
# ā CircuitBreaker.ts (semantic: failure threshold handling)
# ā RetryPolicy.ts (semantic: backoff on limit exceeded)
```
**Knowledge graph with time-travel:**
```bash
# What did AuthService depend on 3 months ago?
kg_as_of --entity "AuthService" --timestamp "2025-02-01"
# ā Redis (session store), PostgreSQL (user table)
# What does it depend on now?
kg_query --entity "AuthService"
# ā PostgreSQL (user table), JWT issuer (new)
# Redis dependency was invalidated on 2025-03-15
```
---
## ⨠Core Capabilities
Synapse is the only MCP server combining temporal time-travel queries with persistent AI memory and hybrid code search in a single local SQLite database.
- **Temporal Knowledge Graph**: A sophisticated entity-triple store with multi-hop traversal and **time-travel querying** (`as_of`). Track architectural facts and dependencies as they evolve.
- **Persistent Agent Memory**: Long-term recall across sessions with semantic deduplication and **agent-scoped isolation**. Perfect for multi-agent workflows.
- **Semantic Code Intelligence**: Hybrid BM25+vector search, AST-aware chunking, and advanced symbol tracking (definitions, usages, and callers).
- **Performance Optimized**: Optimized AST parsing using `WeakMap` memoization (reduced resolution complexity from **O(N²)** to **O(N)**).
---
## š ļø Focused Tool Suites
Synapse tools are organized into focused suites. Instead of a menu of 70+ granular options, agents invoke the right suite for their specific workflow:
- **š Workspace & Discovery**: Navigate files, generate project summaries, and read code with bounded scopes.
- **š Search & Intelligence**: Execute hybrid semantic searches and look up precise AST symbols.
- **š§ Memory & Recall**: Store, retrieve, and deduplicate contextual knowledge across sessions.
- **š Knowledge Graph**: Traverse and manage temporal entity relationships.
- **š¤ Agent Context**: Prime your agent with project-specific "lessons" and capture task outcomes for future recall.
---
## š Quick Start
Get up and running in seconds.
> **Note:** This is `synapse-cortex` by **TheJenilDGohel** ā the MCP server for persistent AI memory + knowledge graph + code intelligence.
> npm: [https://www.npmjs.com/package/synapse-cortex](https://www.npmjs.com/package/synapse-cortex)
```bash
# 1. Install globally
npm install -g synapse-cortex # latest stable
npm install -g synapse-cortex@beta # latest beta
# 2. Setup workspace and local dependencies (ripgrep, sqlite-vec)
synapse setup
# 3. Verify installation health
synapse doctor
```
### Client Configuration (MCP)
Add Synapse to your AI client (Claude Desktop, Cursor, Windsurf, etc.):
```json
{
"mcpServers": {
"synapse": {
"command": "synapse",
"args": ["start"],
"env": {
"SYNAPSE_MEMORY_ENABLED": "true"
}
}
}
}
```
---
## āļø Why Synapse?
| Feature | Synapse | Cloud-based Alternatives |
|:---|:---:|:---:|
| **Privacy** | 100% Local. No data leaves your machine. | Data processed/stored in the cloud. |
| **Persistence** | Cross-session memory & temporal tracking. | Often limited to single-session context. |
| **Intelligence** | AST-aware + Hybrid Search. | Often limited to string matching or basic RAG. |
| **Cost** | Free (Self-hosted). | Monthly subscriptions or per-token fees. |
| **Tradeoff** | Requires local resources (RAM/CPU). | Lightweight local footprint. |
*Self-reported comparison as of May 2026 ā contributions welcome.*
---
## š”ļø Security & Privacy
- **Zero-Cloud Privacy**: All code parsing, embeddings, and database operations happen strictly on your machine.
- **No Telemetry**: We do not track your usage, queries, or code.
- **Local-First Speed**: Powered by pure SQLite with native vector extensions (`sqlite-vec`) for blazing-fast retrieval.
---
## š¤ Community & Support
- **[Documentation](https://thejenildgohel.github.io/Synapse/)** ā *Note: Our documentation site is hosted on Firebase; the Synapse runtime itself is 100% local.*
- **[Contributing](./CONTRIBUTING.md)** ā We welcome PRs and bug reports.
- **[Changelog](./CHANGELOG.md)** ā See what's new.
---
Code intelligence. Knowledge graph. AI memory. One server. Your machine.