Skip to content

feat(memory): Complete memory system implementation (MEM-001 through MEM-010)#305

Open
rolandpg wants to merge 10 commits intosnarktank:mainfrom
rolandpg:main
Open

feat(memory): Complete memory system implementation (MEM-001 through MEM-010)#305
rolandpg wants to merge 10 commits intosnarktank:mainfrom
rolandpg:main

Conversation

@rolandpg
Copy link

This PR implements the complete memory system for Antfarm workflows:

Features

  • MEM-001: Database schema with memory_contracts, memory_checkpoints, and session_index tables
  • MEM-002: MemoryContract API with CRUD operations, LRU eviction, and checkpointing
  • MEM-003: Forced memory search in agent prompts (REQUIRED_MEMORY_SEARCH section)
  • MEM-004: Checkpoint persistence with auto-save/restore
  • MEM-005: QMD query layer with semantic search capabilities
  • MEM-006: Working set control (max 20 contracts per run with priority boost)
  • MEM-007: Session indexing for audit trails
  • MEM-008: Workflow runner integration (claimStep/completeStep hooks)
  • MEM-009: CLI commands (list, get, search, log, checkpoint, clear)
  • MEM-010: Comprehensive documentation and test suite

Test Results

  • 36 tests passing (20 memory tests, 16 QMD tests)
  • All memory system stories complete

Commits

- Add memory_contracts, memory_checkpoints, session_index tables
- Create MemoryContract class with CRUD operations
- Add checkpoint persistence with auto-pruning
- Implement working set control and LRU eviction
- Add session logging for audit/debugging
- Create memory CLI commands (list, get, search, log, checkpoint, clear)

Stories: MEM-001, MEM-002 complete
- Wire up memory commands to CLI (list, get, search, log, checkpoint, clear)
- Add memory command documentation to printUsage()
- Build passes

Story: MEM-009 complete
- Add memory hooks to claimStep(): load working set, inject constraints/decisions into context
- Add checkpoint restoration on step claim
- Add checkpoint creation on step complete
- Auto-persist key_decision and key_constraint from output
- Required memory search flag injected into all step templates

Stories: MEM-008 complete
Total: MEM-001, MEM-002, MEM-008, MEM-009 done
- Update feature-dev workflow templates with REQUIRED_MEMORY_SEARCH section
- Add MEMORY_ACKNOWLEDGED requirement to all step outputs
- Inject key_decision and key_constraint extraction for persistence
- Working set, constraints, decisions now required reading before work

Stories: MEM-003 complete
Total: MEM-001, MEM-002, MEM-003, MEM-008, MEM-009 done
Remaining: MEM-005 (QMD query layer), MEM-006 (working set control), MEM-010 (docs)
- Implement QMD.query() with multiple search strategies:
  - Exact key match (100% score)
  - Key contains query (90% score)
  - Value contains query (70% score)
  - N-gram semantic similarity (50-80% score)
- Priority boosting (+5% per priority level above 5)
- Add findRelated() for graph traversal
- Add suggestRelevant() for context-based suggestions
- Add 'query' CLI command for ranked search

Story: MEM-005 complete
Total: 6/10 stories complete
- Update scan, prioritize, setup, fix step templates
- Add MEMORY_ACKNOWLEDGED requirement
- Add key_decision and key_constraint extraction

Stories: MEM-003 (additional coverage)
- Add comprehensive memory system documentation (docs/memory-system.md)
- Add database constraints: UNIQUE(run_id, key), ON DELETE CASCADE
- Add comprehensive test suite for MemoryContract (20 tests)
- Add comprehensive test suite for QMD query layer (16 tests)
- All 36 tests passing
@vercel
Copy link

vercel bot commented Mar 11, 2026

@rolandpg is attempting to deploy a commit to the Ryan Team on Vercel.

A member of the Team first needs to authorize it.

- Add Projects panel button to header
- Display Azure/PlayFab infrastructure stack
- Show cost estimates for launch/growth/scale phases
- List key benefits and implementation status
- Switch from 'default' model to ollama/devstral-small-2
- Point to local Ollama instance at 192.168.1.70:11434
- Applied to feature-dev, security-audit, and bug-fix workflows
- Use model ID without provider prefix (devstral-small-2:latest)
- Remove unsupported ollamaBaseUrl property
- Applied to all three workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant