AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Agentic retrieval with LangChain and Amazon Bedrock Knowledge Bases

Collected Oct 5, 2026

Amazon published a walkthrough of agentic retrieval on Amazon Bedrock Managed Knowledge Bases, demonstrated through a Retrieval Augmented Generation application built with LangChain and an Amazon S3 data source. The langchain-aws package exposes both the standard and agentic paths. Retrieval Augmented Generation is a pattern where a system fetches relevant document chunks and passes them to a model to ground its answer.

The two paths map to two APIs. Retrieve runs one hybrid search and returns scored chunks; AgenticRetrieveStream runs a planning loop that breaks a question into sub-queries, runs them, judges whether it has enough evidence, and searches again if it doesn't, streaming steps back as trace events. Agentic retrieval plans the retrieval rather than performing a single search.

The walkthrough uses a six-intent question comparing two services across three dimensions. With the standard retriever returning five chunks, four of six sub-intents were covered; at ten chunks all six were covered, with two sub-intents covered twice and one chunk carrying none. The stated limitation is structural: one vector cannot represent six intents, and nothing in the standard path asks whether the returned evidence is sufficient.

Requirements and specifics: Python 3.12 or later, boto3 1.43.32 or later because agentic_retrieve_stream did not exist before that version, langchain-aws 1.6.3 or later, langchain 1.0 or later, and a Region where managed knowledge bases and agentic retrieval are available; the example uses us-east-1. Managed knowledge bases use managedSearchConfiguration rather than the older vectorSearchConfiguration. Permissions include bedrock:GetDocumentContent, needed when a FullDocumentExpansion step pulls a whole document. maxAgentIteration accepts two through ten and defaults to five; below four the planner stops decomposing entirely, and results carry no typed relevance score field. AWS evaluated agentic retrieval on MuSiQue, a public multi-hop benchmark, reporting improved recall over single-shot retrieval, with the largest gains on the hardest questions and single-hop gains under five points.

Why it matters: Teams running RAG on managed knowledge bases can choose per query between a cheaper single-call retriever and a planning loop that costs more and takes longer, and agentic retrieval works only against managed knowledge bases. Guardrails are supported on both paths, but agentic retrieval supports BLOCK mode only, so teams relying on MASK mode have a reason to stay on the Retrieve API.

Read at AWS Machine Learning Blog

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Build a Retrieval Augmented Generation (RAG) application on Amazon Bedrock Managed Knowledge Base with LangChain, and see how agentic retrieval handles the multi-part questions that single-shot retrieval answers poorly. Run the same query through both paths, read the trace events, and compare what each retrieval path costs.