Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Implement test mode for memory bank MCP server #6

@nikomatsakis

Description

@nikomatsakis

Implement write-memory operation with simulated mode

Status: Planning

Current Understanding

The memory bank MCP server currently has working read_in functionality but write operations are not implemented. Based on design discussion, we're consolidating consolidate and store_back into a unified write-memory operation that handles both creating new memories and updating existing ones.

To safely develop and test write functionality, we need a simulated mode that prevents actual file modifications during testing.

Unified Write-Memory Operation

Core Design

  • Single write-memory tool replaces consolidate and store_back
  • Takes memory content and optional memory ID
  • Creates new memory file if no ID provided
  • Updates existing memory file if ID provided
  • Uses git for version tracking (no automatic sync yet)
  • Conflicts handled later - assume single Claude for now

Simulated Mode

  • --simulated flag prevents actual file writes
  • Operations logged but not persisted
  • Enables safe testing and development
  • read_in continues to work with real memories

Requirements

Write-Memory Implementation

  • Replace consolidate/store_back stubs with unified write-memory tool
  • Support creating new memories (generate ID from content/timestamp)
  • Support updating existing memories by ID
  • Write JSON files to .memories directories
  • Add git commit for each memory write operation

Simulated Mode

  • Add --simulated command line flag to memory bank server
  • When enabled, log write operations without file changes
  • Clear indication in logs when running in simulated mode
  • read_in unaffected (reads real memories only)

Integration with Dialectic

  • Update dialectic test runner to support --simulated flag
  • Create test scenarios for write-memory workflow
  • Verify no actual files modified in simulated mode

Implementation Approach

Phase 1: Core Write-Memory

  1. Implement write-memory tool with actual file operations
  2. Support both new memory creation and updates
  3. Add git commits for tracking changes

Phase 2: Simulated Mode

  1. Add simulated flag and mode detection
  2. Implement simulated variants of write operations
  3. Add comprehensive logging for simulated writes

Phase 3: Testing Integration

  1. Update dialectic for simulated mode testing
  2. Create comprehensive test scenarios
  3. Verify production file operations work correctly

Success Criteria

  • Single write-memory operation handles all memory persistence
  • Simulated mode enables safe testing without file system changes
  • Memory bank supports full read → write workflow
  • Git-based version tracking for all memory changes
  • Clear separation between simulated and production modes

Context

This implements the unified memory write operation identified in design discussions, focusing on git-based storage while deferring conflict resolution complexity to later iterations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions