Single-shot and agentic retrieval with Amazon Bedrock Managed Knowledge Base
Amazon Bedrock Managed Knowledge Base now adds single-shot Retrieval‑Augmented Generation (RAG) and retrieval‑only requests via AgenticRetrieveStream, letting developers choose between a one‑pass search‑and‑generate flow or a pure passage return. Single-shot RAG performs a single search and uses a foundation model to synthesize an answer, while retrieval‑only returns the matching documents for direct user inspection. The existing agentic retrieval mode still orchestrates multiple searches with a configurable iteration limit for complex, multi‑part queries, all through a single API.
⚡ Key Takeaways
- Single-shot RAG searches the knowledge base once and generates an answer with citations using a foundation model.
- Retrieval‑only mode (AgenticRetrieveStream) returns matching passages without generation, enabling users to view source text directly.
- Agentic retrieval plans and executes multiple searches up to a configured maxAgentIteration limit to handle multi‑part questions.
- All three modes are accessed through the same Bedrock Managed Knowledge Base API, eliminating custom orchestration code.
- Use single-shot RAG for simple lookups, retrieval‑only for source‑review scenarios, and agentic retrieval for complex, multi‑step queries.
Engineers can now match retrieval effort to request complexity without building separate pipelines, reducing latency and cost for simple lookups while preserving deep, evidence‑rich answers for intricate queries.
✅ Practical Steps
- Call the Bedrock Managed Knowledge Base API with the `singleShotRag` setting to get a generated answer for straightforward questions.
- Use the `AgenticRetrieveStream` mode to obtain raw passages when the application needs to display source documents.
- For multi‑part or comparison queries, invoke the API with default agentic retrieval settings and adjust `maxAgentIteration` as needed.
Want the full story? Read the original article.
Read on AWS ML Blog ↗