lucidmem
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., "@lucidmemfind_memory on how we resolved the API rate limit issue"
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.
lucidmem
A memory engine for AI agents, with per-project isolation that actually holds, a dashboard to manage what's in it, and an MCP connector so agents can use it directly.
Agents forget everything between sessions. The usual fix is a vector store, and the usual problem is that a vector store has no idea who is asking — so the moment more than one person or project uses it, everyone sees everything. lucidmem makes the project (a space) the unit of access, and enforces it in Postgres rather than in application code.
Space ──┬── Document ──── Memory (chunk)
└── Fact (versioned; a contradiction supersedes its parent)Two layers. A curated layer of hand-written Markdown in git (OKF v0.2), and a corpus layer of ingested material. Curated outranks corpus, and the UI and API label which is which — because "someone wrote this down on purpose" and "this appeared in a log once" deserve different trust.
Explainable ranking. Every result decomposes its own score into vector, lexical, recency, curated and rerank contributions.
explain_rankingcompares any two results.Degrades honestly. GPU services are optional. When they are gone, search still works and says
rerank: unavailablerather than silently changing.Multi-tenant by construction. Row-level security is the boundary; application filtering is only the fast path.
Install
git clone https://github.com/libr3andr3/lucidmem && cd lucidmem
cp deploy/env.example deploy/.env # set POSTGRES_PASSWORD and KB_APP_PASSWORD
docker compose -f deploy/compose.yml --env-file deploy/.env up -dThen create a project and a token:
kb init myproject # scaffolds a bundle, kb.yaml, .mcp.json, an agent skill
kb apply # reconcile grants (prints a diff first)
kb token issue user:youOpen http://127.0.0.1:8090 and paste the token.
For just the CLI and MCP server:
pip install -e .Related MCP server: Kirok
Connect an agent
docs/CONNECT.md is the full guide. The short version:
{
"mcpServers": {
"lucidmem": {
"command": "python",
"args": ["-m", "lucidmem.mcp_server"],
"env": { "LUCIDMEM_API_URL": "https://kb.example.com" }
}
}
}Tools: find_memory, drill_down, save_memory, ingest_file, promote,
explain_ranking, fact_history, memory_stats, whoami.
Access control
Concept | Meaning |
space | A project. The unit of isolation. |
principal | A user, agent or service. Holds tokens. |
grant | principal-or-group × space × role |
role |
|
Grants live in a kb.yaml per project, so "who can read this?" is a reviewable
diff instead of tribal knowledge:
space: sales
title: Sales
sources:
- {path: ./contracts, parser: pdf, tags: [legal]}
groups:
bizdev: ["user:ana", "user:ben"]
grants:
- {principal: "user:ana", role: admin}
- {group: bizdev, role: contributor}kb apply reconciles it and asks before revoking anything.
The boundary is Postgres RLS. kb-api connects as a role that cannot bypass
it and sets the principal per transaction. Clients get a bearer token, never a
DSN. tests/test_isolation.py includes a test that bypasses the application
entirely and queries the table directly.
Ingest
Parser | Handles |
| Claude Code session |
| Text layer, else OCR, else a VLM description for pages that are one figure |
| Description plus transcription |
| An OKF bundle — the curated layer |
| Markdown, code, config |
Credentials are stripped before anything is embedded or sent to a model, so a secret pasted into a terminal two months ago never becomes a searchable memory. Ingestion is a queue: GPU-backed work waits when the GPU is away instead of failing.
Optional GPU services
All optional, all degrade cleanly. deploy/serve.sbatch is an example SLURM job.
Service | Used for | Without it |
VLM (any OpenAI-compatible endpoint) | contextual-retrieval prefixes, fact extraction, figure description | prefixes skipped; chunks embed bare |
OCR | scanned documents | those files stay queued |
Embeddings (GPU) | bulk ingest | falls back to CPU (~15s/chunk vs ~0.1s) |
Reranker | final ordering | plain RRF, reported in |
The GPU and CPU embedders run the same code so their vectors share a space;
tests/test_embed_drift.py asserts mean cosine > 0.99.
Tests
pytest # units, no database
docker run -d --name kb-pgtest -e POSTGRES_PASSWORD=testpw \
-e POSTGRES_USER=lucidmem -e POSTGRES_DB=lucidmem \
-p 127.0.0.1:5433:5432 pgvector/pgvector:pg17
LUCIDMEM_TEST_DB=1 pytest # + the isolation suiteThe isolation suite runs against a deterministic hash embedder, so it needs no GPU. A security test that only runs when a GPU is free is a test that never runs.
Docs
docs/CONNECT.md — connecting an agent
docs/ARCHITECTURE.md — how it fits together, and why
License
MIT
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
- Alicense-qualityDmaintenanceProvides persistent memory storage for AI agents with full-text search, tagging, and importance levels, enabling agents to store and retrieve memories efficiently.Last updatedMIT
- AlicenseAqualityAmaintenanceProvides persistent, searchable memory for AI agents, enabling them to retain, recall, and reflect on information across conversations.Last updated191MIT
- Alicense-qualityCmaintenanceSelf-hosted memory service that gives AI agents persistent, searchable memory across sessions, machines, and projects.Last updatedMIT
- Alicense-qualityCmaintenanceProvides long-term memory for AI agents with per-user scoped recall, ranking by relevance, recency, and importance, consolidation of repeated events, and automatic forgetting.Last updatedMIT
Related MCP Connectors
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory for AI agents — verbatim conversations, searchable by meaning.
Persistent memory for AI agents. Search, store, and recall across sessions.
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/libr3andr3/lucidmem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server