Amazon Bedrock AgentCore Runtime + Memanto
memanto-agentcore package adds durable memory keyed to stable user identity (not runtimeSessionId), using the same recall → execute → retain loop as other Memanto framework adapters.
Cross-session recall
before_turn() runs semantic recall before your Bedrock call so a new runtime session still sees prior context.Automatic retention
after_turn() stores each turn to Memanto (async by default so responses are not blocked).Stable identity
Memory is scoped to
tenant + user_id + agent_name — never to ephemeral sessionId.Fail-open recall
If Memanto is unavailable, recall returns empty context and your agent continues.
How It Works
[A-Za-z0-9_-] are allowed in Memanto agent ids. Ids longer than 64 characters are replaced by a 64-character SHA-256 digest of tenant + user_id + agent_name, so they stay stable and unique.
Prerequisites
- Python 3.10+
- Memanto and a Moorcheh API key (or on-prem Memanto backend configured)
- An AgentCore Runtime handler that receives a trusted
userId(JWT, AgentCore identity header, or server-side auth — never client-supplied) - AWS credentials and permissions for deploying and invoking AgentCore separately from Memanto
Install
1
Install the adapter
memanto automatically (PyPI dependency). Add pip install memanto only if you want to upgrade the core package independently of the adapter.2
Configure Moorcheh
memanto once to write ~/.memanto/.env. On-prem users: memanto config backend on-prem and set the Moorcheh URL per on-prem docs.Wrap your handler
Lower-level hooks
Identity rules
Preferred identity sources:- Validated user ID from AgentCore JWT/OAuth (
sub) X-Amzn-Bedrock-AgentCore-Runtime-User-Idheader- Application-supplied user ID in trusted server-side deployments
user_id is missing, the default resolver raises AgentResolutionError (fail closed).
Verify cross-session memory
Manual checklist (no AWS required for the Memanto side):- Run one turn for a test user and store a preference via
after_turnorrun_turn. - Use a new
runtimeSessionIdfor the sameuserId. - Call
before_turn— recalled context should include the stored detail. - Repeat with a second user — they must not see the first user’s memory.
integrations/agentcore/vX.Y.Z on the memanto repository.
Shared memory across integrations
All Memanto integration packages use the same Moorcheh-backed agents when they share anagent_id: