neutral
Phase 4: Memory Architecture
Status: Completed (2026-02-09)
Goal: Structured memory that survives workflow boundaries and scales.
Scope:
- Memory taxonomy (working, episodic, semantic, procedural)
- Memory store interface and implementations
- Automatic memory management policies
- Cross-run persistence
Tasks and subtasks:
- Memory interfaces
- Define memory types and access patterns
- Implement
MemoryStoreinterfaces
- Implementations
- Postgres store
- Redis store (episodic)
- Vector store option (pgvector, Pinecone, etc.)
- In-memory store for tests
- Memory read/write tools
- Policies
- Working memory limits
- Episodic summarization
- Fact extraction and semantic persistence
- Conversation window management
- Cross-run persistence
- Memory references in
AgentRunInput - Load/merge logic across runs
- Memory references in
- Tests
- Memory store integration tests
- Policy enforcement tests
- Memory read/write tooling validation
Deliverables:
- Memory interfaces and implementations
- Policy engine
- Cross-run persistence
- Tests
Dev environment checks:
- Create and query episodic memory across continue-as-new
- Validate semantic search returns relevant facts
Dependencies:
- Phase 2 completion
Files to add/change:
internal/memory/types.gointernal/memory/store.gointernal/memory/policy.gointernal/memory/embedding.gointernal/memory/postgres_store.gointernal/memory/redis_store.gointernal/memory/inmemory_store.gointernal/memory/memory_test.gointernal/agent/activities.gointernal/agent/workflow.gointernal/agent/state.gointernal/agent/types.gocmd/worker/main.gocmd/run/main.gocmd/replay/main.gocmd/memory-query/main.gointernal/tools/memory_read.gointernal/tools/memory_write.gomigrations/0002_memory.up.sqlmigrations/0002_memory.down.sqlmigrations/0003_memory_metadata.up.sqlmigrations/0003_memory_metadata.down.sql.env.example