SynapseVault README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the SynapseVault listing page.

SynapseVault

English | 简体中文 | Changelog (v2.1.1) | Beginner Quick-Start Guide | Full User Manual | 完整操作手册 (中文)

Release: v2.1.1 Python 3.11+ Dependencies: Zero OS: Windows | Linux | macOS License: MIT SynapseVault MCP server – quality and maintenance score on Glama

SynapseVault (llm-memory-local) is a beyond-naive-vector-DB, local-first, zero-dependency Python 3.11+ standard-library structured long-term memory hub for multi-Agent AI workflows.

Stop repeating your preferences, architecture decisions, and debugging lessons every time you switch between Cursor, Claude Code, OpenAI Codex, Antigravity, DeepSeek Harness (dsh), or any MCP-compatible AI assistant.

Working across multiple machines or a team? SynapseVault is 100% free & MIT for single-machine local use. Need < 15 ms offline cross-device sync (Work Laptop ↔ Home Desktop ↔ VPS) over Tailscale/HTTPS + Team RBAC? See SynapseVault Pro (Self-Hosted Hub).

Supported Agents & Automatic Recall Matrix (v2.1.1)

AgentAutomatic First-Turn & Per-Turn InjectionActive MCP Tools (21)Read-Only History Capture
AntigravityYes — bundled plugin plugins/antigravity/synapsevault (PreInvocation hook + same-turn dedup)YesYes
Claude CodeYes — UserPromptSubmit hook (hook-inject)YesYes
CursorYes — beforeSubmitPrompt hook (hook-inject --format cursor-json)YesYes
DeepSeek Harness (dsh)Yes — native dsh-memory-recall host bridge (/api/host-recall/query)YesYes
OpenAI CodexRule-driven (no native per-turn prompt hook yet) — use the hard-trigger AGENTS.md template in Web Console (memory_index ~15 tokens/item)YesYes (Auto-Watch fallback)
  • Antigravity 1-Bundle Setup: Run pip install --no-deps -e ., copy plugins/antigravity/synapsevault to ~/.gemini/config/plugins/synapsevault, and enable SynapseVault in Customizations.
  • Auto-Update Checker (v2.1+): Opt-out anonymous GitHub Release check on startup & every 24h (SYNAPSEVAULT_DISABLE_UPDATE_CHECK=1 to disable) with backup-first 1-click upgrade and automatic rollback on failure.
  • Optional local vector model (Tier 1B): run python deploy/fetch_local_model.py to download and SHA-256-verify the recommended Qwen3-Embedding-0.6B (Q8_0 GGUF, ~610 MiB, Apache-2.0; resumable, honors HTTPS_PROXY, --mirror supported). The model is intentionally not bundled in the repo or release zip (GitHub's 100 MB file limit and the 80 MB self-upgrade archive limit); install llama.cpp for llama-server, then paste both paths into Settings -> Tier 1B. It is an embedding model only and cannot be used for LLM auto-curation (use a >= 7B chat model or a cloud API for that).

Design Philosophy & Architecture

1. Why Not a Naive Vector DB?

Dumping raw chat chunks into a vector database and fetching Top-K by cosine similarity breaks down quickly for long-term coding-agent memory. Modern coding agents (such as Claude Code's CLAUDE.md + MEMORY.md index and Codex's layered AGENTS.md + MEMORY.md) have shifted away from naive vector RAG toward structured, layered, index-first memory.

SynapseVault follows that same structured paradigm — and extends it across tools (bridging Cursor, Claude Code, Codex, Antigravity, dsh, and MCP clients through one local SQLite vault) by directly addressing the 4 failure modes of pure vector memory:

Failure Mode of Pure Vector MemorySynapseVault's Structured Solution
No Time, Version, or Forgetting Semantics (old & new decisions collide)Bi-temporal as_of validity + CAS version chains (memory_revisions) + supersedes / contradicts relations + Decay / Suppress / Anti-resurrection Tombstones
Semantic Similarity ≠ Rule Criticality (zero-overlap project guardrails get missed)Explicit pinned Guaranteed Guardrail Slots ([PINNED #id vN ...]) that are never crowded out under tight Top-3/4 budgets
Near-Duplicate Crowding in Top-K (3 paraphrases of one topic drop parallel facts)Pure-stdlib MMR Diversity Reranking (ratio-to-max scale-invariant normalization), lifting compound multi-fact coverage from 50.0% → 100.0%
Black-Box Un-Auditable Chunks (cannot trace which memory caused a bad answer)Persisted recall_traces audit table (trace_id + [#id vN @machine/client]), 3-Layer Progressive Disclosure MCP (memory_index → memory_timeline → memory_get), and read-only Git-diffable Markdown Mirror (export-md)

2. Two Orthogonal Layers: Lifecycle Forgetting vs. Optional Vector Fallback

SynapseVault intentionally separates memory lifecycle governance from optional vector retrieval:

  • Forgetting & Lifecycle Governance (Decay / Suppress / Tombstone / Revisions) governs what stays true over time: stale transient notes gently decay while frequently verified memories get bounded access reinforcement (pinned, persona, and user_profile are immune to decay); wrong entries can be version-corrected, soft-suppressed, or permanently tombstoned so re-scans never resurrect them.
  • Optional Vector Retrieval (Tier 1A / Tier 1B) is strictly a semantic blind-spot fallback, not the primary engine. Its sole job is rescuing zero-lexical-overlap paraphrases or cross-lingual queries — for example, when a memory is stored only in Chinese (每天上午习惯喝冰美式咖啡) without English search_terms and later queried in English ("What caffeinated beverage do I prefer in the morning?"). Every vector call races against a 620–750 ms deadline with Query Vector LRU caching and falls back seamlessly to Tier 0 on timeout or offline mode.

3. 3-Tier Adaptive Retrieval Engine

Start with zero hardware or API requirements in Tier 0 (97.73% Recall@1 / 100.0% Recall@5 on curated bilingual memories), and opt into Tier 1 semantic fallback only when needed:

TierRoleRuntime RequirementsMemory / VRAMRetrieval StrategyBest For
Tier 0 (Default Primary)Zero-Model Structured Lexical + RelationalPure Python 3.11+ stdlib (SQLite WAL + FTS5)~17–25 MB RAM · 0 MB VRAMNFKC + CJK 2-gram + BM25 + 3× bilingual search_terms + clause MaxSim + dual-scope + 1-hop relations + MMREveryday local use, no-GPU laptops, 100% offline privacy
Tier 1A (Optional Fallback)Cloud / Remote Semantic Blind-Spot Plug-inAny OpenAI-compatible /v1/embeddings API~20–28 MB RAM · 0 MB VRAMTier 0 + Cosine Vector Search fused via RRF + Query Vector LRU + 620–750 ms fail-closed fallback to Tier 0Zero-overlap cross-lingual / fuzzy phrasing without local GPU
Tier 1B (Optional Fallback)Local On-Demand GGUF Semantic Plug-inLocal llama-server + .gguf embedding model0 MB idle VRAM (spawns on backfill, exits immediately)Batch-syncs local vectors on demand, then serves Tier 1 Hybrid RRF offline100% offline semantic fallback on machines with local GPU/CPU

4. End-to-End Capture, Governance & Retrieval Flow

  1. Read-Only Capture & Safety Screening: Turns enter via MCP memory_capture, native dsh bridge, manual import, or the opt-in read-only incremental watcher (never mutates source logs), pass secret/blocked_terms checks and 5-tuple idempotency into the Staging Inbox.
  2. Distillation & Lifecycle Persistence: WebUI curation, a curator Agent, or the opt-in LLM Auto-Curator distills atomic memories (user_profile, episode, transient) with bilingual search_terms and 1-hop typed relations into SQLite WAL with CAS version chains and anti-resurrection tombstones.
  3. Adaptive Recall, MMR, Guardrails & Audit: Substantive queries skip small talk, apply bi-temporal as_of + gentle decay/reinforcement, score via Tier 0 (plus optional Tier 1 RRF race), rerank with MMR, reserve Pinned Guardrail Slots, exclude suppressed/forgotten records (0% leaks), persist a recall_traces audit record, and wrap output in <long_term_memory_context trace_id="..."> with [#id vN @machine/client] provenance.
mermaid
flowchart TD
  subgraph Ingest["1. Capture, Curation & Lifecycle Governance"]
    SRC["Multi-Agent Logs & Clients\n(Cursor / Claude / Codex / dsh / Antigravity)"] -->|"MCP / Hook / Strictly Read-Only Scan"| POL["Secret & Blocked-Term Policy\n+ 5-Tuple Idempotency"]
    POL --> INBOX["Staging Inbox (SQLite)"]
    INBOX -->|"WebUI / Curator Agent / Opt-In LLM Auto-Curator"| DISTILL["Atomic Memories + Bilingual search_terms\n+ 1-Hop Relations + CAS Version Chain"]
    DISTILL --> LIFE["Lifecycle Governance\nBi-Temporal as_of · Decay · Suppress · Tombstone"]
    LIFE --> DB[("Single-File SQLite WAL + FTS5\n+ Recall Traces + Optional Vector Cache")]
  end

  subgraph Recall["2. Structured Recall, Optional Semantic Fallback & Audit"]
    Q["Incoming Query\n(Hook / 16-Tool Progressive MCP / Host Recall)"] --> ABST{"Small-Talk\nAbstention?"}
    ABST -->|"Yes"| EMPTY["Return Empty (0 Noise)"]
    ABST -->|"No"| NORM["NFKC + CJK 2-gram + Identifier Split\n+ Bi-Temporal as_of Validity Filter"]
    NORM --> T0["Tier 0 Primary Engine (0 MB VRAM)\nBM25 + 3x search_terms + Clause MaxSim\n+ Dual-Scope + Gentle Decay/Reinforcement"]
    NORM --> T1{"Optional Tier 1A/1B\nSemantic Fallback?"}
    T1 -->|"Enabled (<= 750ms Race + LRU)"| VEC["Cosine Semantic Rescue\n(Zero-Overlap Paraphrases)"]
    T1 -->|"Off / Timeout Fallback"| RRF["RRF Fusion -> MMR Diversity Rerank\n+ 1-Hop Relation Expansion"]
    T0 --> RRF
    VEC --> RRF
    RRF --> GUARD["Merge Guaranteed Pinned Guardrails\nBlock Suppressed/Tombstoned + Persist recall_traces"]
    GUARD --> OUT["Inject Auditable Budgeted Context\n(trace_id + #id vN @machine/client)"]
  end

  DB -.-> T0
  DB -.-> VEC
  GUARD -.-> DB

Advantage Zone & Honest Positioning

No single memory architecture wins every workload. SynapseVault is intentionally engineered for a specific advantage zone — and is equally explicit about where heavier graph/cloud systems or pure-Markdown tools fit better:

Where SynapseVault Wins (Core Advantage Zone)

DimensionSynapseVault v1.1 Sweet SpotWhy It Matters in Daily Work
Cross-Tool Local HubUnified memory across Cursor, Claude Code, Codex, Antigravity, DeepSeek Harness (dsh), and any MCP clientOne local SQLite vault instead of fragmented per-IDE rules; strictly read-only session scanning never mutates original tool logs.
Zero-Infra FootprintPure Python 3.11+ stdlib (~17–25 MB RAM, 0 MB VRAM, zero Docker / Postgres / Neo4j)Runs effortlessly on laptops without GPUs or containers, with instant Tier 0 fallback even offline.
Governance & AuditabilityVersion chains (memory_revisions), CAS optimistic locks, anti-resurrection tombstones, 4-tier RBAC scoped_tokens, persisted recall_traces, and [#id vN] provenanceWhen an Agent acts on a wrong memory, you can trace the exact trace_id, memory ID, version, client, and score — then correct, suppress, or tombstone it.
Tight-Budget Recall QualityMMR diversity reranking + guaranteed pinned guardrail slots + 3-layer Progressive Disclosure MCP (memory_index → memory_timeline → memory_get)Preserves parallel facts and critical project rules under tight Top-3/4 per-turn budgets, while keeping active MCP exploration ultra-lean.
Modular Upgrade PotentialStrict 4-layer DAG + 8 swappable Layer 0 Protocol contracts + AST-enforced <= 550-line module ceilingSwap in custom rerankers (DiversityReranker), external trace sinks (RecallTraceStore), embeddings (EmbeddingProvider), or exporters (MemoryExporter) without touching core domain logic.
Scale Sweet SpotDozens to ~10,000 distilled atomic facts, rules, preferences, and debugging decisions per local vaultSub-10 ms Tier 0 lexical + MaxSim + MMR latency without index bloat.

Honest Boundaries (When Another Architecture Fits Better)

Workload / RequirementBetter-Suited Category & ExamplesSynapseVault Position
Full-Codebase or 500-Page Raw PDF RAGDedicated code/document RAG indexersSynapseVault stores distilled atomic facts & decisions, not raw 100k-line source trees or raw book PDFs.
Million-Entity Enterprise Temporal Knowledge GraphServer-backed graph/DB systems (Zep / Graphiti, Hindsight, Mem0 cloud/Postgres/Neo4j)SynapseVault deliberately avoids Neo4j/Postgres/Docker to stay single-file local and zero-ops.
Autonomous Stateful Agent OS RuntimeSelf-editing runtime frameworks (Letta / MemGPT)SynapseVault is a tool-agnostic external vault (MCP + Hook), not a replacement Agent runtime.
Single-Tool Built-In Markdown MemoryNative per-tool files (Claude Code MEMORY.md, Codex AGENTS.md)Complementary, not mutually exclusive: keep static repo instructions in CLAUDE.md/AGENTS.md, and use SynapseVault to bridge dynamic memory across all your tools and scale past 200-line file limits.
Obsidian-First Manual Note EditingFile-first Markdown vaults (Basic Memory, ByteRover)SQLite is SynapseVault's transactional source of truth; use synapsevault export-md whenever you want a clean, read-only, Git-diffable Markdown mirror.
Multi-Device Public Cloud SyncHosted memory APIs (Supermemory, Mem0 Cloud)Track 1 binds strictly to 127.0.0.1 loopback for privacy; cross-device self-hosted sync is available in Track 2 (llm-memory-hub Pro) via the SyncTransport contract.

Measured Benchmarks (Honest Dual-Baseline)

We separate structured retrieval ablations (comparing against strong structured baselines on the same vault) from raw-history compression (comparing against re-reading raw chat logs) so every number has a clear, reproducible baseline.

1. Structured Retrieval Ablation (python -m eval.benchmark_ablation · v1.1)

Tested on compound queries containing 3× near-duplicate paraphrases + distinct parallel facts, pinned project guardrails, and bi-temporal supersession:

Retrieval StrategyMulti-Fact CoveragePinned Guardrail AdherenceBi-Temporal as_ofAvg Injected TokensTrace AuditP95 Latency
Top-10 Unfiltered Lexical100.0%16.7%—184.00.0%5.52 ms
Top-3 Nearest-Neighbor (No MMR, No Guardrail)50.0% (near-dupes crowd out parallel facts)0.0%—72.80.0%4.32 ms
Top-3 Pure MMR (λ=0.65)100.0% (+50.0 pp)——~73—< 6 ms
SynapseVault v1.1 (1 Guardrail + 3 MMR + recall_traces)100.0% (+50.0 pp vs Top-3)100.0%100.0%100.5 (45.4% saved vs Top-10)100.0%15.02 ms (incl. SQLite trace write)

2. Core Bilingual Stress & Raw-History Comparison (python -m eval.benchmark_v2 · Tier 0 · 0 MB VRAM)

MetricBaselineSynapseVault (Tier 0)Improvement
Context Tokens vs Raw History (4 real multi-Agent sessions)27,502 user-only tokens (1.75M full raw JSONL)59.6 avg tokens per top-3 injection (max 97)99.78% saved vs raw full history (461× smaller)
Retrieval Latency233.2 ms brute-force scan across 40 local logs4.93 ms P95 in-process (6.34 ms P50 @ 1,000 memories)47× faster (37× @ 1k scale)
Real-World Recall (12 cross-Agent queries)0% cold start · 58.3% naive keyword search100.0% Recall@1 (12/12, MRR 1.000)+41.7 pp over naive search
Bilingual Stress Recall (44 queries + 1,000 memories)63.6% R@1 / 68.2% R@5 naive search97.73% R@1 / 100.0% R@5 (0 leaks)+34.1 pp R@1 / +31.8 pp R@5
Idle FootprintHeavy resident embedding / vector DB containers~17–25 MB RAM · 0 MB VRAMPure stdlib SQLite WAL + FTS5

What's New in v2.0.0 (Major Milestone · 100% Backward-Compatible with v1.x)

Upgrading from v1.x is completely automatic and lossless (SQLite schema v2 -> v5, zero breaking API/MCP changes). Full notes in CHANGELOG.md.

  • Unified Conflict & Machine-Env Review Modal (with Smart Defaults): Unresolved contradicts pairs and machine-bound configs (env:<machine>) surface together in a 1-by-1 decision popup with deterministic ★ Default Pick recommendations (human_verified > code_observed > doc_extracted > agent_inferred > pinned > newer), Prev / Next navigation with draft preservation, Keep Both, and 1-click Resolve All Defaults / Rollbackable Approve All.
  • Safe Backup-First 1-Click Agent Auto-Write & Honest Connection Status: Auto-detects config files for Antigravity, Cursor, Claude, Codex, and DeepSeek Harness (dsh); previews exact merged changes (dry_run), creates unique .bak-synapsevault-* backups before atomic writes, enforces strict directory/filename/symlink guardrails, distinguishes ● Live vs ✓ Written · Restart App vs ⏳ Awaiting Config, and offers 1-click Cancel / Disconnect & Revoke (never deletes imported memories).
  • Per-Session Import Badges & Anti-Echo Filtering: Displays ✓ Imported X/N and per-session ✓ Imported / 🔄 +K new badges with 3-layer idempotent deduplication across reconnects, and automatically strips injected <long_term_memory_context> / [记忆 #N | Top-K] blocks so recalled memory never echoes back into chat imports. (Note: Staging Inbox intentionally buffers raw chats for noise-free distillation by the opt-in LLM Auto-Curator / Curator Agent and holds machine-local configs for human review.)
  • Next-Gen Web Console (Light & Dark Themes · Smooth Accordions · Spotlight Tour): One-click Light / Dark theme toggle (including Light-adapted 2D/3D Canvas Graph), zero-flash CSS Grid accordions across all collapsible panels, Memories Module Filter dropdown, streamlined ⋯ row menus with 1-click 🔒 Make Decay-Immune (user_profile), clickable Active / Inbox shortcut pills, and a 9-step Interactive Spotlight Walkthrough Tour.
  • Hardened & ARM64-Verified: Passed 2 rounds of independent adversarial security & UX audits (0 P0 remaining), 63/63 unit & architecture-guard tests (<= 550 lines/module, 0 third-party Python deps, 0 CDN), and native ARM64 Linux CI (ubuntu-24.04-arm).

Key Features

  • 3 Connection Modes for Every Agent (User-Selectable):
    • Mode A (Automatic Per-Turn Injection): Native host bridge for dsh; fail-closed hook-inject CLI for Claude Code (UserPromptSubmit), Cursor (beforeSubmitPrompt), and generic hooks — emitting trace_id, guaranteed [PINNED #id vN ...] guardrails, auth=<source_authority> provenance, and [CONFLICT with=...] cues.
    • Mode B (Standard MCP Tools — 21 Tools): Zero-dependency MCP stdio server covering standard CRUD/search/curation/relations/vectors plus 3-Layer Progressive Disclosure (memory_index, memory_timeline, memory_get), memory_traces, memory_pin, memory_module, memory_reclassify, memory_batch, and memory_reviews.
    • Mode A + B Together: Automatic per-turn recall + full MCP read/write/progressive-disclosure/audit tools.
  • Machine-Environment Scope (env:<machine>), One-by-One Review Modal & 2D/3D Module-Aware Graph (v1.4.0):
    • 3-Layer Scope Isolation (personal / env:<machine> / project:<slug>): Keeps machine-local proxies, toolchains, and LAN hosts in env:<machine> (auto-joined for local recall, strictly isolated across machines via bound_machine RBAC, and unmount-capable in Modular Packs).
    • One-by-One Human Review Modal + Rollbackable Approve All: Machine-bound configs detected during curation are staged for explicit per-item decisions (Allow -> env:<machine> / Keep in project / Promote -> personal / Discard) with inline editing, plus a One-Click Approve All logged to batch_audit_log for 1-click atomic rollback (restoring both memories and pending reviews).
    • Pure-Canvas 2D / 3D Dual-Mode Relation Graph (Zero CDN, Zero WebGL): Hover any node to highlight all memories in the same module (Scope / Topic / Kind), render 2D Convex Hull outlines & viewport-clamped tooltips, lock focus via Module Capsules, inspect clickable neighbors, or orbit the 3D Star Map across 4 projection presets.
  • Full-Auto Global Promotion, Bulk Remediation & Adaptive Injection (v1.3.0):
    • Auto-Curator Scope Routing + Leak Guardrail: Automatically promotes generic cross-project lessons & daily-chat habits into personal (pinned=False) while deterministically demoting any leaked project slugs, local absolute paths, or private IPs/internal hosts back to project:<slug> (supports auto and confirm modes, with batch_id rollback).
    • Single-Item Reclassify/Promote & Two-Phase Bulk Remediation: In-place scope/kind reclassification, one-click scrubbed promotion to global personal, plus filtered bulk move_scope/reclassify/replace/supersede/suppress/restore/forget protected by mandatory dry_run → confirm_token preview and atomic 1-click rollback_batch.
    • Adaptive Dynamic Injection Cutoff: Dual-gate relevance cutoff (min_score + min_ratio_to_top) dynamically injects 0 items on irrelevant queries, 1 item on simple queries, or expands up to limit on rich multi-fact queries (exempting pinned guardrails and contradicts conflict pairs).
  • 4-Tier Truth Authority & Conflict-Safe Recall (v1.2.0): Ranks conflicting multi-source facts by human_verified > code_observed > doc_extracted > agent_inferred, automatically folds active bi-temporal supersedes chains out of default recall (recoverable via as_of or include_superseded), and protects confirmed contradicts pairs from MMR duplicate suppression with explicit [CONFLICT] cues so the LLM surfaces disagreements and asks the user rather than guessing.
  • Modular Memory Packs — Core vs Project/Client Isolation (v1.2.0): Cleanly separates evergreen Core Memory (personal) from project/client modules (project:<slug> scopes & #topic packs). When a client task finishes, Unmount it in 1 click (WebUI / synapsevault module unmount / MCP memory_module) to stop all future recall injections with zero data loss, or batch Archive / Forget (with a hard guardrail protecting whole-personal core).
  • Customizable Recall Injection Budget (lean / balanced / deep / custom): Tune injection depth vs token spend (1–15 items, 0–5 pinned guardrail slots, 240–8000 chars, MMR λ) globally or per Agent client right from the WebUI Settings panel, HTTP /v1/config/recall-budget, or CLI (synapsevault budget set --preset deep --client claude-code) — takes effect immediately across hooks with zero client restarts.
  • Strictly Read-Only Multi-Agent Session Scanner: Auto-discovers local logs from Antigravity, Codex, DeepSeek Harness (.jsonl.zstd & projcache), Cursor (agent-transcripts/*.jsonl & read-only state.vscdb), Claude Code, plus persistent custom scan folders (.jsonl, .json, .md, .txt).
  • Auditable Governance & Markdown Mirror: Full memory_revisions version history, anti-resurrection tombstones, 4-tier RBAC scoped_tokens, persisted recall_traces (synapsevault traces), pin guardrails (synapsevault pin <id>), and deterministic read-only Markdown export (synapsevault export-md --out ./mirror).
  • Opt-In Full-Auto Loop: Background incremental read-only watcher + OpenAI-compatible Cloud/Local LLM Auto-Curator (disabled by default for zero idle overhead).
  • Zero-CDN Bilingual Web Console (ZH / EN): Agent Mount Manager, Memory Search/Edit/History, Dynamic Topics, Inbox Curation, 2D Knowledge Graph, and an interactive 4-step Quick-Start Guide.

Quick Start (3 Steps)

First time setting up MCP or local AI memory? Follow the step-by-step Beginner Quick-Start Guide (中文版). For daily operations, all 7 WebUI tabs, CLI flags, and 16 MCP tools, see the Full User Manual (完整操作手册).

bash
# 1. Clone and start loopback daemon (Python 3.11+, zero pip install required)
git clone https://github.com/Krittof/SynapseVault.git
cd SynapseVault
python -m llm_memory.clients.cli daemon --port 8775

# 2. In a second terminal, fetch your local admin token
python -m llm_memory.clients.cli token bootstrap
  1. Open http://127.0.0.1:8775/, paste the lm2_... token, open Agent Mounts, choose Mode A / Mode B / Mode A+B, click Connect, and paste the auto-filled snippet into your Agent.

Where is the Management UI? The built-in Web Console lives in ui/web-console/ and is served automatically at http://127.0.0.1:8775/ whenever the daemon runs (zero build, no Node.js required; do not double-click index.html directly). An optional standalone 3D Star Map viewer lives in ui/desktop-3d/ (cd ui/desktop-3d && npm install && npm start). See USER_MANUAL.md.


Customizing Recall Injection Budget (Token Spend vs Recall Depth)

SynapseVault does not hardcode a fixed 3-item injection. You can tune injection volume globally or per Agent client at any time (takes effect immediately across hooks without restarting clients):

PresetItems (limit)Pinned GuardrailsMax CharsMMR λTypical Use
lean319000.65Ultra-low token spend (~60–80 tokens/turn)
balanced (default)4114000.72Everyday multi-Agent coding (~100–130 tokens/turn)
deep8232000.78Complex multi-module refactors & deep context
custom1–150–5240–80000.05–1.0Fine-grained per-turn or per-client tuning
bash
# 1. Switch global preset (lean = 3 items / 900 chars, deep = 8 items / 3200 chars)
python -m llm_memory.clients.cli budget set --preset lean
python -m llm_memory.clients.cli budget set --preset deep

# 2. Set different budgets per Agent client (e.g. lean for Cursor, 10-item deep for Claude Code)
python -m llm_memory.clients.cli budget set --client cursor --preset lean
python -m llm_memory.clients.cli budget set --client claude-code --limit 10 --guaranteed 2 --max-chars 4000

# 3. Inspect current global & per-client budgets
python -m llm_memory.clients.cli budget show
  • WebUI Live Switch: Open http://127.0.0.1:8775/ → Settings → Custom Recall Injection Budget to switch presets, adjust sliders with real-time token estimates, or add/remove per-client overrides.
  • Precedence: Per-request explicit flags > Per-client override > Global policy (for the frozen dsh Node adapter, item count scales cleanly within 1–5 to preserve adapter compatibility).

One-Click Agent Deploy & Mount Prompt

Copy and paste the prompt below directly into Cursor, Claude Code, Codex, Antigravity, or DeepSeek Harness (dsh) to let your AI assistant deploy, verify, and mount SynapseVault automatically:

markdown
Help me deploy and mount SynapseVault (https://github.com/Krittof/SynapseVault) locally on my machine. Follow these steps strictly:

1. **Environment check**: Verify Python >= 3.11 (`python --version` or `python3 --version`) and capture the absolute path of the Python executable.
2. **Clone & verify**: Clone `https://github.com/Krittof/SynapseVault.git` into a dedicated folder (do not scatter files into system directories), then run `python -m unittest discover -s tests/v2 -v` to confirm all tests pass.
3. **Start loopback daemon**: Check if `http://127.0.0.1:8775/v1/health` is already live. If not, start the loopback daemon (`python -m llm_memory.clients.cli daemon --port 8775`, or register auto-start via `deploy/install.ps1` on Windows / `deploy/install.sh` on Linux/macOS after asking me).
4. **Issue least-privilege token**: Issue a scoped token for THIS client (`python -m llm_memory.clients.cli token issue --role contributor --client <client-name> --machine local --scopes "*"`; add `--allow-dsh-host` if mounting `dsh`). Never echo raw tokens back in chat logs unnecessarily.
5. **Non-destructive mount**: Back up my existing client config before editing, then **merge** (never overwrite other MCP servers or settings!) the SynapseVault config using absolute paths for both `python` and `PYTHONPATH`:
   - Choose my preferred mode (ask me first if unclear): **Mode A** (Auto-Inject hook via `hook-inject` / `dsh` host bridge), **Mode B** (Standard MCP `llm_memory.clients.mcp_stdio`), or **Mode A + B** (recommended).
   - Also append the short Auto-Recall / Auto-Capture rule snippet to my client's rules file (`AGENTS.md` / `CLAUDE.md` / `.cursor/rules/llm-memory.mdc` / Global Rules) if I approve.
6. **Verify & report**: Verify `/v1/health`, run a quick smoke check via `hook-inject` or `memory_status`, and tell me the WebUI URL (`http://127.0.0.1:8775/`) plus how to retrieve the admin token (`python -m llm_memory.clients.cli token bootstrap`). Do NOT modify or delete any of my historical chat logs.

Common Deployment Pitfalls & Fixes

Pitfall / SymptomRoot CauseSolution
No module named llm_memory when MCP / Hook launchesIDE spawns python outside the repo directory without PYTHONPATH.Set PYTHONPATH to the absolute repo path in env, or run pip install --no-deps -e . once inside the repo.
python not found or wrong Python (< 3.11) in MCP subprocessGUI IDEs often do not inherit your shell PATH / conda / pyenv.Always use the absolute path to your Python 3.11+ executable (auto-filled in WebUI templates).
Daemon fails to start (Another llm-memory daemon instance is already running or port in use)An instance already owns daemon.lock, or another service uses 8775.Check http://127.0.0.1:8775/v1/health first; if another app uses 8775, switch to --port 8776 and update --origin in client configs.
HTTP 401 Unauthorized or HTTP 403 client_unmountedWrong/revoked token, or the Agent toggle was paused in WebUI.Re-issue a scoped token for 401; for 403 client_unmounted, simply flip the Agent's switch back ON in Agent Mounts (no re-paste needed).
PowerShell blocks deploy\install.ps1 (ExecutionPolicy)Windows default script execution restriction.Run powershell -ExecutionPolicy Bypass -File .\deploy\install.ps1 -Port 8775 -RegisterTask.
Linux / macOS Permission denied on deploy/install.shExecutable bit not set after checkout/download.Run chmod +x ./deploy/install.sh && ./deploy/install.sh --port 8775 --register-service.
Existing MCP servers disappeared after agent editAgent overwrote mcp.json / settings.json / config.toml instead of merging.Restore the .bak backup and merge only the llm-memory-local block into mcpServers / hooks.
dsh .jsonl.zstd logs show fewer turns on a clean Python 3.11–3.13 machinePure stdlib falls back to session_projcache/*.json when zstandard is absent.Optional: install pip install zstandard (or use Python 3.14+ stdlib compression.zstd) to stream-decompress full multi-frame .zstd logs.

Cross-Platform Compatibility

OSDaemon & CoreCredential ProtectionAuto-Start ScriptVerified
Windows 10 / 11Python 3.11+ stdlib, msvcrt lockWindows DPAPI (.dpapi).\deploy\install.ps1 -Port 8775 -RegisterTask (conhost --headless)Full 44-test suite PASS
Linux (Ubuntu / Debian / Arch)Python 3.11+ stdlib, fcntl lock0600 atomic file permissions./deploy/install.sh --port 8775 --register-service (systemd --user)Full 44-test suite PASS (GitHub CI & WSL2)
macOS (Apple Silicon / Intel)Python 3.11+ stdlib, fcntl lock, resource RSS0600 atomic file permissions./deploy/install.sh --port 8775 --register-service (launchd)Full 44-test suite PASS (GitHub CI)

Verification & Benchmarks

bash
# Full 44-test suite (architecture guards, RBAC, MCP 16 tools, hooks, MMR, recall_budget, traces, export)
python -m unittest discover -s tests/v2 -v

# Bilingual Tier 0 Recall@5 benchmark
python -m eval.benchmark_v2

# Structured ablation benchmark (Top-10 vs Top-3 No-MMR vs SynapseVault v1.1 MMR + Guardrail + Trace)
python -m eval.benchmark_ablation

Free Local (Track 1) vs. Self-Hosted Hub Pro (Track 2)

SynapseVault (this repository, v2.0.0) is 100% free, MIT-licensed, and fully functional for single-machine multi-agent memory on 127.0.0.1 (~17–25 MB RAM, zero third-party dependencies, Schema v5, 21-tool progressive MCP, env:<machine> scope isolation, Pure-Canvas 2D/3D graph, customizable recall budgets, MMR diversity, and recall traces).

If you work across multiple machines (e.g., Work Laptop ↔ Home Desktop ↔ Linux VPS) or want a private team memory hub without running Postgres/Qdrant/Docker bloat — or risking SQLite corruption on Google Drive/Dropbox — there is an optional commercial self-hosted Pro Kit (SynapseVault Pro, one-time license, no recurring subscription, includes 12 months of all updates):

CapabilitySynapseVault Local (Free · MIT · v2.0)SynapseVault Pro ($49 one-time · Self-Hosted Hub)
Single-machine loopback daemon (127.0.0.1, ~21–32 MB RAM, Pure-Canvas 2D/3D Graph)Schema v5 (Included)Schema v5 + SQLite FTS5 + Perf Profiles
21-tool Progressive MCP stdio + env:<machine> + 4-tier Truth Authority + Recall TracesIncludedIncluded
Authoritative Hub sync (/v1/sync/delta, batch capture, hot encrypted backup export)—Included
Streamable HTTP /mcp (21 tools) + per-token rate limiting + server machine stamping—Included
PC edge-sync mirror (< 15 ms offline reads + SIGKILL-safe Outbox + tombstone purge + synced budgets)—Included
Built-in standalone Mode B scheduled LLM curator (curator-run) + Mode A draft fallback—Included
Tailscale zero-domain HTTPS, 2-minute Docker + Caddy stack, init / setup --apply / doctor / archive CLI—Included

Future Roadmap

  • Self-Created Detached Multi-Vaults with Per-Agent ACL: Create physically separate SQLite memory libraries at custom paths/drives, bind each library to specific allowed Agents, and enforce per-library offline locks. See docs/ROADMAP_MULTI_VAULT.md.

Security & Contributing