Hey everyone,
We’re a tiny dev team, and we wanted to share something we’ve been building and dogfooding internally for months: Synapse MCP. It’s an open-spec Model Context Protocol (MCP) server that sits between your local codebase and AI agents (Claude Code, Cursor, Windsurf, or custom agent scripts).
After using it every day on our own code, the efficiency gains have been huge. But saving context tokens was never our main goal—that’s just a byproduct. The real reason we built Synapse comes down to a simple philosophy: LLMs shouldn’t guess your code structure; they should make decisions based on compiler-grade facts.
The Core Problem: LLM Guesswork
Most AI agent workflows force the LLM into a game of probabilistic guessing. When you ask an agent to refactor a feature, it runs a few regex commands (grep/ripgrep) or pulls in fuzzy cloud vector embeddings, grabs matching text strings, and then guesses how the rest of the system connects.
In Elixir (and software engineering in general), guessing fails:
- Unqualified Imports & Aliases: If
Module Aexplicitly callsAccounts.User.get_by_id(1), text search finds it. But ifModule Busesimport Accounts.Userand callsget_by_id(1), regex search misses it completely. The LLM assumesModule Ais the only callsite, refactors it, and silently breaksModule B. - Polymorphic Dispatches & Behaviours: Text search can’t trace an Elixir
@behaviouror dynamic module dispatch back to its underlying implementations. The agent just guesses where the contract is implemented. - Test Fixture Noise: Grepping for a core function often dumps 200 lines of mock factories into the context window for every 1 line of production code. The model guesses based on test setup rather than production callers.
Ground Truth Over Probabilistic Search
Instead of treating your codebase like unstructured text, Synapse parses your code into a local AST graph using Sourceror (SynapseCore.Chunker.ElixirChunker and ElixirCompressor). It gives the LLM deterministic cross-references (xref) and concrete execution guarantees:
- Exact Caller/Callee Trees: The LLM gets true callsites, alias resolutions, and module dependencies in sub-milliseconds—zero guessing required.
- In-Memory Shadow Graph (
dry_run: true): When using thesynapse_modify_filestool withdry_run: true, Synapse routes toSynapseCore.ShadowGraph.simulate/2. It executes proposed edits against an in-memory AST diff, checking function arities across all indexed callers and running local linters (Credo). If an edit breaks a downstream caller’s signature, Synapse automatically rolls back before anything touches your filesystem. - Stack Trace Resolution (
synapse_debug_trace): Agents can feed raw Erlang/Elixir stack frames directly into thesynapse_debug_tracetool, which maps them straight back to exact AST chunk IDs in one turn. - Persistent Node Knowledge Caching: When an agent analyses a complex module, Synapse attaches that structural insight directly to the AST node in a local database. Future agent sessions read that node context instantly without re-discovering the module from scratch.
Why 100% Elixir? (No Python, No PyTorch)
The current AI ecosystem is bogged down with massive Python runtimes, C++ vector database binaries, and heavy math dependencies. We wanted to prove you can build zero-dependency, ultra-fast AI tooling purely on the BEAM.
Here is how we structured the OTP architecture under the hood:
- 12 Microsecond Lookups via ETS: The entire graph lives in memory across 12 named ETS tables (
:synapse_chunks,:synapse_edges,:synapse_symbols, etc.). Reads bypass GenServer message queues and hit public tables directly withread_concurrency: true, resolving graph queries in microsecond bursts. - Per-Repo Indexer + Singleton Stores: We split process responsibilities cleanly. A per-repo
SynapseCore.IndexerGenServer manages Git deltas, file events, and concurrent indexing phases. However, final state mutations are strictly serialised through global singleton GenServers (SynapseCore.Store.ETSandSynapseCore.Store.SQLiteWriter). This guarantees lock-free state consistency without race conditions during concurrent agent edits. - Native OS File Watching & Mailbox Draining:
SynapseCore.Indexerspawns an asynchronous watcher using Erlang’sfile_systemwrapper, hooking natively into OS file events (likemacfsevents). We handle event debouncing via zero-latency mailbox drains inhandle_info({:file_event, _watcher, {path, _events}}, state), updating the local ETS index in ~2ms.
BEAM War Story:
We initially tried storing our BM25F inverse document frequency (IDF) maps in :persistent_term to squeeze out maximum read speed. It worked great until we indexed a massive monorepo—the IDF map hit 100MB and hard-crashed the VM with literal_alloc: Cannot allocate N bytes of memory. :persistent_term uses the BEAM’s literal allocator, which isn’t built for dynamic high-volume maps. We migrated back to standard ETS tables with read_concurrency: true and got the exact same read performance with zero crash risk.
Hints at What We’re Building Next
Having dogfooded this for months, we are fully doubling down on the “100% Elixir AI” stack. No Python wrappers, no heavy math dependencies—just pure BEAM concurrency, OTP supervision, and raw performance. We’re currently building some much bigger Elixir-native AI infrastructure pieces that sit directly on top of this engine.
Free Pro Access for Elixir Devs
We normally charge $19/mo for Synapse Pro (which unlocks the Shadow Graph safe writes, stack trace resolution, and persistent node memory). But because this community built the runtime that made Synapse possible, we’re giving Synapse Pro completely free for a year to all Elixir developers.
We’re a small team building out in the open, and we would love your raw feedback, architectural critiques, or feature requests!
Engineering Deep Dives from our Blog:
- Stop Letting AI Hallucinate Refactors — How Synapse Eliminates Repetitive Discovery (Our deep dive on why LLMs must stop guessing)
- How Local Code Knowledge Graphs Work — Inside the Microsecond BEAM Engine
- 2ms vs. 12 Seconds: Benchmark Proves Why AI Agents Need AST Graphs, Not Grep Chains
- Why Synapse MCP Beats Native IDE Indexers (Cursor, Windsurf, Warp)
- Three-Arm Benchmark: Synapse vs. Codebase-Memory vs. Shell
Links: synapse-mcp.dev
Give it a spin with your favourite LLM; you don’t need the latest and greatest. Synapse has your lower-level LLMs coding just as well as the latest models. Let us know what you think.



















