Labsco
ViralV00d00 logo

Claude Code Memory Server

β˜… 11

from ViralV00d00

A Neo4j-based MCP server providing persistent memory and contextual assistance for Claude Code.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

Claude Code Memory Server

A Neo4j-based Model Context Protocol (MCP) server that provides intelligent memory capabilities for Claude Code, enabling persistent knowledge tracking, relationship mapping, and contextual development assistance.

Overview

This MCP server creates a sophisticated memory system that tracks Claude Code's activities, decisions, and learned patterns to provide contextual memory across sessions and projects. It uses Neo4j as a graph database to capture and analyze complex relationships between development concepts, solutions, and workflows.

Features

Core Memory Operations

  • Persistent Memory Storage - Store development tasks, solutions, and patterns
  • Intelligent Search - Find relevant memories by context, content, or relationships
  • Relationship Mapping - Track how different concepts, files, and solutions relate
  • Context Awareness - Project-specific and technology-specific memory retrieval

Advanced Intelligence

  • Pattern Recognition - Automatically identify reusable development patterns
  • Solution Effectiveness - Track and learn from successful approaches
  • Workflow Memory - Remember and suggest optimal development sequences
  • Error Prevention - Learn from past mistakes to prevent similar issues

Development Integration

  • Task Execution Tracking - Monitor what Claude Code does and how
  • Code Pattern Analysis - Identify and store successful code patterns
  • Project Context Memory - Understand codebase conventions and dependencies
  • Collaborative Learning - Share knowledge across development sessions

Architecture

Memory Types

  • Task - Development tasks and their execution patterns
  • CodePattern - Reusable code solutions and architectural decisions
  • Problem - Issues encountered and their context
  • Solution - How problems were resolved and their effectiveness
  • Project - Codebase context and project-specific knowledge
  • Technology - Framework, language, and tool-specific knowledge

Relationship Types

The system tracks seven categories of relationships:

  1. Causal - CAUSES, TRIGGERS, LEADS_TO, PREVENTS, BREAKS
  2. Solution - SOLVES, ADDRESSES, ALTERNATIVE_TO, IMPROVES, REPLACES
  3. Context - OCCURS_IN, APPLIES_TO, WORKS_WITH, REQUIRES, USED_IN
  4. Learning - BUILDS_ON, CONTRADICTS, CONFIRMS, GENERALIZES, SPECIALIZES
  5. Similarity - SIMILAR_TO, VARIANT_OF, RELATED_TO, ANALOGY_TO, OPPOSITE_OF
  6. Workflow - FOLLOWS, DEPENDS_ON, ENABLES, BLOCKS, PARALLEL_TO
  7. Quality - EFFECTIVE_FOR, INEFFECTIVE_FOR, PREFERRED_OVER, DEPRECATED_BY, VALIDATED_BY

Development

Project Structure

claude-code-memory/
β”œβ”€β”€ src/claude_memory/          # Main source code
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ server.py              # MCP server implementation
β”‚   β”œβ”€β”€ models.py              # Data models and schemas
β”‚   β”œβ”€β”€ database.py            # Neo4j database operations
β”‚   β”œβ”€β”€ memory_store.py        # Core memory logic
β”‚   β”œβ”€β”€ relationships.py       # Relationship management
β”‚   β”œβ”€β”€ search.py              # Search and retrieval
β”‚   └── intelligence.py        # Pattern recognition and analytics
β”œβ”€β”€ tests/                     # Test suite
β”œβ”€β”€ docs/                      # Documentation
β”œβ”€β”€ scripts/                   # Utility scripts
└── pyproject.toml            # Project configuration

Development Setup

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run tests
pytest

# Format code
black src/ tests/
ruff --fix src/ tests/

# Type checking
mypy src/

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Check existing GitHub Issues
  2. Fork the repository and create a feature branch
  3. Make changes following our coding standards
  4. Add tests for new functionality
  5. Submit a pull request with a clear description

License

This project is licensed under the MIT License - see the LICENSE file for details.

Roadmap

Phase 1: Foundation (Current)

  • βœ… Project setup and basic MCP server
  • πŸ”„ Core memory operations (CRUD)
  • ⏳ Basic relationship management

Phase 2: Intelligence

  • ⏳ Advanced relationship system
  • ⏳ Pattern recognition
  • ⏳ Context awareness

Phase 3: Integration

  • ⏳ Claude Code workflow integration
  • ⏳ Automatic memory capture
  • ⏳ Proactive suggestions

Phase 4: Analytics

  • ⏳ Memory effectiveness tracking
  • ⏳ Knowledge graph visualization
  • ⏳ Performance optimization

Support

Acknowledgments