View a markdown version of this page

Retrieving context - AWS Context

Retrieving context

AWS Context is the service that builds an Agent context from your data. After you build one, your agents and applications retrieve from it in three ways, and you can combine them in one application:

  • Search and traversal are the low-level primitives. Use them when your own agent plans the retrieval: search finds entry points, and traversal follows the relationships around them.

  • Agentic retrieval answers a natural-language question for you. Use it when a question needs more than one search or hop, or needs data from a source.

  • Read-only SQL runs one query you write yourself over AWS Glue Data Catalog tables, with ExecuteSql. For more information, see Query tables with ExecuteSql.

You can call these operations through the AWS SDKs, or through the AWS Context Model Context Protocol (MCP) server, which exposes them as tools for any MCP client. You can also try agentic retrieval in the console with Chat with context.

AWS Context authorizes every request for the identity that signs it. That identity needs the AWS Identity and Access Management (IAM) action for the operation on the Agent context (context:SearchAgentContext, context:TraverseAgentContext, context:AgenticRetrieveStream, context:AgenticRetrieve, or context:ExecuteSql), and sees only the entities it is allowed to see. For a policy that grants these actions and the Agent context ARN format, see Authentication and identity for MCP. For how access is governed, see Governing access.

The Agent context must be active, and its connections must have finished their first ingestion, before it can serve requests. To check its connection status, see Check connection status. Every request passes the Agent context’s ID in the agentContextId parameter. The console shows the ID on the Agent context’s Integration tab, and ListAgentContexts returns it. To trace retrieval requests, see Monitoring AWS Context with traces.