Commit beac707
authored
* feat(memory): add CUSTOM strategy type to agentcore-cli (#677)
Enable self-managed (CUSTOM) memory strategy in the CLI, aligning
with the CDK constructs which already support customMemoryStrategy
via CloudFormation.
Changes:
- Add CUSTOM to MemoryStrategyTypeSchema enum and validation
- Add CUSTOM description to TUI wizard strategy picker
- Update CLI help text, LLM-compacted types, and AGENTS.md
- Add documentation for self-managed strategy in docs/
- Update tests: flip rejection tests to acceptance, add new cases
- Regenerate asset snapshots
Constraint: CDK already maps CUSTOM → customMemoryStrategy in CFN
Rejected: New SELF_MANAGED type | cross-layer naming inconsistency with CDK
Confidence: high
Scope-risk: narrow
* refactor(memory): derive VALID_STRATEGIES and help text from schema
Eliminates source-of-truth drift by deriving the valid strategies
array and CLI help text from MemoryStrategyTypeSchema.options
instead of maintaining hand-written duplicates.
Constraint: MemoryStrategyTypeSchema is the single source of truth
Confidence: high
Scope-risk: narrow
* fix(memory): add CUSTOM block to session.py templates
Without this, selecting CUSTOM as the only strategy would render
an empty retrieval_config dict with no guidance. Now both HTTP and
A2A Strands templates include a CUSTOM Handlebars block with a
TODO comment guiding users to add their own namespace and
retrieval config.
Constraint: CUSTOM is self-managed — no default namespaces to vend
Rejected: Auto-generating a placeholder namespace | would mislead users into thinking it works out of the box
Confidence: high
Scope-risk: narrow
* feat(memory): add CUSTOM as wizard MemoryOption and wire existing memories to new agents
Add 'custom' as a 4th MemoryOption in the create/add-agent wizards,
completing CUSTOM strategy support across all CLI flows. When adding
an agent to a project with existing memories, the template now
references all existing memories instead of always creating new ones.
- Add 'custom' to MemoryOption type, MEMORY_OPTIONS array, and all
validation/help text across create and add-agent commands
- Add 'custom' case to mapGenerateInputToMemories (CUSTOM strategy,
no default namespaces) and getMemoryLabel in wizard UI
- Add mapExistingMemoriesToProviders() to convert project Memory[]
to MemoryProviderRenderConfig[] for template rendering
- Update mapGenerateConfigToRenderConfig to accept existing memories
and merge them with new memory providers (deduped by name)
- Update writeAgentToProject to skip adding duplicate memories
- Wire existing project.memories through both add-agent paths
(AgentPrimitive CLI + useAddAgent TUI hook)
Constraint: Strands Agent takes a single session_manager, so session.py
references memoryProviders[0] as the primary memory
Rejected: Multi-select wizard for memory | template only supports one
session_manager, all memory env vars already available at runtime
Confidence: high
Scope-risk: moderate
* test(memory): add CUSTOM strategy and existingMemories tests
Add 18 new tests to schema-mapper.test.ts covering:
- mapGenerateInputToMemories with 'custom' MemoryOption
- mapGenerateConfigToResources with custom memory
- mapGenerateConfigToRenderConfig with existingMemories parameter
(dedup logic, hasMemory from existing, combining existing + new)
- mapExistingMemoriesToProviders (CUSTOM, empty strategies, multiple)
Also fix docs/configuration.md missing EPISODIC strategy row.
Constraint: CUSTOM strategy has no default namespaces or reflectionNamespaces
Constraint: Dedup operates on provider name, not strategy type
Confidence: high
Scope-risk: narrow
* style: fix prettier formatting in docs and source files
1 parent f5e1579 commit beac707
26 files changed
Lines changed: 361 additions & 66 deletions
File tree
- docs
- src
- assets
- __tests__/__snapshots__
- agents
- python
- a2a/strands/capabilities/memory
- http/strands/capabilities/memory
- cli
- commands
- add
- __tests__
- create
- operations/agent/generate
- __tests__
- primitives
- tui/screens
- agent
- generate
- memory
- schema
- llm-compacted
- schemas/primitives
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
191 | 222 | | |
192 | 223 | | |
193 | 224 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1702 | 1702 | | |
1703 | 1703 | | |
1704 | 1704 | | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1705 | 1710 | | |
1706 | 1711 | | |
1707 | 1712 | | |
| |||
3987 | 3992 | | |
3988 | 3993 | | |
3989 | 3994 | | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
3990 | 4000 | | |
3991 | 4001 | | |
3992 | 4002 | | |
| |||
4331 | 4341 | | |
4332 | 4342 | | |
4333 | 4343 | | |
4334 | | - | |
| 4344 | + | |
4335 | 4345 | | |
4336 | 4346 | | |
4337 | 4347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | | - | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
957 | | - | |
| 956 | + | |
| 957 | + | |
958 | 958 | | |
959 | | - | |
960 | | - | |
| 959 | + | |
961 | 960 | | |
962 | 961 | | |
963 | | - | |
| 962 | + | |
964 | 963 | | |
965 | | - | |
966 | | - | |
| 964 | + | |
967 | 965 | | |
968 | 966 | | |
969 | 967 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
245 | | - | |
| 246 | + | |
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| |||
0 commit comments