Skip to content

krypticmouse/synapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synapse logo

Synapse

Configuration language for memory systems

License Rust

Documentation · Quick start · Examples · Issues


Synapse is a domain-specific language (.mnm files) and a Rust runtime for building memory systems for AI agents. You declare schemas, handlers, queries, update rules, and channels; the runtime talks to relational, vector, and graph backends (SQLite, Qdrant, Neo4j, and others), optional LLM extraction, and an HTTP API.


Documentation

Full documentation (language guide, tutorials, examples walkthroughs, CLI, HTTP API, backends, SDKs) lives in the docs/ Next.js site:

cd docs
npm install
npm run dev          # http://localhost:3000
npm run build        # static export → docs/out/

For production link previews and canonical URLs, set NEXT_PUBLIC_SITE_URL when building (see docs/lib/site.ts).

The in-repo source is Markdown/MDX under docs/content/. Everything that used to live only in this README (DSL reference, architecture notes, API tables) now lives there and stays easier to maintain.


Prerequisites

Build the CLI:

cargo build --release -p synapse-cli

Binary: target/release/synapse (or synapse.exe on Windows).


Quick start

./target/release/synapse apply examples/hello.mnm

# In another terminal
./target/release/synapse emit save '{"content": "Remember to buy milk"}'
./target/release/synapse query GetAll

Data is written under ./data/ by default. For a clean slate: ./target/release/synapse destroy --purge.

More tutorials: docs → Tutorials, or the examples/ directory.


Examples

File What it shows
examples/hello.mnm Minimal notes store + query
examples/agent_facts.mnm Facts, confidence, decay
examples/conversation.mnm Sessions and archival
examples/user_profile.mnm Preferences and interactions
examples/zep.mnm Temporal KG (Docker backends)
examples/letta.mnm Tiered memory (Docker)
examples/supermemory.mnm Multi-container memory layer
examples/multi_backend.mnm Named vector/graph backends
examples/channels.mnm Channel ingestion

Exact emit / query payloads for each file are documented in Examples and Tutorials in docs/. Several samples expect Docker when using auto(...) for Qdrant or Neo4j.


CLI (cheat sheet)

synapse apply <file.mnm> [--port N]   # Run runtime from a .mnm file
synapse emit <event> '<json>'        # Emit an event
synapse query <name> '<json>'        # Run a named query

synapse inspect [--backend …]        # DB / record overview
synapse clear                        # Clear records (backends)
synapse init | check | plan | status | reload | logs | destroy [--purge]

Full command reference: docs → Reference → CLI.


HTTP API

The runtime serves REST endpoints (default http://localhost:8080), including /health, /emit, /query, /inspect, /reload, and /clear. Request/response shapes are documented under Reference → HTTP API in docs/.


Repository layout

synapse/
├── crates/
│   ├── synapse-dsl/       # Parser, AST, types
│   ├── synapse-runtime/   # Interpreter, storage, HTTP, LLM, Docker helpers
│   ├── synapse-channels/  # Ingestion connectors
│   ├── synapse-cli/       # CLI binary
│   └── synapse-client/    # Rust HTTP client
├── crates/synapse-python/ # Python bindings (see crate README; workspace exclude)
├── docs/                  # Documentation site (Next.js + MDX)
├── examples/              # Example .mnm programs
├── extensions/synapse-vscode/
└── imgs/

Flow: .mnm → parse & type-check (synapse-dsl) → runtime (synapse-runtime) → SQLite / vector / graph backends. LLM calls use rig-core (OpenAI-compatible env vars). See Language → Overview and Reference → Storage backends in docs/ for diagrams and detail.


SDKs

Rustsynapse_client::Client in crates/synapse-client (see docs → Reference → SDKs).

Pythoncrates/synapse-python (PyO3 / maturin). From that directory:

PYO3_PYTHON=python3.13 maturin develop
from synapse import SynapseClient
client = SynapseClient("http://localhost:8080")
client.emit("save", {"content": "Hello from Python!"})
print(client.query("GetAll"))

Editor support

Synapse (.mnm) Syntax on Open VSX — works in VS Code and Cursor. Local packaging: extensions/synapse-vscode/README.md.


License

Apache 2.0 — see LICENSE.

About

Configuration Language for Memory Systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages