Agentic retrieval
Agentic retrieval answers a natural-language question for you. The AWS Context retrieval agent searches the Agent context and follows relationships. It reads the business rules, metrics, and skills it finds, and reads knowledge base passages. When the question needs data, it queries your connected data sources. It then writes an answer with citations. Callers need context:AgenticRetrieveStream or context:AgenticRetrieve on the Agent context (see Authentication and identity for MCP). Stream examples for JavaScript and Java are in Consume the event stream. To give the agent guidance such as which sources to trust, what your terms mean, and what to cite, see Customize retrieval instructions.
Two operations take the same request and return the same answer, citations, and retrieved context. They differ in how the result arrives and where you can call them.
AgenticRetrieveStream
|
AgenticRetrieve
|
|
|---|---|---|
|
Response |
An event stream: progress events, the answer, and a final result |
One response when retrieval finishes |
|
Where to call it |
The AWS SDKs, the MCP tool |
The MCP tool |
|
Time limit |
The endpoint closes the stream after 300 seconds |
A 100-second retrieval budget |
|
Use it when |
The question can take a while, or you want to show progress |
The question is short, or you need an authorization URL for a third-party source (see Read the answer, citations, and retrieved context) |
For what happens when a limit is reached, see Step and time limits.
You control five things:
-
The Agent context.
-
The conversation (
messages). -
The maximum number of agent steps (
maxIterations). -
A
sessionIdthat groups traces. -
Whether the trace is kept (
analysisConfiguration.emitTrace, on by default; a trace is stored only when trace analysis is turned on for the Agent context and the other conditions in AWS Context agent traces are met).
AWS Context chooses the model, the searches the agent runs, traversal depth, ranking, the time budget, and the answer length. To control those, use search and traversal from your own agent.