AWS shows how to deploy agentic search with a single CDK command: 4 stacks and 7 metric layers
Standard RAG searches once in a single index and loses part of the answer when the data sits in two databases. AWS has published a CDK template (infrastructure defined as code in Python): one command deploys 4 stacks, groups of resources ranging from knowledge bases to dashboards. The agent chooses the base itself and searches again when data is missing, while 7 layers of metrics in CloudWatch show the agent's path. No vector store needs to be provisioned.
AI-processed from AWS Machine Learning Blog; edited by Hamidun News
Standard RAG is simple: the question becomes a vector, the nearest text chunks are pulled from a single index, and the model writes an answer. But if the answer lies in two document sets at once, say a financial report and weather summaries, the search returns only half of what is needed, and the model answers smoothly and confidently anyway. AWS has published a walkthrough of how to solve this with "agentic" search on the managed Amazon Bedrock Knowledge Base.
Everything deploys with one command through CDK (AWS Cloud Development Kit, where cloud infrastructure is described in ordinary Python code). The application contains 4 stacks, that is, four related groups of resources: knowledge bases, the Gateway, the agent itself, and dashboards. The "7 metric layers" refer to seven kinds of data about the agent's operation: from document ingestion to token consumption and answer quality scores.
What changes compared with standard RAG
In the agentic scheme, a reasoning agent is built into the search loop. It decides whether to search, which knowledge base to use, and whether to go back for more before writing the answer. Picture a company assistant: for a question about revenue it goes to the financial archive, for a question about tornadoes to the meteorological one, and if the first result is insufficient, it goes back for a second.
Technically, three components do this. The Managed Knowledge Base (type MANAGED) parses documents itself, splits them into chunks, computes embeddings, and indexes them. You do not need to create an OpenSearch Serverless collection or pay for OCU capacity. AgentCore Gateway publishes each base as a separate MCP tool. The AgenticRetrieveStream API inside the base breaks the question into subqueries, searches iteratively, reranks the results, and returns an answer with citations.
An important limitation: agentic search and the Gateway integration work only on a managed base. If you have your own base with a self-managed vector store, for example because of data residency requirements or fine-tuned index settings, this path is closed to you.
Four stacks and one command
The application consists of four stacks: the knowledge bases with an S3 bucket, the Gateway, the agent built on Strands in AgentCore Runtime, and the dashboards. You do not have to set the deployment order manually. The Gateway receives references to both bases, the agent receives the Gateway's address, and the dashboards receive the identifiers of the bases, the Gateway, and the runtime. There are seven such values passed between stacks. In CDK it is enough to pass an object into a constructor, and the dependency and its export appear automatically. In raw CloudFormation these would be manual exports and a deployment script that drift apart at the first rename.
The command cdk deploy --all brings up everything. The longest step is building the agent image in CodeBuild for ARM64, about 8–10 minutes, and no local Docker is needed. Settings are collected in config.py: the project prefix, the region (us-west-2 by default), the embedding type, and the agent model, by default Claude Haiku 4.5. Changing PROJECT_NAME creates an independent copy of the solution, so two deployments can coexist in one account.
Two bases are intentional. When the agent has two named tools, the choice of source is visible in the span tree, and search quality metrics are not blended into one average across unrelated domains. If both corpora were dumped into a single index, the routing decision would be hidden inside the ranking.
Observability as half the project
The agent takes a different path each time, and without telemetry you cannot understand either the path or the answer quality. That is why roughly half of the resources exist for observability: two CloudWatch dashboards and seven data layers. These cover the knowledge base's own metrics, document ingestion, agentic search quality, Gateway and MCP metrics, the OTEL span tree, token consumption, and quality evaluations. Layers 1, 4, and 5 are collected automatically. Layers 3, 6, and 7 are published by the demo notebook as custom metrics, so in production you will have to wire them up yourself.
Quality evaluation runs in two modes: on demand and continuously on a sample of traffic. The sample rate defaults to 100%. That is convenient for a demo, but under real load it will affect costs, so it is worth lowering: each check calls a model. Evaluations of source faithfulness and correctness help catch answers drifting away from the original source before users do. For spans, you need to enable CloudWatch Transaction Search.
What to take away in practice
The data in the example is for learning: a synthetic 10-K for the fictional company Octank at about 198 KB and a public US Congress report on tornadoes at about 560 KB. Two small documents do not tell you anything about latency, cost, or accuracy at enterprise volumes, and AWS does not publish real figures.
The architectural decisions are the useful part. Do not provision a vector database without special requirements. Build a separate tool for each source so routing is visible. Build metrics and quality evaluation into the infrastructure code from day one, not after the first incident.
- Nov 21, 2026AG-UI 1.0 gives AI agents a common language for talking to apps: 31 event types
- Nov 21, 2026OpenAI launches ChatGPT Wallet: agents buy without ever seeing your card number
- Nov 21, 2026US Advertisers Spent $70.7 Million on ChatGPT Ads in October, Up 127% From April
- Nov 21, 2026ONNX Runtime vanishes from GitHub: Microsoft hides repositories after package hack
Key Questions Answered
What changes compared with standard RAG?
In the agentic scheme, a reasoning agent is built into the search loop. It decides whether to search, which knowledge base to use, and whether to go back for more before writing the answer. Picture a company assistant: for a question about revenue it goes to the financial archive, for a question about tornadoes to the meteorological one, and if the first result is insufficient, it goes back for a second. Technically, three components do this.
What are the key details on Four stacks and one command?
The application consists of four stacks: the knowledge bases with an S3 bucket, the Gateway, the agent built on Strands in AgentCore Runtime, and the dashboards. You do not have to set the deployment order manually. The Gateway receives references to both bases, the agent receives the Gateway's address, and the dashboards receive the identifiers of the bases, the Gateway, and the runtime. There are seven such values passed between stacks.
What are the key details on Observability as half the project?
The agent takes a different path each time, and without telemetry you cannot understand either the path or the answer quality. That is why roughly half of the resources exist for observability: two CloudWatch dashboards and seven data layers. These cover the knowledge base's own metrics, document ingestion, agentic search quality, Gateway and MCP metrics, the OTEL span tree, token consumption, and quality evaluations. Layers 1, 4, and 5 are collected automatically.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.