Labsco
adamkwhite logo

Claude Conversation Memory System

β˜… 2

from adamkwhite

Provides searchable local storage for Claude conversation history, enabling context retrieval during sessions.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Quality Gate Status Bugs Vulnerabilities Code Smells Coverage Duplicated Lines (%)

Claude Memory MCP β€” Universal AI Conversation Memory

A Model Context Protocol (MCP) server that provides persistent, searchable conversation memory across multiple AI platforms. Store, search, and retrieve conversation history with sub-millisecond full-text search powered by SQLite FTS5.

Features

  • πŸ” Sub-millisecond full-text search via SQLite FTS5 with relevance ranking
  • 🏷️ Automatic topic extraction β€” 574+ unique topics across 2,000+ associations
  • πŸ“Š Weekly summaries with insights and patterns
  • πŸ—ƒοΈ Organized file storage by date and topic
  • πŸ€– Multi-platform support β€” Claude, ChatGPT, Cursor AI, and custom formats
  • πŸ”Œ MCP integration for Claude Desktop and Claude Code

MCP Tools

search_conversations(query, limit=5)

Full-text search across all stored conversations with relevance ranking.

search_by_topic(topic, limit=10)

Find conversations tagged with a specific topic.

add_conversation(content, title, date)

Store a new conversation with automatic topic extraction and FTS indexing.

generate_weekly_summary(week_offset=0)

Generate insights and patterns from recent conversations.

get_search_stats()

View search engine statistics β€” index size, topic counts, and engine status.

Architecture

~/claude-memory/
β”œβ”€β”€ conversations/
β”‚   β”œβ”€β”€ 2025/
β”‚   β”‚   └── 06-june/
β”‚   β”‚       └── 2025-06-01_topic-name.md
β”‚   β”œβ”€β”€ index.json          # Search index
β”‚   └── topics.json         # Topic frequency
└── summaries/
    └── weekly/
        └── week-2025-06-01.md

File Structure

claude-memory-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server_fastmcp.py       # Main MCP server
β”‚   β”œβ”€β”€ conversation_memory.py  # Core memory engine + SQLite FTS5
β”‚   β”œβ”€β”€ format_detector.py      # Auto-detect AI platform format
β”‚   β”œβ”€β”€ validators.py           # Input validation
β”‚   β”œβ”€β”€ logging_config.py       # Structured logging (text/JSON)
β”‚   β”œβ”€β”€ importers/              # Platform-specific importers
β”‚   β”‚   β”œβ”€β”€ chatgpt_importer.py
β”‚   β”‚   β”œβ”€β”€ claude_importer.py
β”‚   β”‚   β”œβ”€β”€ cursor_importer.py
β”‚   β”‚   └── generic_importer.py
β”‚   └── schemas/                # JSON schema validation
β”œβ”€β”€ tests/                      # 435 tests, 98.68% coverage
β”œβ”€β”€ data/                       # Consolidated app data
β”œβ”€β”€ scripts/                    # Import and utility scripts
└── docs/                       # Documentation

Performance

SQLite FTS5 full-text search, benchmarked against 347 indexed conversations:

  • Search Speed: 0.2–0.5ms per query (4.4x faster than linear JSON scanning)
  • Topic Search: 0.3–0.4ms across 574 unique topics
  • Write Speed: ~33ms per conversation (includes indexing)
  • Capacity: 371 conversations in production use over 10 months
  • Test Coverage: 98.68% (435 tests) β€” 0 code smells, 0 security hotspots (SonarCloud verified)

Last benchmarked: April 2026 | Detailed Report

Note for Developers: Performance benchmarks create a ~/claude-memory-test directory for isolated testing. Normal MCP usage only uses ~/claude-memory/. If you see ~/claude-memory-test, it can be safely deleted.

Search Examples

# Technical topics
search_conversations("terraform azure")
search_conversations("mcp server setup")
search_conversations("python debugging")

# Project discussions  
search_conversations("interview preparation")
search_conversations("product management")
search_conversations("architecture decisions")

# Specific problems
search_conversations("dependency issues")
search_conversations("authentication error")
search_conversations("deployment configuration")

Development

Adding New Features

  1. Topic Extraction: Modify _extract_topics() in ConversationMemoryServer
  2. Search Algorithm: Enhance search_conversations() method
  3. Summary Generation: Improve generate_weekly_summary() logic

Testing

# Run validation suite
python3 tests/validate_system.py

# Test individual components
python3 tests/standalone_test.py

# Run full test suite with coverage
python3 -m pytest tests/ --ignore=tests/standalone_test.py --cov=src --cov-report=term

# Import test data
python3 scripts/bulk_import_enhanced.py test_data.json --dry-run

Test Data Storage (Developers Only): If you run performance benchmarks or test data generators, they create a ~/claude-memory-test directory to isolate test data from your production ~/claude-memory directory. This is only for development/testing - normal MCP usage does not create this directory.

To clean up test data after running benchmarks:

rm -rf ~/claude-memory-test

Or using the Makefile cleanup target:

make clean-test-data

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit a Pull Request

License

MIT License - see LICENSE file for details

Acknowledgments


Status: Production ready βœ…
Last Updated: April 2026
Version: 2.0.0