Skip to content

Commit 64578f7

Browse files
committed
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
1 parent be2f877 commit 64578f7

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,11 @@ def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[Agent
17011701
{{/if}}
17021702
{{#if (includes memoryProviders.[0].strategies "SUMMARIZATION")}}
17031703
f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5),
1704+
{{/if}}
1705+
{{#if (includes memoryProviders.[0].strategies "CUSTOM")}}
1706+
# TODO: Add your custom namespace and retrieval config.
1707+
# Custom strategies use user-controlled extraction logic.
1708+
# Example: f"/custom/{actor_id}/data": RetrievalConfig(top_k=3, relevance_score=0.5),
17041709
{{/if}}
17051710
}
17061711
{{/if}}
@@ -3986,6 +3991,11 @@ def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[Agent
39863991
{{/if}}
39873992
{{#if (includes memoryProviders.[0].strategies "SUMMARIZATION")}}
39883993
f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5),
3994+
{{/if}}
3995+
{{#if (includes memoryProviders.[0].strategies "CUSTOM")}}
3996+
# TODO: Add your custom namespace and retrieval config.
3997+
# Custom strategies use user-controlled extraction logic.
3998+
# Example: f"/custom/{actor_id}/data": RetrievalConfig(top_k=3, relevance_score=0.5),
39893999
{{/if}}
39904000
}
39914001
{{/if}}

src/assets/python/a2a/strands/capabilities/memory/session.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[Agent
2121
{{/if}}
2222
{{#if (includes memoryProviders.[0].strategies "SUMMARIZATION")}}
2323
f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5),
24+
{{/if}}
25+
{{#if (includes memoryProviders.[0].strategies "CUSTOM")}}
26+
# TODO: Add your custom namespace and retrieval config.
27+
# Custom strategies use user-controlled extraction logic.
28+
# Example: f"/custom/{actor_id}/data": RetrievalConfig(top_k=3, relevance_score=0.5),
2429
{{/if}}
2530
}
2631
{{/if}}

src/assets/python/http/strands/capabilities/memory/session.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[Agent
2121
{{/if}}
2222
{{#if (includes memoryProviders.[0].strategies "SUMMARIZATION")}}
2323
f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5),
24+
{{/if}}
25+
{{#if (includes memoryProviders.[0].strategies "CUSTOM")}}
26+
# TODO: Add your custom namespace and retrieval config.
27+
# Custom strategies use user-controlled extraction logic.
28+
# Example: f"/custom/{actor_id}/data": RetrievalConfig(top_k=3, relevance_score=0.5),
2429
{{/if}}
2530
}
2631
{{/if}}

0 commit comments

Comments
 (0)