Skip to content

Conversation

@jariy17
Copy link
Contributor

@jariy17 jariy17 commented Feb 10, 2026

Summary

  • Add deprecation warning to MemoryControlPlaneClient.__init__() indicating removal in v1.4.0
  • Add per-method deprecation warnings to every public method with specific MemoryClient migration suggestions
  • Add client= constructor parameter for backward-compatible boto3 client injection (no property getter/setter)

Approach

Adds deprecation warnings that guide users to the correct MemoryClient equivalent for each method.

Closes #247

Customer experience

>>> from bedrock_agentcore.memory.controlplane import MemoryControlPlaneClient
>>> client = MemoryControlPlaneClient()
DeprecationWarning: MemoryControlPlaneClient is deprecated and will be removed in v1.4.0.
Use MemoryClient instead, which provides all control plane operations plus data plane features.

>>> client.create_memory(name="my-memory")
DeprecationWarning: MemoryControlPlaneClient.create_memory() is deprecated.
Use MemoryClient.create_memory() or create_memory_and_wait() instead.

Each method emits its own warning pointing to the specific MemoryClient equivalent.

Test plan

  • All 31 controlplane tests pass
  • All 107 MemoryClient tests pass (no changes to client.py)
  • New test_deprecation_warning verifies class-level warning on init
  • New test_method_deprecation_warnings verifies each public method emits its own warning with MemoryClient suggestion
  • New test_constructor_client_param and test_constructor_default_client verify constructor injection

@jariy17 jariy17 requested a review from a team February 10, 2026 20:04
MemoryControlPlaneClient and MemoryClient have significant functional
overlap. MemoryClient is a superset that provides all control plane
operations plus data plane features, response normalization, and typed
strategy helpers. Maintaining both creates a maintenance burden and user
confusion.

This refactors MemoryControlPlaneClient to be a thin pass-through that
delegates all operations to an internal MemoryClient instance, and emits
a DeprecationWarning on instantiation directing users to migrate.

Closes #247
@jariy17 jariy17 force-pushed the deprecate-memory-controlplane-client branch from 7e81382 to 2bfcf89 Compare February 10, 2026 20:21
return self._memory_client.gmcp_client

logger.info("Initialized MemoryControlPlaneClient for %s in %s", environment, region_name)
@client.setter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no setters allowed. Pass the boto3 client inside the constructors in a backwards compatiable way.

break

# Add strategy count to each memory summary
for memory in memories:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this adds a strategy count. Does the MemoryClient have that? Make sure they return the same structured dictionary.

check_strategies=True,
)
start_time = time.time()
while time.time() - start_time < max_wait:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't memory client has wait_for_memory()?

raise

raise TimeoutError(f"Memory {memory_id} was not deleted within {max_wait} seconds")
return self._memory_client.delete_memory(memory_id=memory_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all the returns to make sure it returns the same dicti.

Keep original implementation (no pass-through to MemoryClient) to
preserve exact return value contracts. Add deprecation warnings to
__init__ and every public method with specific MemoryClient migration
suggestions. Add client= constructor parameter for backward-compatible
boto3 client injection.

Closes #247
@jariy17 jariy17 changed the title Deprecate MemoryControlPlaneClient as pass-through to MemoryClient Deprecate MemoryControlPlaneClient with per-method migration warnings Feb 10, 2026
@jariy17
Copy link
Contributor Author

jariy17 commented Feb 10, 2026

Customer-facing deprecation warnings

Here's what users will see when running with -W all (or warnings.simplefilter('always')):

from bedrock_agentcore.memory.controlplane import MemoryControlPlaneClient

client = MemoryControlPlaneClient()
# DeprecationWarning: MemoryControlPlaneClient is deprecated and will be removed in v1.4.0.
# Use MemoryClient instead, which provides all control plane operations plus data plane
# features. See: https://github.com/aws/bedrock-agentcore-sdk-python/issues/247

client.create_memory(name="my-memory")
# DeprecationWarning: MemoryControlPlaneClient.create_memory() is deprecated.
# Use MemoryClient.create_memory() or create_memory_and_wait() instead.
# See: https://github.com/aws/bedrock-agentcore-sdk-python/issues/247

client.get_memory("mem-abc123")
# DeprecationWarning: MemoryControlPlaneClient.get_memory() is deprecated.
# Use MemoryClient.get_memory(memoryId=...) or get_memory_strategies() instead.
# See: https://github.com/aws/bedrock-agentcore-sdk-python/issues/247

client.list_memories()
# DeprecationWarning: MemoryControlPlaneClient.list_memories() is deprecated.
# Use MemoryClient.list_memories() instead.
# See: https://github.com/aws/bedrock-agentcore-sdk-python/issues/247

client.delete_memory("mem-abc123")
# DeprecationWarning: MemoryControlPlaneClient.delete_memory() is deprecated.
# Use MemoryClient.delete_memory() or delete_memory_and_wait() instead.
# See: https://github.com/aws/bedrock-agentcore-sdk-python/issues/247

Each warning points to the specific MemoryClient method the customer should migrate to, plus the tracking issue.

@jariy17 jariy17 deployed to auto-approve February 10, 2026 23:54 — with GitHub Actions Active
@jariy17
Copy link
Contributor Author

jariy17 commented Feb 10, 2026

Customer-facing deprecation warnings

Here's what users will see when running with -W all (or warnings.simplefilter('always')):

from bedrock_agentcore.memory.controlplane import MemoryControlPlaneClient

client = MemoryControlPlaneClient()
# DeprecationWarning: MemoryControlPlaneClient is deprecated and will be removed in v1.4.0.
# Use MemoryClient instead, which provides all control plane operations plus data plane features.

client.create_memory(name="my-memory")
# DeprecationWarning: MemoryControlPlaneClient.create_memory() is deprecated.
# Use MemoryClient.create_memory() or create_memory_and_wait() instead.

client.get_memory("mem-abc123")
# DeprecationWarning: MemoryControlPlaneClient.get_memory() is deprecated.
# Use MemoryClient.get_memory(memoryId=...) or get_memory_strategies() instead.

client.list_memories()
# DeprecationWarning: MemoryControlPlaneClient.list_memories() is deprecated.
# Use MemoryClient.list_memories() instead.

client.delete_memory("mem-abc123")
# DeprecationWarning: MemoryControlPlaneClient.delete_memory() is deprecated.
# Use MemoryClient.delete_memory() or delete_memory_and_wait() instead.

Each warning points to the specific MemoryClient method the customer should migrate to.

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.

Deprecate MemoryControlPlaneClient in favor of MemoryClient

1 participant