Skip to content

feat: add semantic search toggle for gateways#533

Merged
tejaskash merged 5 commits intoaws:mainfrom
aidandaly24:feat/enable-semantic-search
Mar 11, 2026
Merged

feat: add semantic search toggle for gateways#533
tejaskash merged 5 commits intoaws:mainfrom
aidandaly24:feat/enable-semantic-search

Conversation

@aidandaly24
Copy link
Contributor

@aidandaly24 aidandaly24 commented Mar 10, 2026

Description

Adds semantic search support for gateways. When enabled (the default), the AgentCore service indexes tool descriptions across all gateway targets, providing agents with a built-in search tool for natural language tool discovery. This is especially useful when a gateway has many targets with dozens of tools each.

Changes:

  • Schema: Add enableSemanticSearch boolean field (default true) to AgentCoreGatewaySchema
  • TUI: Add "Advanced Configuration" step to the gateway creation wizard with a toggleable checkbox ([✓] Semantic Search Enabled). Defaults to checked. Space toggles, Enter confirms.
  • CLI flag: Add --no-semantic-search option to agentcore add gateway for non-interactive usage
  • Hook enhancement: Add initialSelectedIds support to useMultiSelectNavigation so toggle lists can start with pre-selected items
  • Navigation fix: Replace static AUTHORIZER_NEXT_STEP map with dynamic routing that correctly handles the include-targets step when unassigned targets exist

Companion CDK PR: https://github.com/aws/agentcore-l3-cdk-constructs/pull/75

Screenshot 2026-03-10 at 5 19 47 PM Screenshot 2026-03-10 at 5 19 57 PM

Related Issue

Closes #

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

New tests added:

  • Schema tests (4): default true when omitted, explicit true/false accepted, non-boolean rejected
  • useMultiSelectNavigation tests (3): initialSelectedIds pre-selects items, toggling off works, reset() restores initial selections

Manual verification:

  • Ran agentcore add gateway TUI flow end-to-end, confirmed advanced config pane renders correctly with toggle and confirm screen shows semantic search status
  • Tested --no-semantic-search CLI flag writes enableSemanticSearch: false to mcp.json
  • Existing mcp.json files without the field parse with default true (backward compatible)

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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

Add enableSemanticSearch boolean (default true) to AgentCoreGatewaySchema.
When enabled, the service indexes tool descriptions for natural language
discovery. Update LLM-compacted types and add schema validation tests.
Allow callers to specify pre-selected items and ensure reset() restores
initial selections instead of clearing to empty set.
… wizard

Add 'advanced-config' step to the gateway creation TUI wizard with a
toggleable checkbox for semantic search (enabled by default). Replace
static AUTHORIZER_NEXT_STEP map with dynamic routing to fix navigation
when unassigned targets exist.
Wire enableSemanticSearch through GatewayPrimitive, CLI option types,
and the useCreateGateway hook so both TUI and CLI paths persist the
setting to mcp.json.
@aidandaly24 aidandaly24 requested a review from a team March 10, 2026 21:15
@github-actions github-actions bot added the size/m PR size: M label Mar 10, 2026
notgitika
notgitika previously approved these changes Mar 11, 2026
Copy link
Contributor

@notgitika notgitika left a comment

Choose a reason for hiding this comment

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

left some nits but otherwise this looks great to me!

Rename noSemanticSearch to enableSemanticSearch in primitive options
and hoist initialSelectedIds array to module-level constant to avoid
new reference on every render.
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Mar 11, 2026
@tejaskash tejaskash merged commit 8d35d7f into aws:main Mar 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants