memory-lancedb-mcp
Allows using Google Gemini embedding models for semantic memory search and storage.
Supports reranking memory search results using Hugging Face's Text Embeddings Inference (TEI) models.
Enables local embedding generation using Ollama models for offline semantic memory operations.
Allows using OpenAI's embedding models (e.g., text-embedding-3-small) for semantic memory storage and retrieval.
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., "@memory-lancedb-mcpremember my preferred terminal theme"
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.
Persistent, intelligent long-term memory for any MCP-compatible AI agent.
English | 繁體中文
Before / After
Without memory, every session starts from zero. With memory-lancedb-mcp, your agent accumulates knowledge across sessions — automatically.
Before — agent has no context:
User: "Use the same animation style as last time"
Agent: "I don't have any context about previous animations. Could you describe what you'd like?"After — agent recalls past decisions:
<memories>
1. Remotion spring animation: use duration >= 20, damping 12-15 for smooth easing
2. Video export preset: 1080p, 30fps for social, 60fps for demo
</memories>
<refs>#1=6352a7d2 #2=bed148f0</refs>Store responses are minimal — no noise, just confirmation:
Stored. [topic: remotion]Related MCP server: AGI MCP Server
Quick Start
1. Install
npm install -g @cablate/memory-lancedb-mcp2. Configure
Add to your MCP client settings (e.g. Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@cablate/memory-lancedb-mcp"],
"env": {
"EMBEDDING_API_KEY": "your-api-key",
"EMBEDDING_MODEL": "text-embedding-3-small"
}
}
}
}{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@cablate/memory-lancedb-mcp"],
"env": {
"MEMORY_LANCEDB_CONFIG": "/path/to/config.json"
}
}
}
}See config.example.json for all options.
How It Works
store recall
│ │
┌────────▼────────┐ ┌────────▼────────┐
│ Filter junk │ │ Search by meaning │
│ Save + embed │ │ AND keywords │
│ Link related │ │ Re-rank results │
│ Flag conflicts │ │ Fade stale ones │
│ Tag topic │ │ Pull in related │
└────────┬────────┘ │ Merge duplicates │
│ └────────┬────────┘
▼ ▼
┌─────────────────────────────────────────────┐
│ LanceDB (local, zero-config) │
└─────────────────────────────────────────────┘Every memory_store saves to a local database, automatically links related memories, flags contradictions, and assigns topic labels — no extra API calls needed. Every memory_recall searches by both meaning and keywords, pulls in related memories the main search might miss, and includes maintenance hints so the agent can keep its own knowledge base clean.
Features
Retrieval
Finds the right memory even when you use different words — searches by meaning and exact keywords simultaneously, then combines the best of both
More precise results, not just surface matches — an optional second pass re-ranks results by actual relevance (6 providers supported)
Search multiple topics at once — pass a
queriesarray to search several keywords in one call; results are deduplicated and memories that match multiple queries rank higherFinding A automatically surfaces related B — when a memory is found, its linked neighbors are pulled in too, even if they use completely different words
Minimal token overhead — responses use compact XML tags (
<memories>,<hints>,<refs>) with short IDs, no category/scope noise
Storage
Related memories link themselves — when you store something new, it automatically creates bidirectional links to similar existing memories
Conflicts get flagged — if a new memory contradicts an existing one, you get a warning so nothing silently overwrites
Topics assigned automatically — each memory gets a topic label inferred from its content and neighbors; you can also set it explicitly
Junk gets filtered out — greetings, refusals, and meta-questions are rejected before they waste storage
Lifecycle
Frequently used memories stay sharp, stale ones fade — a decay model balances how recent, how often accessed, and how important each memory is
Memories earn their keep — three tiers (Peripheral → Working → Core); the more a memory gets used, the faster it promotes
Full version history — when you update a memory, the old version is preserved in a chain you can trace with
memory_history
Maintenance
The agent maintains itself — recall results include inline hints about duplicates, dormant memories, and contradictions
Health checks on demand —
memory_lintfinds orphaned memories, stale entries, and missing links, then fixes what it canMerge duplicates —
memory_mergecombines two redundant memories into one; originals are marked as supersededSee your memory space —
memory_visualizegenerates an interactive HTML graph you can open in any browser
Visualization
Run memory_visualize to generate an interactive knowledge graph of your memory space:
Automatic clustering — related memories group together visually
Similarity edges, duplicate detection, importance sizing
Time filter, growth animation, cluster view
Self-contained HTML — open in any browser
Query → embedQuery() ─┐
├─→ RRF Fusion → Rerank → Lifecycle Decay → Length Norm → Filter
Query → BM25 FTS ─────┘Stage | Effect |
RRF Fusion | Combines semantic and exact-match recall |
Cross-Encoder Rerank | Promotes semantically precise hits |
Lifecycle Decay | Weibull freshness + access frequency + importance |
Length Normalization | Prevents long entries from dominating (anchor: 500 chars) |
Hard Min Score | Removes irrelevant results (default: 0.35) |
MMR Diversity | Cosine similarity > 0.85 → demoted |
Configuration
Environment Variables
Variable | Required | Description |
| Yes | API key for embedding provider |
| No | Model name (default: |
| No | Custom base URL for non-OpenAI providers |
| No | LanceDB storage directory |
| No | Path to JSON config file |
{
"embedding": {
"apiKey": "${EMBEDDING_API_KEY}",
"model": "jina-embeddings-v5-text-small",
"baseURL": "https://api.jina.ai/v1",
"dimensions": 1024,
"taskQuery": "retrieval.query",
"taskPassage": "retrieval.passage",
"normalized": true
},
"dbPath": "./memory-data",
"retrieval": {
"mode": "hybrid",
"vectorWeight": 0.7,
"bm25Weight": 0.3,
"minScore": 0.3,
"rerank": "cross-encoder",
"rerankApiKey": "${JINA_API_KEY}",
"rerankModel": "jina-reranker-v3",
"rerankEndpoint": "https://api.jina.ai/v1/rerank",
"rerankProvider": "jina",
"candidatePoolSize": 20,
"hardMinScore": 0.35,
"filterNoise": true
},
"enableManagementTools": true,
"enableSelfImprovementTools": false,
"enableVisualizationTools": true,
"scopes": {
"default": "global",
"definitions": {
"global": { "description": "Shared knowledge" },
"agent:my-bot": { "description": "Private to my-bot" }
},
"agentAccess": {
"my-bot": ["global", "agent:my-bot"]
}
},
"decay": {
"recencyHalfLifeDays": 30,
"frequencyWeight": 0.3,
"intrinsicWeight": 0.3
}
}Works with any OpenAI-compatible embedding API:
Provider | Model | Base URL | Dimensions |
OpenAI |
|
| 1536 |
Jina |
|
| 1024 |
DeepInfra |
|
| 1024 |
Google Gemini |
|
| 3072 |
Ollama (local) |
|
| varies |
Provider |
| Endpoint | Example Model |
Jina |
|
|
|
Hugging Face TEI |
|
|
|
SiliconFlow |
|
|
|
Voyage AI |
|
|
|
Pinecone |
|
|
|
DashScope |
|
|
|
Core Tools
Tool | Description |
| Search memories — supports batch queries, relation expansion, topic filtering, and inline maintenance hints |
| Save a memory — auto-links related ones, flags contradictions, infers topic, filters junk |
| Delete by ID or search query |
| Update a memory; the old version is preserved in a version chain |
| Merge two memories into one |
| Trace version history through update/merge chains |
Management Tools (opt-in)
Tool | Description |
| Usage statistics by scope and category |
| List recent memories with filtering |
| Health checks + auto-fix missing relations |
Enable: "enableManagementTools": true
Self-Improvement Tools (opt-in)
Tool | Description |
| Log structured learning/error entries |
| Create skill scaffolds from learnings |
| Summarize governance backlog |
Enable: "enableSelfImprovementTools": true
Visualization Tools (on by default)
Tool | Description |
| Generate interactive HTML memory graph |
Params: output_path, scope, threshold (default: 0.65), max_neighbors (default: 4)
Disable: "enableVisualizationTools": false
LanceDB table memories:
Field | Type | Description |
| string (UUID) | Primary key |
| string | Memory text (FTS indexed) |
| float[] | Embedding vector |
| string |
|
| string | Scope identifier |
| float | Importance score 0-1 |
| int64 | Creation timestamp (ms) |
| string (JSON) | Extended metadata (tier, access_count, relations, topic, etc.) |
Development
git clone https://github.com/cablate/memory-lancedb-mcp.git
cd memory-lancedb-mcp
npm install
npm testRun locally:
EMBEDDING_API_KEY=your-key npx tsx server.tsCredits
Built on CortexReach/memory-lancedb-pro — original work by win4r and contributors.
License
MIT — see LICENSE for details.
This server cannot be installed
Maintenance
Latest Blog Posts
- 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/cablate/memory-lancedb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server