Synapse Causal Memory README

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

🧠 Synapse Kit (synapse-kit)

AI-Native Unified Twin-Core: Polyglot Compiler Engine & Causal Memory 2.0 Brain
🌐 Language / μ–Έμ–΄: English (Global) | ν•œκ΅­μ–΄ (Korean)
Official Website: https://synapse.minseok.online | Memory Portal: https://synapse.minseok.online/memory/

npm version License: MIT Bun Supported Languages

Synapse Kit is a next-generation AI-native twin-core framework coupling a blazing-fast 10-language compiler engine (compiler/) with an AI agent 0-token causal memory brain (memory/).


πŸ“Œ Table of Contents

  1. πŸ›οΈ Top-Level Twin-Core Architecture
  2. πŸ’Ύ Causal Memory 2.0 & 3 Core Safeguards
  3. πŸ“Š Empirical Benchmarks (800K Monorepo & 100K Memory)
  4. πŸš€ Quick Start
  5. πŸ’» Dual Independent CLI Commands
  6. πŸ“¦ Sub-path Imports Support
  7. License

πŸ›οΈ Top-Level Twin-Core Architecture

The repository and package layout strictly decouples the compiler and memory into equal peer modules at the root:

text
synapse-kit/
β”œβ”€β”€ compiler/           βž” ⚑ [Synapse Compiler] Concurrent polyglot check, build & bundle
β”œβ”€β”€ memory/             βž” πŸ’Ύ [Synapse Memory] 100,000-rule SQLite WAL causal memory brain
└── db/                 βž” πŸ—„οΈ [Synapse DB] Universal Markdown-First & In-Memory Connectome DB
  • synapse-compiler (synapse-kit/compiler): For teams and CI pipelines wanting pure, ultra-fast monorepo build acceleration.
  • synapse-causal-memory (synapse-kit/memory): For Claude Code, Cursor, and Antigravity agents seeking 99.2% token compression.
  • synapse-db (synapse-kit/db): Universal Markdown-First & In-Memory Connectome Database with Wikilink Auto-Wiring, Korean 2-gram BM25 search, SQLite/JSON migrator, and Obsidian .canvas exporter.

πŸ’Ύ Causal Memory 2.0 & 3 Core Safeguards

Replaces unindexed text-dumping graphs with a structured Cause βž” Invariant βž” Effect resonance engine.

  1. πŸ›‘οΈ 2-Tier Hybrid Architecture (Zero Memory Loss)
    • Tier 1 (Global Invariants): Constant 50 tokens (preserves terminal prefs and global constraints in zero-shot tasks).
    • Tier 2 (Domain Resonance): 10~30 tokens precisely injected only upon matched files/keywords; 0.00s skip for unrelated work.
  2. βš™οΈ Git & AST Auto-Harvesting (Zero Maintenance Cost)
    • Automatically harvests and tunes file triggers from Git diffs and AST symbols upon passing synapse check/build.
  3. πŸ”’ Single SQLite WAL Mode (Atomic Concurrency)
    • Guarantees non-blocking concurrent reads and ACID atomic writes across multi-agent and dashboard environments via PRAGMA journal_mode = WAL.

πŸ“Š Empirical Benchmarks

DomainScenarioTraditional CI / ToolchainsSynapse Kit v0.2.2Improvement
Compiler7-Language 800K LOC Full Check28.13s (Sequential sum)1.54s ~ 19.92s (Parallel)Up to 28x faster
CompilerSvelte 5 + TS 7.1 Native Fusion149.21s (Legacy tsc)0.78s (Native Oxc)-99.5% reduction
CompilerSingle-File Edit Causal Skip28.13s (Full rerun)0.31s (700K lines 0.00s)-98.9% faster
Memory500-Warning Burst Context Diet42,673 Tokens (Raw ANSI)351 Tokens (Min JSON)-99.2% diet (121.6x)
Memory100,000 Causal Rules Evaluation450 ms (JSON parse)1.72 ms (SQLite WAL)261x faster

πŸš€ Quick Start

bash
# 1. Install package
bun add -d synapse-kit

# 2. Initialize configuration
bunx synapse init

# 3. Run causal verification (0.00s skip on clean files)
bunx synapse check

# 4. Minimal compact JSON mode for AI agents
bunx synapse check --compact

πŸ’» Dual Independent CLI Commands

1. Compiler CLI (synapse)

bash
bunx synapse check           # Everyday causal smart check
bunx synapse check --all     # Full verification across all 10 checkers
bunx synapse check -i        # Live in-memory hotfix watcher (0.05s upon save)
bunx synapse build           # Multi-track incremental parallel build
bunx synapse package         # Single NSIS target + zlib high-speed streaming
bunx synapse sign            # Cryptographic Minisign Ed25519 binary signing

2. Causal Memory CLI (synapse-memory)

bash
bunx synapse-memory query --files "compiler/core/engine.ts"  # Query active invariants
bunx synapse-memory audit                                    # Integrity audit of 100k rules
bunx synapse-memory harvest                                  # Auto-harvest Git triggers
bunx synapse-memory serve --port 4242                        # Start local daemon & MCP stdio

πŸ“¦ Sub-path Imports Support

Import only what you need:

server.ts
// 1. Unified Entrypoint
import { defineConfig, CausalMemoryStore } from 'synapse-kit';

// 2. Pure Compiler Module
import { rustChecker, svelteChecker, executeChecks } from 'synapse-kit/compiler';

// 3. Pure Causal Memory Module
import { CausalMemoryStore, runCausalQuery } from 'synapse-kit/memory';

πŸ“„ License

MIT License Β© 2026 Vesper & Project Synapse Authors.