feat: add EPISODIC memory strategy support#651
Conversation
Coverage Report
|
Add EPISODIC as a new memory strategy type across the CLI:
- Schema enum with default episode namespace (/strategy/{memoryStrategyId}/actor/{actorId}/)
- Default reflection namespaces for episodic (required by the service)
- reflectionNamespaces field on MemoryStrategy schema
- CLI validation, help text, and TUI descriptions
- longAndShortTerm preset now includes EPISODIC
- LLM-compacted schema and AGENTS.md docs
- Unit and integration tests
Add Zod refinement to MemoryStrategySchema that requires reflectionNamespaces when strategy type is EPISODIC, matching the AWS service requirement. Update docs/commands.md and docs/memory.md to document the EPISODIC strategy and reflectionNamespaces field.
- Add strands-bedrock-memory E2E test that deploys with longAndShortTerm memory (includes all 4 strategies including EPISODIC) - Extend e2e-helper to support configurable memory option - Strengthen integ create-memory test to verify EPISODIC strategy is present with reflectionNamespaces in longAndShortTerm preset
- create.test.ts: verify EPISODIC with namespaces and reflectionNamespaces in longAndShortTerm preset - add-remove-resources integ: verify `add memory --strategies EPISODIC` persists reflectionNamespaces in agentcore.json - TUI test: drive Add Memory wizard through strategy multi-select, verify EPISODIC is persisted with correct config in agentcore.json
…or EPISODIC namespaces
61aa996 to
26bed63
Compare
|
lol i like the screenshots but we should remove them from docs/ |
notgitika
left a comment
There was a problem hiding this comment.
- docs/memory.md says reflectionNamespaces "must be a prefix of namespaces" but the code doesn't enforce this and the defaults don't satisfy it — Blocking. Users will follow the doc and get confused, or the service will reject configs that follow the doc's defaults.
- Schema validation mismatch between CLI and CDK — CLI requires reflectionNamespaces for EPISODIC via Zod refinement; CDK allows EPISODIC without it and even has a test asserting that path works. Non-blocking but worth a comment — if someone bypasses the CLI, CDK will happily synth invalid CloudFormation.
- Unrelated commits in PR #651 (evaluator tests, OIDC constant removal, readProjectConfig retype) — Non-blocking, but repo convention says keep PRs focused.
LGTM otherwise
|
Thanks for the review! Addressing each point:
|
|
Done — removed the episodic-memory screenshots from docs/ in 3ad72ed (kept the existing advanced-gate ones). |
- Default reflectionNamespaces changed from /reflections/{actorId} to
/episodes/{actorId} so it's a proper prefix of the episode namespace
- Added Zod refinement to validate that each reflectionNamespace is a
prefix of at least one namespace
- Restored doc claim that reflectionNamespaces must be a prefix of namespaces
- Added tests for prefix validation (accept valid, reject invalid)
|
Correction on point 1 — the prefix requirement IS correct per the AWS docs. Fixed properly in cc45775:
|
Summary
reflectionNamespaces(service requirement); enforced via Zod schema refinementlongAndShortTermmemory preset now includes all 4 strategies (SEMANTIC, SUMMARIZATION, USER_PREFERENCE, EPISODIC)Depends on CDK PR: https://github.com/aws/agentcore-l3-cdk-constructs/pull/108
TUI Walkthrough
1. Select "Add" from the main menu
2. Choose "Memory" resource
3. Enter memory name
4. Strategy picker now shows EPISODIC
5. All 4 strategies selected including EPISODIC
6. Review screen confirms EPISODIC
7. Memory created successfully
8. Resulting agentcore.json
EPISODIC strategy is persisted with both
namespacesandreflectionNamespaces:{ "type": "EPISODIC", "namespaces": ["/episodes/{actorId}/{sessionId}"], "reflectionNamespaces": ["/reflections/{actorId}"] }Test plan
add memory --strategies EPISODICverifies reflectionNamespaces in config