Lumena MCP Server
Provides a LumenaChatMemory adapter that allows LangChain agents to use Lumena as a persistent memory store for retrieval and context assembly.
Provides a LumenaCheckpointSaver that integrates with LangGraph to persist and restore graph state, enabling long-running agent workflows to save and resume.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Lumena MCP ServerSearch my memories for what UI preferences the user mentioned"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
What is Lumena?
Lumena is a local-first memory store for LLM agents — it organizes agent memories in a structured memory palace (rooms, loci, chunks) with hybrid retrieval, managed decay, and native integrations. It runs entirely on your hardware with no cloud dependencies.
No cloud. Embeddings run locally via ONNX Runtime. Storage is single-file SQLite.
Optional daemon. Background scheduler auto-starts with
lumena serve; can also run standalone withlumena daemon start.Hybrid retrieval. BM25 (SQLite FTS5), cosine-similarity vector search, and optional graph traversal with reciprocal rank fusion.
Managed memory lifecycle. Three-layer forgetting: time-based decay, similarity interference, and budget eviction.
Integrations. LangGraph checkpoint saver, LangChain memory adapter, MCP server, FastAPI REST API.
Related MCP server: engram
Quick Start
# Clone and install (lean runtime — no torch/CUDA)
git clone https://github.com/QuantumindSSI/lumena.git
cd lumena
pip install -e . # runtime: sqlite-vec, onnxruntime, transformers tokenizer…
# Initialize
lumena init --device generic
# Start the server
lumena serve
# Dashboard at http://localhost:8848/dashboard
# API docs at http://localhost:8848/docsFirst run needs an embedding model. By default
lumenawill try to export one, which requires the heavy[export]toolchain. The lean, recommended path is a prebuilt model bundle (no toolchain): setLUMENA_PREBUILT_MODEL_URLor use the one-command installer.
Install options (extras)
The base install is deliberately lean (no torch/CUDA). Add extras only when needed:
Install | Adds | When |
| Core runtime + inference | Always |
| MCP server for coding agents | Using OpenCode/Copilot/Claude/etc. |
| ONNX export toolchain (optimum → torch, ~2GB) | Only to build a model yourself |
| spaCy onboarding wizard |
|
| On-device LLM (llama-cpp) | Narrative consolidation |
| Framework adapters | Those frameworks |
| Everything above | Kitchen-sink local dev |
Store and retrieve
from lumena.config import LumenaConfig
from lumena.data.schema import get_connection
from lumena.force.mnemonic.store import store_memory
config = LumenaConfig()
conn = get_connection(config)
chunk_id = store_memory(
conn,
content="User prefers dark mode and large fonts",
room_name="preferences",
config=config,
)
conn.close()from lumena.config import LumenaConfig
from lumena.data.schema import get_connection
from lumena.conversation import ConversationMemory
config = LumenaConfig()
conn = get_connection(config)
memory = ConversationMemory(config=config, conn=conn)
turn = memory.retrieve_and_assemble("What UI settings does the user like?")
print(turn.assembled_context)$ lumena status
Lumena Status
Device: generic
Rooms: 5
Active chunks: 58
Context budget: 2048 tokens
TFC → e=0.50 a=0.50 tau=7.0 r=3API endpoints
GET /health Liveness probe (unversioned)
GET /dashboard Effectiveness dashboard (HTML)
GET /metrics Machine-readable metrics
GET /v1/status Palace overview
POST /v1/search Semantic + lexical hybrid search
POST /v1/store Store a memory chunk
POST /v1/feedback Log explicit or implicit feedback
POST /v1/assemble Retrieve + assemble context in one call
POST /v1/turn Store full conversation turn
GET /v1/dashboard-data Dashboard data as JSONArchitecture
User Input → Intent Router → Parallel Retrieval (BM25 + Dense + Graph)
│
▼
RRF Fusion × V(m) × Recency
│
▼
Context Assembly (Jinja2)
│
▼
Consolidation → Decay / Interference / EvictionState of the Project
Lumena is production-ready software. It works end-to-end with API versioning, comprehensive tests, and documented security limitations. It is suitable for production, evaluation, development, and trusted-LAN deployments.
Dimension | Status | Detail |
Tests | 320 passing, 7 skipped | 75% coverage. 43 test files. |
Storage | Working | SQLite with WAL, FTS5, bi-temporal tracking, provenance chains. |
Retrieval | Working | BM25 + dense + graph with RRF fusion. |
Forgetting | Working | L1 decay (Ebbinghaus), L2 interference, L3 budget eviction. |
PII detection | Working | Regex-based scanning at storage time. Configurable block/redact/hash. |
Audit logging | Working | SQLite audit_log table with request tracing. |
API server | Working | FastAPI with |
MCP server | Working | 7 tools (search, store, assemble, turn, feedback, status, dashboard). |
LangChain | Working | LumenaChatMemory adapter (requires |
LangGraph | Working | LumenaCheckpointSaver (requires |
Encryption-at-rest | Implemented, opt-in | SQLCipher (full-DB) or Fernet (field-level) via |
BEIR benchmarks | Partially evaluated | 500-doc/20-query subset results available. Full-corpus evaluation deferred to HPC. |
P2P sharing | Working | Beam protocol with AES-256-GCM encryption, HMAC-SHA256 signing, replay protection. Requires p2p key. |
Benchmark Suites
All run with a single command from the repo root:
Suite | Command | Status |
Retrieval (R@k, nDCG, MRR) |
| Run (synthetic corpus) |
E2E memory quality |
| Run (28 queries) |
Navigation efficiency |
| Run |
Ablation (component isolation) |
| Run |
Forgetting (90-day survival) |
| Run (results available) |
Performance (latency/footprint) |
| Run (results available; x86_64) |
BEIR subset evaluation |
| Run (500-doc/20-query subset results available) |
Optical degradation |
| Run (results available) |
TFC sensitivity |
| Run (results available) |
Stress (bulk ingest) |
| Run (20k-chunk results available; x86_64) |
Cross-system (vs Chroma/FAISS) |
| Harness ready; no results yet |
All suites |
| Wraps all 11 suites |
Note on results: Retrieval benchmarks use a synthetic keyword-overlap corpus (1,000 passages, 50 queries) plus BEIR subset evaluation (500-passage, 20-query subsets across 5 standard datasets). The synthetic corpus is deliberately easy (BM25 near-saturates nDCG), so treat those numbers as harness sanity checks, not retrieval-quality claims — the BEIR subsets are the meaningful signal. The committed retrieval artifact was regenerated with real embedders (all-MiniLM-L6-v2 and BAAI/bge-small-en-v1.5); benchmarks refuse to run with mock embeddings.
Integrations
Integration | What it does | How to use |
MCP Server | Exposes Lumena tools to OpenCode, Claude Desktop |
|
LangChain |
|
|
LangGraph |
|
|
FastAPI | REST API with auth/rate-limiting |
|
OpenCode | Native skill for memory workflows | See |
Project Structure
lumena/
├── config.py Configuration (pydantic-settings)
├── search.py Search pipeline orchestration
├── fusion.py RRF fusion + reranking
├── controller.py Twin-Force state controller
├── conversation.py Context assembly + turn tracking
├── repair.py Self-healing retrieval
├── intent.py Intent router (keyword + optional LR)
├── api/ FastAPI server + dashboard
├── cli/ Typer CLI
├── data/ Schema, migrations, backup
├── force/
│ ├── mnemonic/ Store, retrieval, decay, interference, eviction, provenance
│ └── contextual/ Embedding, token budget, assembly
├── integrations/ LangChain, LangGraph, MCP server
├── p2p/ Beam P2P sharing protocol
├── sovereign/ FRQAD, optical quantization, local LLM
├── brand/ Error hierarchy
└── compliance/ Safety forgetting, PII audit
tests/ 43 test files, 327 tests
benchmarks/ 11 benchmark suitesContributing
We welcome contributions. The best way to start:
Read
CONTRIBUTING.md— setup, branch naming, code standards.Pick a
good first issuefrom the issues tracker.Run the tests:
pytest tests/(must pass with ≥50% coverage).Submit a PR against
main.
High-impact areas to contribute
Run the full BEIR harness — generate leaderboard-scale retrieval benchmark results.
Run the perf suite on real hardware — RAM/latency footprint claims need measured artifacts (RPi5, Jetson, x86_64).
Write tests — several modules lack dedicated test files. Pick one and add coverage.
Development setup
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ # Run full suite
pytest tests/ --cov=lumena # With coverage
ruff check lumena/ tests/ # LintDocumentation
Document | Purpose |
Production deployment guide | |
How to contribute | |
Security policy and known limitations | |
Integration guides for each platform | |
Development milestones and open work | |
Introductory white paper |
Community
Matrix:
#lumena:matrix.org
License
Lumena is dual-licensed:
Community Edition — AGPL-3.0-or-later. Free and open source. If you run a modified Lumena as a network service, AGPL requires you to make your source available to its users.
Pro / Commercial Edition — a commercial license from QuantumindSSI that removes the AGPL obligations and unlocks Pro features. See
COMMERCIAL-LICENSE.md.
Versions up to and including v1.0.0 were released under Apache 2.0
(LICENSES/Apache-2.0.txt); that grant on those
releases is irrevocable. Commercial inquiries: licensing@quantumindssi.com.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAn MCP-native, local-first memory server that gives AI agents persistent, structured memory across sessions and tools, enabling them to maintain identity and context without reconfiguration.3MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent, local-first AI memory across sessions via MCP tools for storing, searching, and retrieving context from past interactions.1MIT
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents via MCP, enabling agents to store and semantically recall facts, events, and lessons across sessions, all running locally without cloud dependencies.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceLocal-first AI memory layer with hybrid retrieval and brain-inspired namespaces. Enables agents to save, search, and manage memories directly via MCP tools.5MIT
Related MCP Connectors
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Shared long-term memory vault for AI agents with 20 MCP tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/QuantmindSSI/lummenna'
If you have feedback or need assistance with the MCP directory API, please join our Discord server