jjtolton/slopnesia
If you are the rightful owner of slopnesia and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Slopnesia is a minimal MCP memory server designed to provide efficient memory storage with optional embeddings, optimized for low resource usage.
Slopnesia
Minimal MCP memory server with optional embeddings - under 300MB total (vs 900MB+ for PyTorch-based alternatives).
Features
- Interface-based design - swap embedding providers easily
- Auto-fallback - tries ONNX/GPU → ONNX/CPU → OpenAI API → text search
- SQLite storage - single file database at
~/.claude/memories.db - Minimal dependencies - 28 packages for base, 48 total with ONNX
- Multi-agent safe - CouchDB-style optimistic concurrency control with version vectors
- Single-writer queue - Serialized writes prevent race conditions
Installation
Prerequisites
- Python 3.11 or higher
uvpackage manager (install here)
1. Clone the Repository
cd ~/programs # or wherever you want to install it
git clone https://github.com/jjtolton/slopnesia
cd slopnesia
2. Choose Your Installation
Base Install (Text Search Only)
uv pip install -e .
Size: ~10MB
ONNX Embeddings (Local, GPU-accelerated)
uv pip install -e '.[onnx]'
Size: ~300MB total (ONNX Runtime GPU + model)
OpenAI Embeddings (API-based)
uv pip install -e '.[api]'
Size: ~15MB
Configuration
Set environment variables:
# Embedding mode (auto, onnx, openai, none)
MEMORY_EMBEDDING_MODE=auto
# ONNX settings
MEMORY_ONNX_MODEL=all-MiniLM-L6-v2
MEMORY_ONNX_USE_GPU=true
# OpenAI settings
MEMORY_OPENAI_API_KEY=sk-...
MEMORY_OPENAI_MODEL=text-embedding-3-small
# Database location
MEMORY_DB_PATH=~/.claude/memories.db
MCP Configuration
To enable Claude to use slopnesia for memory storage, add this MCP server to your configuration:
For Claude Code CLI
Use the claude mcp command to install globally:
claude mcp add --scope user simple-memory uv --directory /path/to/slopnesia run python -m src.server
Replace /path/to/slopnesia with your actual installation path (e.g., ~/programs/slopnesia).
Verify the installation:
claude mcp list
Manual Configuration
Alternatively, edit your ~/.claude/mcp.json:
{
"mcpServers": {
"simple-memory": {
"command": "uv",
"args": [
"--directory",
"/path/to/slopnesia",
"run",
"python",
"-m",
"src.server"
],
"env": {
"MEMORY_EMBEDDING_MODE": "auto",
"MEMORY_ONNX_USE_GPU": "true"
}
}
}
}
After adding the configuration, restart Claude Code.
MCP Tools
The server exposes these tools to Claude:
store_memory(content, tags?, context?)- Store a new memory (returns version & hash)search_memory(query, limit?, threshold?)- Search using text or semantic similaritylist_recent(limit?)- Get recent memoriesget_memory(id)- Get specific memory by ID with version infoupdate_memory(id, content, expected_version, expected_hash?, tags?, context?)- Update with conflict detectiondelete_memory(id)- Delete a memoryget_stats()- Get database statisticsrestart_server()- Gracefully restart the MCP server
Architecture
┌─────────────────────────────────┐
│ EmbeddingProvider Interface │
└────────────┬────────────────────┘
│
┌───────┴───────┬────────────┬──────────┐
│ │ │ │
┌────▼────┐ ┌─────▼─────┐ ┌──▼────┐ ┌──▼─────┐
│ NoOp │ │ ONNX │ │OpenAI │ │ Future │
│(text) │ │(local GPU)│ │(API) │ │providers│
└─────────┘ └───────────┘ └───────┘ └────────┘
Current Status
✓ Installed and connected to Claude Code
Embedding Provider: Auto-detecting (ONNX with GPU fallback)
Database: ~/.claude/memories.db
Total Size: ~300MB (ONNX) vs 900MB+ (PyTorch alternatives)
Comparison
| Feature | slopnesia | Claude-CursorMemoryMCP |
|---|---|---|
| Size | 300MB (ONNX) | 900MB+ (PyTorch) |
| Dependencies | 48 packages | 339 packages |
| Storage | SQLite (single file) | PostgreSQL + Redis (Docker) |
| GPU Support | Yes (ONNX Runtime) | Yes (PyTorch CUDA) |
| Embeddings | ONNX, OpenAI, or none | PyTorch local only |
| Setup | Simple pip install | Docker compose + Python env |
Multi-Agent Concurrency
Slopnesia supports safe concurrent access from multiple agents. See for details on:
- Version vectors and content hashing
- Optimistic locking with conflict detection
- Single-writer queue architecture
- Conflict resolution workflows
Test the implementation:
uv run python test_concurrency.py
Development
See implementation files:
src/embeddings.py- Embedding interface and implementationssrc/database.py- SQLite storage with FTS5 + version controlsrc/config.py- Configuration and auto-detectionsrc/server.py- MCP server implementationtest_concurrency.py- Test suite for concurrency control