Lumena MCP Server
什么是 Lumena?
Lumena 是一个面向 LLM 智能体的本地优先记忆存储库——它通过混合检索、受管遗忘和原生集成,将智能体记忆组织在结构化的记忆宫殿(房间、轨迹点、数据块)中。它完全运行在您的硬件上,不依赖任何云服务。
无需云端。 嵌入模型通过 ONNX Runtime 在本地运行。存储采用单文件 SQLite。
可选守护进程。 后台调度器随
lumena serve自动启动;也可以使用lumena daemon start独立运行。混合检索。 BM25(SQLite FTS5)、余弦相似度向量搜索,以及可选的图遍历,并支持倒数排名融合。
受管的记忆生命周期。 三层遗忘机制:基于时间的衰减、相似性干扰和预算驱逐。
集成。 LangGraph 检查点保存器、LangChain 记忆适配器、MCP 服务器、FastAPI REST API。
Related MCP server: engram
快速开始
# 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/docs首次运行需要嵌入模型。 默认情况下,
lumena会尝试导出一个嵌入模型, 这需要重量级的[export]工具链。轻量且推荐的路径是使用预构建模型包(无需工具链): 设置LUMENA_PREBUILT_MODEL_URL或使用一键安装脚本。
安装选项(附加依赖)
基础安装刻意保持轻量(不包含 torch/CUDA)。仅在需要时添加附加依赖:
安装 | 添加内容 | 使用场景 |
| 核心运行时 + 推理 | 始终需要 |
| 面向编码智能体的 MCP 服务器 | 使用 OpenCode/Copilot/Claude 等时 |
| ONNX 导出工具链(optimum → torch,约 2GB) | 仅当需要自行构建模型时 |
| spaCy 入门引导向导 |
|
| 设备端 LLM(llama-cpp) | 叙事整合 |
| 框架适配器 | 使用这些框架时 |
| 以上所有内容 | 本地开发全家桶 |
存储与检索
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 端点
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 JSON架构
User Input → Intent Router → Parallel Retrieval (BM25 + Dense + Graph)
│
▼
RRF Fusion × V(m) × Recency
│
▼
Context Assembly (Jinja2)
│
▼
Consolidation → Decay / Interference / Eviction项目状态
Lumena 是生产就绪的软件。它端到端地支持 API 版本管理、全面的测试和文档化的安全限制。它适用于生产、评估、开发和可信局域网部署。
维度 | 状态 | 详情 |
测试 | 320 通过,7 跳过 | 75% 覆盖率。43 个测试文件。 |
存储 | 可用 | 支持 WAL、FTS5、双时态跟踪、溯源链的 SQLite。 |
检索 | 可用 | BM25 + 稠密 + 图,带 RRF 融合。 |
遗忘 | 可用 | L1 衰减(艾宾浩斯)、L2 干扰、L3 预算驱逐。 |
PII 检测 | 可用 | 存储时基于正则表达式的扫描。可配置为阻止/脱敏/哈希。 |
审计日志 | 可用 | 带请求追踪的 SQLite audit_log 表。 |
API 服务器 | 可用 | 基于 FastAPI,带 |
MCP 服务器 | 可用 | 7 个工具(search、store、assemble、turn、feedback、status、dashboard)。 |
LangChain | 可用 | LumenaChatMemory 适配器(需要 |
LangGraph | 可用 | LumenaCheckpointSaver(需要 |
静态加密 | 已实现,可选 | 通过 |
BEIR 基准测试 | 部分评估 | 500 文档/20 查询子集结果可用。全语料评估推迟到 HPC 上进行。 |
P2P 共享 | 可用 | 采用 AES-256-GCM 加密、HMAC-SHA256 签名、重放保护的 Beam 协议。需要 p2p 密钥。 |
基准测试套件
所有套件均可从仓库根目录通过单条命令运行:
套件 | 命令 | 状态 |
检索(R@k、nDCG、MRR) |
| 可运行(合成语料库) |
端到端记忆质量 |
| 可运行(28 个查询) |
导航效率 |
| 可运行 |
消融(组件隔离) |
| 可运行 |
遗忘(90 天存活率) |
| 可运行(结果可用) |
性能(延迟/内存占用) |
| 可运行(结果可用;x86_64) |
BEIR 子集评估 |
| 可运行(500 文档/20 查询子集结果可用) |
光学退化 |
| 可运行(结果可用) |
TFC 敏感性 |
| 可运行(结果可用) |
压力测试(批量导入) |
| 可运行(20k 块结果可用;x86_64) |
跨系统(对比 Chroma/FAISS) |
| 测试框架就绪;暂无结果 |
全部套件 |
| 封装全部 11 个套件 |
关于结果的说明: 检索基准测试使用合成关键词重叠语料库(1,000 个段落、50 个查询)以及 BEIR 子集评估(5 个标准数据集上的 500 段落、20 查询子集)。合成语料库刻意设置得较为简单(BM25 在 nDCG 上接近饱和),因此请将这些数字视为测试框架的健全性检查,而非检索质量的声明——BEIR 子集才是更有意义的信号。已提交的检索产物是使用真实嵌入器(all-MiniLM-L6-v2 和 BAAI/bge-small-en-v1.5)重新生成的;基准测试拒绝使用模拟嵌入运行。
集成
集成 | 功能描述 | 使用方法 |
MCP 服务器 | 向 OpenCode、Claude Desktop 暴露 Lumena 工具 |
|
LangChain |
|
|
LangGraph | 用于图状态的 |
|
FastAPI | 带认证/限流的 REST API |
|
OpenCode | 用于记忆工作流的原生技能 | 参见 |
项目结构
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 suites贡献
我们欢迎贡献。最佳入门方式:
阅读
CONTRIBUTING.md— 环境搭建、分支命名、代码规范。从问题跟踪器中挑选一个
good first issue(新手友好问题)。运行测试:
pytest tests/(必须通过且覆盖率 ≥50%)。向
main分支提交拉取请求。
高影响力贡献方向
运行完整的 BEIR 测试框架 — 生成排行榜级别的检索基准测试结果。
在真实硬件上运行性能套件 — 内存/延迟占用的声明需要实测数据(RPi5、Jetson、x86_64)。
编写测试 — 多个模块缺少专门的测试文件。选择一个并补充覆盖率。
开发环境搭建
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/ # Lint文档
文档 | 用途 |
生产部署指南 | |
如何贡献 | |
安全策略和已知限制 | |
各平台集成指南 | |
开发里程碑和待办工作 | |
入门白皮书 |
社区
许可证
Lumena 采用双重许可:
社区版 — AGPL-3.0-or-later。免费且开源。 如果您将修改后的 Lumena 作为网络服务运行,AGPL 要求您将 源代码提供给用户。
专业版 / 商业版 — 来自 QuantumindSSI 的商业许可证, 可免除 AGPL 义务并解锁专业功能。请参阅
COMMERCIAL-LICENSE.md。
包括 v1.0.0 及更早版本均依据 Apache 2.0
(LICENSES/Apache-2.0.txt)发布;该授权
不可撤销。商业咨询: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