Synapse
Configuration Language for Memory Systems
Synapse is a domain-specific language and runtime for building memory systems for AI agents. You write .mnm files that declaratively define schemas, event handlers, queries, update policies, and channel connectors. Synapse compiles them into a multi-backend runtime backed by SQLite, Qdrant, Neo4j, and 40+ messaging platform connectors.
Why Synapse?
Building memory for AI agents means juggling relational stores, vector databases, knowledge graphs, LLM extraction pipelines, and data ingestion from dozens of sources. Synapse unifies all of this behind a single, readable configuration language.
config {
storage: sqlite("./data/agent.db")
vector: auto("qdrant")
graph: auto("neo4j")
embedding: openai("text-embedding-3-small")
extractor: openai("gpt-4o-mini")
}
memory Fact {
content: string
subject: string
predicate: string
object: string
confidence: float[0,1]
created_at: timestamp
@index subject
@index predicate
}
on ingest(content: string) {
content |> extract() |> store()
}
query Search(input: string): Fact[] {
from Fact
where semantic_match(input, threshold: 0.6)
and graph_match(input, hops: 2)
order by confidence desc
limit 10
}One file. Multi-backend storage. LLM-powered extraction. Semantic and graph search. Update policies. Channel ingestion from Slack, Discord, Telegram, and 37 more platforms.
Key Features
Define memory schemas, handlers, queries, and update rules in .mnm files. No boilerplate.
SQLite for relations, Qdrant/ChromaDB/Pinecone for vectors, Neo4j/Memgraph/ArangoDB/SurrealDB for graphs. Mix and match with named backends.
Multi-BackendBuilt-in extract() and summarize() powered by OpenAI. Extern functions let you define arbitrary LLM-simulated tools.
Ingest data from Slack, Discord, Telegram, Reddit, Email, Webhooks, and dozens more. Each channel triggers ingest and update pipelines.
40+ Channel ConnectorsConfidence decay, conflict resolution, periodic maintenance. Define how memory evolves over time.
Temporal UpdatesCombine semantic search, graph traversal, regex filters, and SQL in a single query. Score aliases let you build custom ranking formulas.
Hybrid QueriesQuick Start
# Build the CLI
cargo build --release -p synapse-cli
# Start a memory system
./target/release/synapse apply examples/hello.mnm
# Store a note
./target/release/synapse emit save '{"content": "Remember to buy milk"}'
# Query all notes
./target/release/synapse query GetAllReady to dive in? Start with the Getting Started guide.