Repository navigation
Description
Description
The Python Strands templates set relevance_score=0.5 on every RetrievalConfig in memory/session.py. AgentCore Memory returns scores between 0.34 and 0.37 for a basic recall question against the facts it extracted. The Strands session manager drops every record below the threshold, so the agent gets no memories and answers as if it never heard the facts. The invoke returns status 200 and no error.
The value is in these templates:
src/assets/templates/agent-python-strands/memory/session.pylines 17 to 20src/assets/templates/a2a-python-strands/memory/session.pysrc/assets/templates/agui-python-strands/memory/session.pysrc/assets/templates/export-harness-python/memory/session.py, as the fallback whenmemoryRetrievalRelevanceScoreis not set
The RetrievalConfig default in bedrock-agentcore 1.25.0 is 0.2. The filter is in bedrock_agentcore/memory/integrations/strands/session_manager.py line 886, which keeps only records whose score is at least relevance_score.
Steps to Reproduce
agentcore create --name Repro4 --template agent-python-strandsagentcore deployagentcore invoke --runtime agent --session-id <session A> --payload '{"prompt":"My name is Mike and I live in Australia. I like drinking English Breakfast tea.","actorId":"mike"}'- Wait until
aws bedrock-agentcore list-memory-records --memory-id <id> --namespace /users/mike/factslists the extracted facts. In my run this took about two minutes and produced three records. aws bedrock-agentcore retrieve-memory-records --memory-id <id> --namespace /users/mike/facts --search-criteria '{"searchQuery":"What is my name?","topK":3}'agentcore invoke --runtime agent --session-id <session B> --payload '{"prompt":"What is my name?","actorId":"mike"}'- Change
relevance_score=0.5torelevance_score=0.2inapp/agent/memory/session.py, runagentcore deploy, and repeat step 6 with a new session ID.
Expected Behavior
In step 6 the agent answers with the name it was told in step 3.
Actual Behavior
Step 5 returns these scores:
- 0.36264706 for "Mike lives in Australia."
- 0.35874188 for "The user's name is Mike."
- 0.343668 for "Mike likes drinking English Breakfast tea."
In step 6 the agent answers "I don't know your name. You haven't told me, and I can't see any personal details about you."
In step 7, with only the threshold changed, the agent answers "Your name is Mike. You also told me you live in Australia and like English Breakfast tea."
CLI Version
1.0.0
Operating System
macOS
Additional Context
Region us-east-1. Runtime PYTHON_3_14. bedrock-agentcore 1.25.0, as installed by the generated project. Memory strategies are the template defaults (SEMANTIC, USER_PREFERENCE, SUMMARIZATION, EPISODIC).
Removing relevance_score from the four RetrievalConfig calls would fall back to the SDK default of 0.2. In this run 0.2 kept all three facts.
Activity
notgitika commentedon Oct 26, 2026
Thank you for bringing this up! We are coordinating with the memory team to decide any changes needed in the template.