feat: add semanticOverride support for SEMANTIC memory strategies - #696
Merged
Merged
Conversation
Contributor
Author
TUI ScreenshotsScreenshots captured during E2E testing of the SemanticOverride feature:
|
aidandaly24
force-pushed
the
feat/semantic-override-678
branch
from
March 27, 2026 04:47
a42ba14 to
e692ae4
Compare
aidandaly24
had a problem deploying
to
e2e-testing
March 27, 2026 04:47 — with
GitHub Actions
Failure
aidandaly24
had a problem deploying
to
e2e-testing
March 27, 2026 04:47 — with
GitHub Actions
Failure
…s#678) Add SemanticOverride schema support to memory strategies, allowing users to customize extraction and consolidation behavior with custom prompts and model IDs on SEMANTIC strategy types. Changes: - Add SemanticExtractionOverrideSchema, SemanticConsolidationOverrideSchema, and SemanticOverrideSchema with at-least-one validation - Add cross-field validation rejecting semanticOverride on non-SEMANTIC types - Export new schemas and types through barrel files - Update LLM-compacted types with semanticOverride interface - Add 13 new unit tests for override validation - Add 2 integration tests for agentcore-project validation Constraint: semanticOverride only valid on SEMANTIC strategy type Constraint: At least one of extraction or consolidation must be provided Rejected: Allow override on all strategy types | CFn only supports it on SEMANTIC Confidence: high Scope-risk: narrow
aidandaly24
force-pushed
the
feat/semantic-override-678
branch
from
March 27, 2026 05:20
e692ae4 to
911f3e9
Compare
aidandaly24
had a problem deploying
to
e2e-testing
March 27, 2026 05:20 — with
GitHub Actions
Failure
aidandaly24
had a problem deploying
to
e2e-testing
March 27, 2026 05:20 — with
GitHub Actions
Failure
jesseturner21
approved these changes
Mar 27, 2026
11 tasks
aidandaly24
added a commit
that referenced
this pull request
Mar 27, 2026
* Revert "feat: add semanticOverride support for SEMANTIC memory strategies (#678) (#696)" This reverts commit 5e0f584. * Revert "feat(memory): add CUSTOM strategy type to agentcore-cli (#677) (#694)" This reverts commit beac707. * fix: restore EPISODIC strategy to configuration.md The revert of the CUSTOM strategy commit inadvertently removed the EPISODIC row from the Memory Strategies table in configuration.md.
notgitika
added a commit
to notgitika/agentcore-cli
that referenced
this pull request
Aug 18, 2026
Reverts 87be86e. I added CUSTOM because the CDK schema already had it in MemoryStrategyTypeSchema, which turns out to be the argument PR aws#694 made -- and aws#713 reverted a day later. The CLI has removed CUSTOM twice on purpose. Offering the type without somewhere to put its extraction configuration is aws#241 ("select custom memory strategy, note there is no option to add prompts"); aws#266 removed it as a P0 to stop users picking an unsupported option, aws#694/aws#696 added it back with semanticOverride, and aws#713 reverted both as premature. aws#676 tracks doing it properly. The CDK keeping CUSTOM in its enum without a configuration field is the same hole, not a licence. So both forms are rejected again, now with an error that says why and points at aws#676. The one thing kept from the reverted commit: memory validation errors name the offending field, since issue.path was being dropped.
notgitika
added a commit
to notgitika/agentcore-cli
that referenced
this pull request
Aug 19, 2026
Reverts 87be86e. I added CUSTOM because the CDK schema already had it in MemoryStrategyTypeSchema, which turns out to be the argument PR aws#694 made -- and aws#713 reverted a day later. The CLI has removed CUSTOM twice on purpose. Offering the type without somewhere to put its extraction configuration is aws#241 ("select custom memory strategy, note there is no option to add prompts"); aws#266 removed it as a P0 to stop users picking an unsupported option, aws#694/aws#696 added it back with semanticOverride, and aws#713 reverted both as premature. aws#676 tracks doing it properly. The CDK keeping CUSTOM in its enum without a configuration field is the same hole, not a licence. So both forms are rejected again, now with an error that says why and points at aws#676. The one thing kept from the reverted commit: memory validation errors name the offending field, since issue.path was being dropped.
notgitika
added a commit
to notgitika/agentcore-cli
that referenced
this pull request
Aug 20, 2026
Reverts 87be86e. I added CUSTOM because the CDK schema already had it in MemoryStrategyTypeSchema, which turns out to be the argument PR aws#694 made -- and aws#713 reverted a day later. The CLI has removed CUSTOM twice on purpose. Offering the type without somewhere to put its extraction configuration is aws#241 ("select custom memory strategy, note there is no option to add prompts"); aws#266 removed it as a P0 to stop users picking an unsupported option, aws#694/aws#696 added it back with semanticOverride, and aws#713 reverted both as premature. aws#676 tracks doing it properly. The CDK keeping CUSTOM in its enum without a configuration field is the same hole, not a licence. So both forms are rejected again, now with an error that says why and points at aws#676. The one thing kept from the reverted commit: memory validation errors name the offending field, since issue.path was being dropped.
notgitika
added a commit
to notgitika/agentcore-cli
that referenced
this pull request
Aug 21, 2026
Reverts 87be86e. I added CUSTOM because the CDK schema already had it in MemoryStrategyTypeSchema, which turns out to be the argument PR aws#694 made -- and aws#713 reverted a day later. The CLI has removed CUSTOM twice on purpose. Offering the type without somewhere to put its extraction configuration is aws#241 ("select custom memory strategy, note there is no option to add prompts"); aws#266 removed it as a P0 to stop users picking an unsupported option, aws#694/aws#696 added it back with semanticOverride, and aws#713 reverted both as premature. aws#676 tracks doing it properly. The CDK keeping CUSTOM in its enum without a configuration field is the same hole, not a licence. So both forms are rejected again, now with an error that says why and points at aws#676. The one thing kept from the reverted commit: memory validation errors name the offending field, since issue.path was being dropped.
notgitika
added a commit
to notgitika/agentcore-cli
that referenced
this pull request
Aug 21, 2026
Reverts 87be86e. I added CUSTOM because the CDK schema already had it in MemoryStrategyTypeSchema, which turns out to be the argument PR aws#694 made -- and aws#713 reverted a day later. The CLI has removed CUSTOM twice on purpose. Offering the type without somewhere to put its extraction configuration is aws#241 ("select custom memory strategy, note there is no option to add prompts"); aws#266 removed it as a P0 to stop users picking an unsupported option, aws#694/aws#696 added it back with semanticOverride, and aws#713 reverted both as premature. aws#676 tracks doing it properly. The CDK keeping CUSTOM in its enum without a configuration field is the same hole, not a licence. So both forms are rejected again, now with an error that says why and points at aws#676. The one thing kept from the reverted commit: memory validation errors name the offending field, since issue.path was being dropped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add
semanticOverridesupport for SEMANTIC memory strategies, allowing users to customize extraction and consolidation behavior with custom prompts and model IDs.Changes
SemanticExtractionOverrideSchema,SemanticConsolidationOverrideSchema, andSemanticOverrideSchemawith Zod validation.refine()rejectssemanticOverrideon non-SEMANTIC strategy types with a clear error messageprimitives/index.ts,agentcore-project.tsfor new schema/type exportsagentcore.tsinterface withsemanticOverridefieldSchema Structure
{ "strategies": [{ "type": "SEMANTIC", "namespaces": ["/users/{actorId}/facts"], "semanticOverride": { "extraction": { "appendToPrompt": "Extract key facts about the user", "modelId": "anthropic.claude-3-sonnet-20240229-v1:0" }, "consolidation": { "appendToPrompt": "Consolidate user memories", "modelId": "anthropic.claude-3-haiku-20240307-v1:0" } } }] }TUI Screenshots
Validation — pass and fail:

agentcore.json with semanticOverride config:

Synthesized CloudFormation template with SemanticOverride:

All memory unit tests passing (vitest):

Service-Side Note
The CloudFormation resource
AWS::BedrockAgentCore::Memoryin us-east-1 does not yet includeSemanticOverridein its schema. The CLI schema validation and CDK template generation are correct — deployments with overrides will succeed once the service-side schema is updated. Backward compatibility (SEMANTIC without override) is confirmed working.Related Issue
Closes #678
Documentation PR
N/A — pending service-side schema availability
Type of Change
Testing
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsTest Coverage
Checklist
Dependent CDK PR: aws/agentcore-l3-cdk-constructs#120 (companion PR with addPropertyOverride implementation)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.