A production-ready Model Context Protocol (MCP) server for semantic memory management that enables AI agents to store, retrieve, and manage contextual knowledge across sessions.
📖 System Prompt Available: See for a comprehensive guide on how to instruct AI models to use this memory system effectively. This prompt helps models understand when and how to use memory tools, especially for proactive memory retrieval.
A production-ready Model Context Protocol (MCP) server for semantic memory management
Option 3: Run Migration for Flexible Dimensions
If you're using the source version:
bun run migrate
This allows mixing different embedding dimensions in the same database.
Database Connection Issues
Ensure your PostgreSQL has the pgvector extension:
CREATE EXTENSION IF NOT EXISTS vector;
Claude Desktop Integration
💡 For Best Results: Include the SYSTEM_PROMPT.md content in your Claude Desktop system prompt or initial conversation to help Claude understand how to use the memory tools effectively.
Quick Setup (NPM)
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
In-Memory Cache (fallback) - Local NodeCache for when Redis is unavailable
Async Job Processing
When Redis is available and ENABLE_ASYNC_PROCESSING=true, the server uses BullMQ for background job processing:
Features
Async Embedding Generation: Offloads CPU-intensive embedding generation to background workers
Batch Import: Processes large memory imports without blocking the main server
Memory Consolidation: Runs clustering and merging operations in the background
Automatic Retries: Failed jobs are retried with exponential backoff
Dead Letter Queue: Permanently failed jobs are tracked for manual intervention
Running Workers
# Start all workers
bun run workers
# Or start individual workers
bun run worker:embedding # Embedding generation worker
bun run worker:batch # Batch import and consolidation worker
# Test async processing
bun run test:async
Queue Monitoring
The memory_stats tool includes queue statistics when async processing is enabled:
Search results are cached with query+filter combinations
Embeddings are cached for 24 hours (configurable)
Development
Type Checking
bun run typecheck
Linting
bun run lint
Using with AI Models
System Prompt for Better Memory Usage
The memory tools include enhanced descriptions with keywords to help models understand when to use each tool. However, for best results with models like Gemma3, Qwen, or other open-source models:
Include the System Prompt: Copy the content from SYSTEM_PROMPT.md and include it in your initial conversation or system prompt
Key Behaviors to Reinforce:
Always use memory_search FIRST before any operation
Use memory_list as a fallback when search returns no results
Search for user information at conversation start (e.g., "user name preferences")
Store structured JSON in the content field
Example Initial Prompt for Models
You have access to a memory system. ALWAYS start by using memory_search with query="user name preferences personal information" to check for stored user details. If no results, use memory_list to see recent memories. Default limits are 10 results for token efficiency - only increase if needed. Follow the patterns in the system prompt for best results.
Implementation Status
✅ Fully Integrated Features
DBSCAN Clustering: Advanced clustering algorithm for memory consolidation
Smart Compression: Automatic compression for large memories (>100KB)
Context Window Management: Token counting and intelligent truncation
Input Sanitization: Comprehensive validation and sanitization
All Workers Active: Embedding, batch, and clustering workers all operational
Testing
The project includes a comprehensive test suite covering:
Memory service operations (store, search, update, delete)
Input validation and sanitization
Clustering and consolidation
Compression for large content
Run tests with bun test.
License
MIT
M
MCP Ai Memory
scanadi·50 estrelas·
A production-ready Model Context Protocol (MCP) server for semantic memory management
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Perguntas
Como instalo MCP Ai Memory?
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
MCP Ai Memory precisa de uma chave de API?
Este registro não lista nenhuma variável de ambiente obrigatória.
Qual transporte MCP Ai Memory usa?
MCP Ai Memory roda localmente via stdio.
Quando MCP Ai Memory foi verificado pela última vez?
Última verificação: 2026-10-28. A production-ready Model Context Protocol (MCP) server for semantic memory management