
scanadi/mcp-ai-memory
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Semantic 기억 관리를 위한 생산 ready 모형 Context 의정서 (MCP) 서버
개요
AI 에이전트를 저장, 검색, 관리하고 세션을 통해 상황에 대한 지식을 관리 할 수 있도록 semantic 메모리 관리를위한 생산 ready Model Context Protocol (MCP) 서버. : System PROMPT.md 를 참조하여 AI 모델을 구축하여이 메모리 시스템을 효과적으로 활용할 수 있습니다. 이 프롬프트는 모델이 언제 이해하고 메모리 도구를 사용하는 방법, 특히 proactive Memory retrieval에 대해 이해합니다. - - 엄격한 모드로 전체 유형 안전 - - HNSW 인덱싱으로 벡터 유사성 검색 - Type-safe SQL 쿼리 - - 용도 Transformers.js (NO API 호출) - - Redis + in-memory fallback for blazing fast performance - - User context isolation - - 응답에서 제거 된 Embedding - 부유한 관계 유형 (참고, 피임약, 지원, 연장, 원인, precedes, 등.
개요(AI 번역)
AI 에이전트를 저장, 검색, 관리하고 세션을 통해 상황에 대한 지식을 관리 할 수 있도록 semantic 메모리 관리를위한 생산 ready Model Context Protocol (MCP) 서버.
**;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 이 프롬프트는 모델이 언제 이해하고 메모리 도구를 사용하는 방법, 특히 proactive Memory retrieval에 대해 이해합니다.
특징
핵심 능력
- TypeScript - 엄격한 모드로 전체 유형의 안전
- PostgreSQL + pgvector - HNSW 색인으로 벡터 유사성 검색
- Kysely ORM - 유형 안전 SQL 쿼리
- Local Embeddings - Transformers.js 사용 (API 호출 없음) -Intelligent Caching - Redis + in-memory fallback for blazing 빠른 성능
- Multi-Agent 지원 - 사용자 컨텍스트 고립
- **토큰 효율적인 ** - 응답에서 제거
고급 메모리 관리
- ** 그래프 관계** - 풍부한 관계 유형 (참고, 피임약, 지원, 확장, 원인, 선행 등) -Graph Traversal - 깊이 한계와 필터링을 가진 BFS/DFS 알고리즘
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
MCP AI Memory
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 SYSTEM_PROMPT.md 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.
Features
Core Capabilities
- TypeScript - Full type safety with strict mode
- PostgreSQL + pgvector - Vector similarity search with HNSW indexing
- Kysely ORM - Type-safe SQL queries
- Local Embeddings - Uses Transformers.js (no API calls)
- Intelligent Caching - Redis + in-memory fallback for blazing fast performance
- Multi-Agent Support - User context isolation
- Token Efficient - Embeddings removed from responses
Advanced Memory Management
- Graph Relationships - Rich relationship types (references, contradicts, supports, extends, causes, precedes, etc.)
- Graph Traversal - BFS/DFS algorithms with depth limits and filtering
- Memory Decay - Automatic lifecycle management with exponential decay
- Memory States - Active, dormant, archived, and expired states
- Preservation - Protect important memories from decay
- Soft Deletes - Data recovery with deleted_at timestamps
- Clustering - Automatic memory consolidation
- Compression - Automatic compression of archived memories
Prerequisites
- Node.js 18+ or Bun
- PostgreSQL with pgvector extension
- Redis (optional - falls back to in-memory cache if not available)
Installation
NPM Package (Recommended for Claude Desktop)
npm install -g mcp-ai-memory
From Source
- Install dependencies:
bun install
- Set up PostgreSQL with pgvector:
CREATE DATABASE mcp_ai_memory;
\c mcp_ai_memory
CREATE EXTENSION IF NOT EXISTS vector;
- Create environment file:
# Create .env with your database credentials
touch .env
- Run migrations:
bun run migrate
Usage
Development
bun run dev
Production
bun run build
bun run start
Troubleshooting
Embedding Dimension Mismatch Error
If you see an error like:
Failed to generate embedding: Error: Embedding dimension mismatch: Model produces 384-dimensional embeddings, but database expects 768
This occurs when the embedding model changes between sessions. To fix:
- Option 1: Reset and Re-embed (Recommended for new installations)
# Clear existing memories and start fresh psql -d your_database -c "TRUNCATE TABLE memories CASCADE;"
설치
npx -y mcp-ai-memory설정
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "mcp-ai-memory"],
"env": {
"MEMORY_DB_URL": "postgresql://...",
"EMBEDDING_MODEL": "Xenova/all-mpnet-base-v2"
}
}
}
}