Memory layer for AI agents in one 258 KB binary
Memora is a clean-room Mem0-compatible memory engine written 100% in Mora (.mr). Run it as a native REST server, an MCP stdio/HTTP server, a CLI, or a Mora library without Python or Docker.
Measured Head-to-Head Benchmarks
Workload: 500 memory inserts with 500 history audit rows, top-10 cosine search (8D vector), 50 updates, and scope deletion on Linux x86_64.
| Metric | Memora Native | Memora Interpreter | Mem0 Python (SQLiteManager) |
|---|---|---|---|
| CLI Cold-Start | 2.90 ms | - | 52.15 ms (stdlib only) |
| 500 Inserts + History | 85 ms | 68 ms | 296 ms |
| Top-10 Cosine Search | 2 ms | 46 ms | 4 ms |
| 50 Updates | 1 ms | 2 ms | 10 ms |
| Scope Delete | 1 ms | 1 ms | 1 ms |
| Total Workload | 89 ms | 117 ms | 311 ms |
How Memory Reconciliation Works
Memora ports Mem0's fact-extraction and deduplication pipeline so agent memory stays concise instead of appending duplicate transcripts.
-
01
Scope & Extract
Validates user_id, agent_id, or run_id. When infer=true, calls your OpenAI-compatible LLM to extract structured facts in the input language.
-
02
Embed & Retrieve
Embeds each fact via HTTP and queries SQLite WAL for the top-K closest existing memories in the same scope using pure-Mora cosine similarity.
-
03
Reconcile Decisions
Maps UUIDs to short integer IDs and asks the LLM to output ADD, UPDATE, DELETE, or NONE actions, preventing duplicate or stale facts.
-
04
Persist & Audit
Applies mutations atomically to SQLite and appends every state transition to the Mem0-compatible history table for full auditability.
Four Ways to Run Memora
Use one compiled binary as a REST server, MCP server, or CLI, or import the engine directly into your Mora (.mr) project.
mora build --native -o memora
./memora serve --addr 127.0.0.1:8000
curl -s -X POST http://127.0.0.1:8000/memories \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"I like nasi goreng"}],"user_id":"alice"}'
# stdio (Claude Desktop, Cursor, Windsurf)
./memora mcp
# Streamable HTTP
./memora mcp --http 127.0.0.1:8001
# Tools: add_memory, search_memories, get_all_memories,
# update_memory, delete_memory, memory_history
./memora add "I build compilers in Mora" --user alice
./memora search "what does alice build?" --user alice --limit 5
./memora list --user alice
./memora lang id
./memora help --lang id
import "./src/memory.mr"
import "./src/llm/openai_compat.mr"
import "./src/embedder/openai_compat.mr"
fn main() {
let cfg = MemoraConfig::from_env()
let mem = create_memora[OpenAiCompatLlm, OpenAiCompatEmbedder](
cfg,
OpenAiCompatLlm { config: cfg.llm },
OpenAiCompatEmbedder { config: cfg.embedder }
)
let scope = MemoryScope { user_id: Some("alice"), agent_id: None, run_id: None }
print(len(mem.get_all(scope, 10)))
}
Roadmap
- v0.1 Shipped: Core engine, SQLite WAL store, OpenAI-compat HTTP, REST API, MCP server, CLI, and EN/ID i18n.
- v0.2 Planned: GraphStore entity/relation extraction, Reranker trait, and advanced metadata operators ($in, $gt, $lt, $ne).
- v0.3 Planned: HTTP adapters for Qdrant, pgvector, and Neo4j, plus optional lightweight dashboard.
- v1.0 Release gate: Cross-platform native binaries (Linux, macOS, Windows PE64) and Mora Registry package.
Open-Source License & Attribution
Memora is licensed under Apache License 2.0 by MuaraAI.
Memora is a clean-room port in Mora (.mr) inspired by and compatible with Mem0 (github.com/mem0ai/mem0, Copyright 2023 Taranjeet Singh, Apache-2.0).
Support open-source development by MuaraAI: