AgentCore Gateway sources
A Gateway source reaches one connector target of an Amazon Bedrock AgentCore Gateway. You use it to give your agent your company knowledge, the web, or a knowledge graph, through one governed endpoint. The Gateway keeps its inbound auth, its policies, and its logs. Stash turns each answer into files.
A Gateway source is query-driven: its folder is empty until the agent searches it. Each search writes its hits as files, and prints a short preview of each one.
The three connectors
Section titled “The three connectors”| Kind | Gateway tool | Each search writes |
|---|---|---|
gateway.bedrock-knowledge-bases | Retrieve | One file for each passage, named after its document: 2026-11-22__checkout-runbook-pdf.md. |
gateway.web-search | WebSearch | One file for each page that the results cite, at <host>/<path>.md. |
gateway.aws-context | AgenticRetrieve | One file for each search, at <date>/<query>.md. |
The source shows at gateway/CONNECTOR/NAME/. For example, [sources.runbooks] with
kind = "gateway.bedrock-knowledge-bases" is at
/tmp/ops-context/gateway/bedrock-knowledge-bases/runbooks/.
Knowledge bases
Section titled “Knowledge bases”A Bedrock knowledge base source searches your documents. It has no keys of its own: the Gateway target names the knowledge base and sets the number of results.
A search previews each passage by rank. The top 5 passages show about 1,200 characters, up to the next 10 show about 150, and the rest about 100. Each preview keeps the sentences that match the query best. The agent opens a file only when the preview lacks what it needs.
Web search
Section titled “Web search”A web search source searches the web. With fetch_pages = true, the default, Stash also
fetches each cited https page and writes it as Markdown. When a fetch fails, the file
holds the passages that the search returned.
The preview of each hit is its title, then the sentences of the result that match the query best. Passages from one page merge into one hit.
AWS Context
Section titled “AWS Context”An AWS Context source asks a knowledge graph a question in natural language. It needs
context_graph_id. Each search is one file with five parts:
# Agentic answer: the answer.# Retrieved Context: the summary of each node or edge that the answer used.# Citation: the citations of the answer.# Request: the arguments that the search sent.- After
---: the tool,partialwhen the service sends it, and the seconds it took.
The preview is the whole answer. The same query on the same day replaces the same file.
The _sources/NAME.md page tells the agent to ask one complete question for each
search.
Configure it
Section titled “Configure it”[sources.runbooks]kind = "gateway.bedrock-knowledge-bases"description = "Team runbooks and postmortems"gateway_url = "https://ops-gw.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"target = "runbooks-kb"auth = { sigv4 = {} }
[sources.web]kind = "gateway.web-search"gateway_url = "https://ops-gw.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"target = "web-search-tool"auth = { sigv4 = {} }
[sources.graph]kind = "gateway.aws-context"gateway_url = "https://ops-gw.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"target = "enterprise-graph"context_graph_id = "REPLACE-ME"auth = { sigv4 = {} }| Key | Default | What it does |
|---|---|---|
gateway_url | required | The Gateway URL. It must have a path, such as /mcp. |
target | required | The connector target. |
auth | none | sigv4, bearer (from env or file), or none. |
region | from the hostname | The SigV4 signing region. A custom hostname needs it. |
headers | {} | More headers for each request, each from env or file. |
protocol_version | 2025-11-25 | The MCP version that the client sends. |
fetch_pages | true | gateway.web-search only. |
context_graph_id | required | gateway.aws-context only. |
With no auth, a source sends no credential, and a Gateway with AWS_IAM or
CUSTOM_JWT inbound auth refuses each request. SigV4 needs
bedrock-agentcore:InvokeGateway. See
Gateway endpoint for each rule.
When a Gateway source starts, Stash lists the tools of its target. Each one is a schema
file under _tools/, and stash tool call calls it:
stash tool list ops --source graphThe tool that the source searches with, such as WebSearch, doesn’t show in the list.
Use stash search for it.
A memory through a Gateway
Section titled “A memory through a Gateway”A Gateway can also front an AgentCore Memory with its agentcore-memory connector. That
source is the agentcore-memory kind with an endpoint, not a Gateway kind. See
AgentCore Memory source.