BedrockAgentRuntimeClient.agentic_retrieve_stream
rboto-bedrock-agent-runtime==0.4.0 · Service index · Types
Model summary (excerpt): Retrieves information from one or more knowledge bases using an agentic approach. Agentic retrieval uses a foundation model to intelligently decompose complex queries into sub-queries and iteratively retrieve relevant information from your knowledge bases. This approach improves retrieval accuracy for complex, multi-step questions that a single retrieval pass might not fully address. The...
Install and imports
from rboto import BedrockAgentRuntimeClient
from collections.abc import Sequence
from rboto_bedrock_agent_runtime.types import (
AgenticRetrieveConfiguration,
AgenticRetrieveInstructionConfiguration,
AgenticRetrieveMemoryConfiguration,
AgenticRetrieveMessage,
AgenticRetrievePolicyConfiguration,
AgenticRetrieveStreamOutput,
AgenticRetriever,
UserContext,
)
Signature
async def agentic_retrieve_stream(
*,
messages: Sequence[AgenticRetrieveMessage],
retrievers: Sequence[AgenticRetriever],
agentic_retrieve_configuration: AgenticRetrieveConfiguration,
policy_configuration: AgenticRetrievePolicyConfiguration | None = None,
next_token: str | None = None,
user_context: UserContext | None = None,
memory_configuration: AgenticRetrieveMemoryConfiguration | None = None,
retrieval_instruction_configuration: AgenticRetrieveInstructionConfiguration | None = None,
generate_response: bool | None = None,
) -> AgenticRetrieveStreamOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
messages |
Yes | The list of messages for the agentic retrieval conversation. |
retrievers |
Yes | The list of retrievers to use for agentic retrieval. |
agentic_retrieve_configuration |
Yes | Configuration settings for the agentic retrieval operation. |
policy_configuration |
No | Policy configuration for guardrails and content filtering. |
next_token |
No | Opaque continuation token for paginated results. |
user_context |
No | Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access. |
memory_configuration |
No | The configuration for using an Amazon Bedrock AgentCore Memory resource with this retrieval. |
retrieval_instruction_configuration |
No | A retrieval instruction to apply to this request. |
generate_response |
No | Whether to generate a response based on the retrieved results. |
Output
AgenticRetrieveStreamOutput.
Typed response mapping, accessed as response["field"].
| Field | Type | Presence | References |
|---|---|---|---|
stream |
AsyncIterator[AgenticRetrieveStreamResponseOutput] |
Always present | AgenticRetrieveStreamResponseOutput |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
AgenticRetrieveConfiguration, AgenticRetrieveInstructionConfiguration, AgenticRetrieveMemoryConfiguration, AgenticRetrieveMessage, AgenticRetrievePolicyConfiguration, AgenticRetrieveStreamOutput, AgenticRetriever, UserContext
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
Output streams: AgenticRetrieveStreamOutput.
Consume with async for. Do not reuse a consumed stream.
Errors
Import from rboto_bedrock_agent_runtime.exceptions:
AccessDeniedError, BadGatewayError, ConflictError, DependencyFailedError, InternalServerError, ResourceNotFoundError, ServiceQuotaExceededError, ThrottlingError, ValidationError.
Stream decoding may also raise the linked modeled event errors.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.