Skip to content

Update DP APIs to support namespace re-design#449

Open
nborges-aws wants to merge 1 commit intomainfrom
chore/namespaceRedesignDataPlane
Open

Update DP APIs to support namespace re-design#449
nborges-aws wants to merge 1 commit intomainfrom
chore/namespaceRedesignDataPlane

Conversation

@nborges-aws
Copy link
Copy Markdown
Contributor

Summary:

Adds support for the new namespacePath field introduced on the memory data-plane APIs (ListMemoryRecords and RetrieveMemoryRecords). This lets callers opt into hierarchical path-prefix retrieval, separate from the existing namespace field (which is evolving toward exact-match semantics service-side).

Description of changes:

New utility (src/bedrock_agentcore/_utils/namespace.py):

  • build_namespace_params(namespace, namespace_path) — validates caller input (mutual exclusivity, presence, no wildcards) and produces the correct wire kwargs for boto.

MemoryClient (memory/client.py):

  • retrieve_memories() — accepts both namespace and namespace_path. On invalid input (both provided, neither provided, wildcard present), logs an error and returns [] — preserves the existing soft-fail contract of this method.
  • process_turn_with_llm() — adds retrieval_namespace_path parameter, forwards to retrieve_memories.

MemorySessionManager (memory/session.py):

  • search_long_term_memories() and list_long_term_memory_records() now route the existing namespace_prefix argument to namespacePath. The parameter name and user-facing semantics remain unchanged; only the underlying field is updated.

Strands integration (memory/integrations/strands/session_manager.py):

  • _load_ltm() now calls retrieve_memories(namespace_path=...) to preserve the historical hierarchical-scoping behavior under the new API semantics.

Behavior changes for users

  • Existing callers using retrieve_memories(namespace=...) continue to work. Namespace will eventually become the exact-match field
  • Existing callers using search_long_term_memories(namespace_prefix=...) continue to work as before
  • New callers can opt into hierarchical retrieval explicitly via retrieve_memories(namespace_path=...).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

✅ No Breaking Changes Detected

No public API breaking changes found in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant