Git OID Track: main|Simulate Commit (9.2ms)

Git-Aware Structural Context for AI Coding Agents.

Maps your repository into a local SQLite Tree-sitter graph, asynchronous semantic wiki, and long-term behavioral memory. Zero cloud lock-in. Sub-10ms FastMCP retrieval for Cursor, Claude Code, and Windsurf.

$pip install synap-git
9.2msMCP Search Latency
99.3%Token Reduction
3 LayersGraph + Wiki + Memory
100% LocalSQLite & Tree-sitter
synap://runtime-inspector
Discovered AST Symbol Entities
SynapRuntimeclass
src/synap_git/indexer/engine.py
Purpose / Description:

Core AST orchestrator & Tree-sitter coordinator

Symbol Graph References:
→ query_hybrid()→ GitStateWatcher
SQLite Graph Query Representation:
SELECT s.symbol_id, s.name, s.kind, e.target_symbol_id
FROM symbols s
JOIN edges e ON s.symbol_id = e.source_symbol_id
WHERE s.file_id = hash('src/synap_git/indexer/engine.py')
AND s.git_oid = 'a14f9bc';
Indexed via Tree-sitter in 0.4ms Grounded Context Ready
Retrieval Performance & Economics

780x Faster Context Retrieval. From 7.2s to 9.2ms.

Standard AI agent context tools make blocking, synchronous LLM classification calls before retrieving code. Synap v2.4.0 uses deterministic AST intent routing, LRU vector caching, and SQLite WAL engine to return grounded context instantaneously.

Agent Context Retrieval Latency (Profiled)
Traditional LLM Router + Raw Dumps7,214 ms
Blocks agent loop waiting for remote LLM inference
Remote Vector-Only Cloud RAG480 ms
Network roundtrips + unranked semantic text snippets
Synapse v2.4.0 Engine9.2 ms (780x Speedup)
Local Tree-sitter SQLite graph + LRU vector cache
Profiled on local SQLite WAL engine • Reproduce via pytest tests/benchmark_grounding.py 0 Cloud API Calls
Deterministic Intent Routing

Eliminates synchronous LLM classification in retrieval. Routes exact symbols, imports, and definitions directly through SQLite indices in under 1ms.

LRU Cached Vector Dot-Products

Pre-computes Euclidean norms and caches JSON deserialization with LRU buffers, eliminating repetitive vector serialization overhead during searches.

Filesystem mtime Invalidation

Fingerprints .git/HEAD and index files to achieve 0.001ms Git state checks, instantly invalidating only when changes occur.

High-Level Design & Topology

Designed for Instant Local Execution.

Synapse runs as a lightweight, zero-dependency local daemon. It couples Tree-sitter AST parsers with SQLite WAL concurrency, delivering microsecond graph queries to AI agents without bogging down your machine.

Typer CLI & Commandssynap_git.cli
Active in v2.4.0
Functional Role

Command line entrypoint managing daemons, full indexation, doctor health checks, and live status monitoring.

Implementation Mechanics

Built with Typer & Rich. Subcommands: init, index, sync, search, status --watch, doctor, wiki, mcp.

Input StreamUser CLI flags & target repository path
Output PayloadJSON / Terminal UI stdout & background daemon control
Source: src/synap_git/cli/main.pyZero Blocking I/O
3-Layer Context Architecture

Decoupled Grounding Framework.

Synapse decouples deterministic AST graph truth from asynchronous semantic digests and long-term agent memory. Each layer solves a specific failure mode in AI coding workflows.

L1 — Tree-sitter Structural Graph & Recursive CTEs

L1 indexes raw AST grammar nodes across all major programming languages into local SQLite relational tables. It maps functions, classes, methods, and caller-callee dependency edges with SHA256 content hashes.

Zero LLM hallucinations — 100% deterministic AST parsing
Sub-millisecond Recursive CTE graph traversal in SQLite
Git OID tagged: changes re-index only altered file deltas
Recursive Call-Graph Query
WITH RECURSIVE dependency_chain(symbol_id, target_id, depth) AS (
  SELECT source_symbol_id, target_symbol_id, 1
  FROM edges
  WHERE source_symbol_id = 'sym_SynapRuntime'
  UNION ALL
  SELECT e.source_symbol_id, e.target_symbol_id, dc.depth + 1
  FROM edges e
  JOIN dependency_chain dc ON e.source_symbol_id = dc.target_id
  WHERE dc.depth < 4
)
SELECT s.name, s.kind, s.file_id, dc.depth
FROM dependency_chain dc
JOIN symbols s ON dc.target_id = s.symbol_id;
Model Context Protocol

FastMCP Protocol Inspector.

Inspect the raw JSON-RPC standard I/O messages exchanged between coding agents and Synapse. All responses are token-budgeted and optimized for instant context injection.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "status": "success",
    "query_time_ms": 9.2,
    "tokens_provided": 420,
    "symbols_found": 2,
    "context": [
      {
        "symbol": "class TreeSitterRegistry",
        "file": "src/synap_git/parser/registry.py",
        "lines": "30-180"
      },
      {
        "symbol": "def parse_ast()",
        "file": "src/synap_git/parser/registry.py",
        "lines": "125-145"
      }
    ],
    "synthesize_answer": false
  }
}
1-Click Agent Integration

Connect to Any AI Coding Agent.

Synapse speaks standard FastMCP over stdio. Copy and paste the configuration block for your editor to give your agent instant 9.2ms codebase awareness.

Cursor Configuration.cursor/mcp.json

Add to your project's .cursor/mcp.json or global Cursor MCP Settings:

{
  "mcpServers": {
    "synapse": {
      "command": "synap",
      "args": ["mcp", "serve", "${workspaceFolder}"]
    }
  }
}
Protocol: FastMCP Stdio (Standard I/O)Zero Port Collisions
Interactive CLI Reference

Designed for Developers & Daemons.

Every feature in Synapse is accessible through a high-performance Typer CLI. Test the subcommands below to inspect actual terminal output.

zsh — synap init .
❯ synap init .
Synapse: Initializing Repository Context Engine
✔ Git root verified: /workspace/synapse (branch: main)
✔ Tree-sitter parsers initialized (25+ grammar definitions)
✔ Database schema created: .synap/synap.db (WAL Mode)
› Pass 1: Parsing AST symbol graphs across 1,120 files... (380ms)
› Pass 2: Resolving caller/callee dependency edges... (120ms)
✔ Indexed 8,421 symbols and 14,290 dependency edges.
✔ Structural context engine initialized successfully.
❯
Token Budgeting Economics

Stop Burning Dollars on Context Bloat.

Raw file dumps and unranked vector search saturate model context windows with noise. Calculate how much your engineering team saves with Synapse.

Repository Parameters

Repository Lines of Code:75k LOC
10k (Small)250k500k+ (Monorepo)
Daily AI Agent Invocations:50 prompts / day
5 (Solo)50200+ (Team)
Based on standard Claude 3.7 / GPT-4o input pricing ($3.00 / 1M tokens) across 22 engineering workdays.
Monthly Token Savings
$194
reduced from $198/mo to $4/mo
98% context reduction
Latency Speedup
780x
Instant 9.2ms response vs 7.2s blocking scans
~2 hrs engineer wait time eliminated
Per-Query Token Footprint:1,350 tokens (Synapse)
Synapse: 1,350 tokRaw File Dump: 60,000 tok
Developer Guide & Frequently Asked Questions

Engineered for Precision & Transparency.

Everything you need to know about setting up, integrating, and deploying Synapse across your developer toolchain.

Step 01

Install Package

Install Synapse globally via pip or uv tool with zero heavy build dependencies.

pip install synap-git
Step 02

Initialize Repo

Run init in your repository to build the local SQLite AST graph and semantic wiki.

synap init .
Step 03

Mount MCP Server

Connect Cursor or Claude Code to provide your AI agents with sub-10ms context.

synap start .
Synapse eliminates synchronous LLM router calls from the hot path. When an agent queries the codebase, Synapse runs deterministic intent classification, queries pre-indexed Tree-sitter AST nodes and caller/callee graphs via SQLite WAL recursive CTEs, and computes cosine similarities with LRU-cached vector dot-products.