شعار Local Context Memory MCP

Local Context Memory MCP

المجتمع
cunicopia-dev

Have LLMs save memories about you locally on your own hardware

الناشرcunicopia-dev
المستودعlocal-memory-mcp
اللغةPython
التفريعات
3
النجوم
12
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Local Context Memory MCP إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 12، والنسخ المتفرعة: 3 في المستودع المرتبط.

Local Context Memory MCP

License: MIT Python 3.12+ MCP Compatible
Docker Support

Ever wanted the ChatGPT memory feature but across all your LLMs and stored on your own hardware? Ever hate how there's a limit to how many memories ChatGPT can store, and that you can't segment your memories into different domains?

Here's your fix.

Give any AI assistant persistent, unlimited memory that you control completely.

A production-ready persistent memory system for AI agents using the Model Context Protocol (MCP). Works with Claude Desktop, any MCP-compatible client, and gives you the memory features you've been wanting.

Table of Contents

Why This Matters

Traditional AI Problem: AI assistants forget everything between conversations. Every interaction starts from scratch, requiring users to repeatedly provide context about their preferences, projects, and history.

Solution: Local Context Memory gives your AI persistent, searchable memory that:

  • 🧠 Remembers across sessions - User preferences, project details, conversation history
  • 🎯 Finds relevant context - Semantic search surfaces the right memories at the right time
  • 🏢 Organizes by domain - Separate contexts for work, health, personal life (PostgreSQL)
  • 🔒 Stays private - All data stored locally under your control
  • ⚡ Works immediately - Drop-in compatibility with Claude Desktop and MCP clients

Choose Your Implementation

  • SQLite + FAISS: Perfect for personal use, development, and simple deployments
  • PostgreSQL + pgvector: Production-ready with domain segmentation and team collaboration

Tools & Capabilities

Available Tools

store_memory

Store new information in persistent memory with automatic semantic indexing.

  • SQLite: store_memory(content, source?, importance?)
  • PostgreSQL: store_memory(content, domain?, source?, importance?)
  • Examples:
    • "User prefers TypeScript over JavaScript for new projects"
    • "Weekly team meeting every Tuesday at 2 PM PST"

update_memory

Modify existing memories while preserving search indexing.

  • SQLite: update_memory(memory_id, content?, importance?)
  • PostgreSQL: update_memory(memory_id, content?, importance?, domain?)
  • Use case: Update outdated information or change importance levels

search_memories

Find relevant memories using semantic or keyword search.

  • SQLite: search_memories(query, limit?, use_vector?)
  • PostgreSQL: search_memories(query, domain?, limit?)
  • Examples:
    • "What programming languages does the user prefer?"
    • "Recent project decisions about database choices"

list_memory_domains (PostgreSQL Only)

Discover available memory domains for organized context switching.

  • Returns: ["default", "work", "health", "personal"]
  • Use case: Switch between different memory contexts

Available Resources

memory://query (SQLite)

Quick semantic search via URI pattern for simple memory retrieval.

memory://domain/query (PostgreSQL)

Domain-scoped semantic search for isolated memory contexts.

  • Examples:
    • memory://work/project deadlines
    • memory://health/medication schedule

Available Prompts

summarize_memories

Generate intelligent summaries of retrieved memory collections.

  • Input: List of memory objects
  • Output: Structured summary highlighting key patterns and insights
  • Use case: Create context summaries for complex topics

Architectures

SQLite + FAISS Implementation (Original)

PostgreSQL + pgvector Implementation (New)

Features

Common Features

  • Semantic Search: Uses Ollama embeddings for intelligent memory retrieval
  • Smart Chunking: Automatically breaks down long text for better search results
  • MCP Standard: Full MCP protocol compliance for Claude Desktop integration
  • Docker Ready: Simple containerized deployment with self-contained images
  • Fallback Search: Automatic fallback to text search when vector search unavailable

SQLite + FAISS Specific

  • Local Storage: Everything runs locally with SQLite + FAISS files
  • Zero Setup: No database server required
  • Portable: Single directory contains all data

PostgreSQL + pgvector Specific

  • Domain Segmentation: Separate memory contexts (startup, health, personal, etc.)
  • Production Ready: ACID compliance, concurrent access, replication support
  • Native Vector Ops: Efficient similarity search without separate index files
  • Scalable: Handles large datasets with proper indexing

Quick Start

Recommended: Use Docker for the easiest setup! Skip all dependency management and get running in seconds.

Option 1: Docker (Recommended)

SQLite Version (simplest):

bash
# Run immediately - no setup required!
docker run --rm -i -v ./memory-data:/app/data cunicopia/local-memory-mcp:sqlite

PostgreSQL Version (with domain segmentation):

bash
# Run immediately - includes full PostgreSQL database!
docker run --rm -i -v ./postgres-data:/var/lib/postgresql/data cunicopia/local-memory-mcp:postgres

That's it! The containers are self-contained and handle all dependencies automatically.

Prerequisites

  • Docker (for containerized deployment) or Python 3.12+ (for local installation)
  • Ollama with nomic-embed-text model (optional but recommended for enhanced semantic search)

Ollama Setup (Optional but Recommended)

Ollama enables enhanced semantic search with vector embeddings. Without it, the system falls back to text-based search.

Installation:

  • macOS/Windows: Download installer from ollama.com/download
  • Linux: curl -fsSL https://ollama.com/install.sh | sh

Setup:

bash
# Install the embedding model
ollama pull nomic-embed-text:v1.5

# Verify it's running (should show localhost:11434)
curl http://localhost:11434/api/tags

Claude Desktop Setup

Once you have the Docker containers ready (or local installation), connect to Claude Desktop by adding this to your MCP settings:

Docker Configuration (Recommended)

json
{
  "mcpServers": {
    "localMemoryMCP-SQLite": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-v", "/path/to/your/memory-data:/app/data", "cunicopia/local-memory-mcp:sqlite"]
    },
    
    "localMemoryMCP-PostgreSQL": {
      "command": "docker", 
      "args": ["run", "--rm", "-i", "-v", "/path/to/your/postgres-data:/var/lib/postgresql/data", "cunicopia/local-memory-mcp:postgres"]
    }
  }
}

Volume Paths: Replace /path/to/your/memory-data and /path/to/your/postgres-data with any directory where you want to store your memories (e.g., ~/Documents/memory-data, /Users/yourname/my-memories, etc.)

Local Installation Configuration (Alternative)

Note: Only use if you cannot use Docker. Requires manual setup first (see Manual Installation).

json
{
  "mcpServers": {
    "localMemoryMCP": {
      "command": "bash",
      "args": ["/path/to/local-memory-mcp/run_sqlite.sh"]
    }
  }
}

Examples

SQLite Implementation

javascript
// Store a memory
store_memory(
  "User prefers Python for backend development", 
  "conversation", 
  0.8
)

// Search memories
search_memories("programming preferences", 5, true)

// Get memories via resource
// Access: memory://programming

PostgreSQL Implementation

javascript
// List available domains
list_memory_domains()
// Returns: ["default", "startup", "health"]

// Store memories in different domains
store_memory(
  "Series A funding closed at $10M",
  "startup",  // domain
  "meeting",   // source
  0.9         // importance
)

store_memory(
  "User has peanut allergy",
  "health",
  "medical_record",
  1.0
)

// Search within specific domain
search_memories("funding", "startup", 5)

// Get memories via resource
// Access: memory://startup/funding%20strategy

Components

SQLite Implementation

  • FastMCP: Python MCP server framework
  • SQLite: Structured metadata and text search fallback
  • FAISS: Vector similarity search
  • Ollama: Local embedding generation (optional)
  • Smart Chunker: Text processing for optimal retrieval

PostgreSQL Implementation

  • FastMCP: Python MCP server framework
  • PostgreSQL: Full database with metadata and vector storage
  • pgvector: Native PostgreSQL vector similarity search
  • Ollama: Local embedding generation (optional)
  • Domain Tables: Isolated memory contexts for better organization

Configuration

Common Environment Variables

  • OLLAMA_API_URL: Ollama endpoint (default: http://localhost:11434)
  • OLLAMA_EMBEDDING_MODEL: Model name (default: nomic-embed-text)
  • MCP_SERVER_NAME: Server name for MCP (default: Local Context Memory)

SQLite Specific

  • MCP_DATA_DIR: Data storage path (default: ./data)

PostgreSQL Specific

  • POSTGRES_HOST: Database host (default: localhost)
  • POSTGRES_PORT: Database port (default: 5432)
  • POSTGRES_DB: Database name (default: postgres)
  • POSTGRES_USER: Database user (default: postgres)
  • POSTGRES_PASSWORD: Database password (required)
  • DEFAULT_MEMORY_DOMAIN: Default domain for memories (default: default)

Development

SQLite Version

bash
pip install -r requirements.sqlite.txt
python src/sqlite_memory_server.py

PostgreSQL Version

bash
pip install -r requirements.pgvector.txt
python src/postgres_memory_server.py

Docker

Docker support is fully functional with self-contained containers! Both SQLite and PostgreSQL versions run completely independently.

bash
# Run pre-built images directly (recommended)
# SQLite version - replace './data' with your preferred data directory
docker run --rm -i -v ./data:/app/data cunicopia/local-memory-mcp:sqlite

# PostgreSQL version - replace './postgres_data' with your preferred data directory  
docker run --rm -i -v ./postgres_data:/var/lib/postgresql/data cunicopia/local-memory-mcp:postgres

Building from source (optional):

bash
# Only needed if you want to build yourself
docker build -f Dockerfile.sqlite_version -t local-memory-mcp:sqlite_version .
docker build -f Dockerfile.postgres_version -t local-memory-mcp:postgres_version .

Manual Installation

⚠️ We strongly recommend using Docker instead - it handles all dependencies automatically. Use this section only if Docker is not available or you have specific requirements.

SQLite + FAISS (Simple, Local)

bash
git clone https://github.com/cunicopia-dev/local-memory-mcp
cd local-memory-mcp
pip install -r requirements.sqlite.txt
python src/sqlite_memory_server.py

PostgreSQL + pgvector (Production, Scalable)

For Debian-based systems:

bash
# Install PostgreSQL + pgvector
sudo apt install postgresql postgresql-contrib
sudo apt install postgresql-17-pgvector  # Adjust version as needed

# Change directory to where you downloaded the repo
cd /path/to/local-memory-mcp

# Set up database
# PLEASE NOTE: We create a user and basic password here, please change this if you want to host it locally
psql < sql/create_user.sql
psql -U postgres < sql/setup_database.sql

# Install Python dependencies
pip install -r requirements.pgvector.txt

# Configure connection (edit .env file)
cp .env.example .env

# Run server
python src/postgres_memory_server.py

For macOS:

bash
# Install PostgreSQL and pgvector (Homebrew-based)
brew install postgresql@17
brew services start postgresql@17

# Link psql and other tools if needed
brew link --force postgresql@17

# Install pgvector extension (PostgreSQL must be running)
# This installs the extension into your local PostgreSQL environment
brew install pgvector

# OPTIONAL: If pgvector doesn't register properly, you can manually build it
# git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
# cd pgvector
# make && make install

# PLEASE NOTE: We create a user and basic password here, please change this if you want to host it locally
psql < sql/create_user.sql

# Set up database
psql -U postgres -f sql/setup_database.sql

# Install Python dependencies
pip install -r requirements.pgvector.txt

# Configure connection (edit .env file)
cp .env.example .env

# Run server
python src/postgres_memory_server.py

⚠️ SECURITY CAUTION: Please go to sql/create_user.sql and create a more secure user and password, the ones listed are for example purposes only! Please protect your data and take your data security seriously.

License

MIT License

Demo

See the local memory system in action:

Example 1

Example 1

Example 2

Example 2

استخدم MCP الخاص بـ Local Context Memory MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Local Context Memory MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف Local Context Memory MCP كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Local Context Memory MCP.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "cunicopia-dev-local-memory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Local Context Memory MCP، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Local Context Memory MCP.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Local Context Memory MCP لمساعدتي في هذه المهمة؟
Local Context Memory MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Local Context Memory MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP Local Context Memory MCP؟

Local Context Memory MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Local Context Memory MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Local Context Memory MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Local Context Memory MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Local Context Memory MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Local Context Memory MCP بـ TypingMind؟

يعمل Local Context Memory MCP عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Local Context Memory MCP في TypingMind؟

يتيح Local Context Memory MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Local Context Memory MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Local Context Memory MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇