Connect sources
You give your agent context by adding sources to a mount. Each source is one
[sources.NAME] table in the mount config. Stash shows it as a folder at
KIND/NAME/ below the mount point, and writes a page for it at _sources/NAME.md.
Any supported MCP server or plugin works as a source. The first-party sources, AgentCore Memory and the AgentCore Gateway connectors, add opinionated hydration, previews, and write-back. See Overview.
This guide adds the sources of an ops agent, one at a time: past incidents from AgentCore Memory, runbooks from a Bedrock knowledge base, and a ticketing MCP server.
Before you start
Section titled “Before you start”- Install Stash, as the quickstart shows.
- Have AWS credentials for each AWS source. The daemon takes them from the shell that starts it.
- Write the mount config to
stash.toml. Start it with the mount point:
version = 1mount_point = "/tmp/ops-context"The mount point is an absolute path. If the folder exists, it must be empty.
Choose a kind
Section titled “Choose a kind”| Kind | Use it for | Hydration | Search | Tools | Write-back |
|---|---|---|---|---|---|
agentcore-memory | Long-term memory in AgentCore Memory | yes | yes | yes | |
gateway.bedrock-knowledge-bases | A Bedrock knowledge base through a Gateway | yes | yes | ||
gateway.web-search | The web through a Gateway | yes | yes | ||
gateway.aws-context | An AWS Context knowledge graph through a Gateway | yes | yes | ||
mcp | The tools of any MCP server | yes | |||
plugin | Any other store, through a plugin program | yes | yes | yes |
A mount holds up to 25 sources. Each mount also has a local store for notes, with
no config. A source can’t be named local.
Add AgentCore Memory
Section titled “Add AgentCore Memory”Add the memory that holds past incidents:
[sources.incidents]kind = "agentcore-memory"description = "Summaries of past incidents"arn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:memory/ops-memory-0123456789"auth = { sigv4 = {} }namespaces = ["/summaries/*"]The region comes from the ARN. auth = { sigv4 = {} } signs with the default AWS
credential chain of the host. Name a profile with auth = { sigv4 = { profile = "ops" } }. A source with no auth sends no credential, and the Memory API refuses it.
namespaces limits what the mount can read, up to 5 entries. It defaults to ["/*"].
The credentials need bedrock-agentcore:ListMemoryRecords, GetMemoryRecord, and
RetrieveMemoryRecords. To send sessions back, see
Feedback loops.
Add a Bedrock knowledge base
Section titled “Add a Bedrock knowledge base”A knowledge base reaches the mount through an AgentCore Gateway target:
[sources.runbooks]kind = "gateway.bedrock-knowledge-bases"description = "Service runbooks"gateway_url = "https://ops-gateway-abc123.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"target = "runbooks-kb"auth = { sigv4 = {} }gateway_url must have a path. An AgentCore Gateway serves MCP at /mcp. The
target names the knowledge base and sets the number of results. With SigV4, the
credentials need bedrock-agentcore:InvokeGateway.
Web search and AWS Context use the same Gateway keys:
[sources.web]kind = "gateway.web-search"gateway_url = "https://ops-gateway-abc123.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-gateway-abc123.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"target = "context-connector"auth = { sigv4 = {} }context_graph_id = "REPLACE-ME"gateway.web-search fetches each page that a hit cites and writes it as markdown.
Set fetch_pages = false to keep only the passages.
Add an MCP server
Section titled “Add an MCP server”Add a remote server with url, or a local server with command:
[sources.ticketing]kind = "mcp"description = "Incident tickets"url = "https://tickets.example.com/mcp"auth = { bearer = { env = "TICKETING_MCP_TOKEN" } }
[sources.git]kind = "mcp"description = "The git history of the checkout service"command = "uvx"args = ["mcp-server-git", "--repository", "/home/me/checkout"]Set exactly one of url and command. Copy command and args unchanged from
the server’s README.
A local server gets only a small part of the daemon’s environment, such as PATH
and HOME. Pass each other variable in env:
env = { GITHUB_PERSONAL_ACCESS_TOKEN = { file = "/home/me/.config/stash/gh-token" } }An mcp source shows tools only. Each tool’s schema is a file at
mcp/NAME/_tools/TOOL.json.
Add a plugin
Section titled “Add a plugin”A plugin reads a store that Stash has no kind for:
[sources.notes]kind = "plugin"description = "The team's Markdown notes"plugin = "notes"command = ["python3", "/home/me/plugins/notes.py"]settings = { root = "/home/me/notes" }With no command, Stash runs stash-source-<plugin> from the daemon’s PATH. To
write one, see Write a plugin.
Create the mount and check it
Section titled “Create the mount and check it”Create the mount with the credentials that its sources need:
AWS_PROFILE=ops AWS_REGION=us-east-1 stash create ops --config stash.tomlstash status opscreate returns before the mount is ready. Run stash status ops until it shows
state: ready. The output looks like this, shortened:
Mount name: ops state: ready health: ok mount_point: /tmp/ops-contextSources incidents (agentcore-memory): started runbooks (gateway.bedrock-knowledge-bases): started ticketing (mcp): startedhealth: degraded names each source that didn’t start. The mount still serves the
others. Read the page of each source to see what it holds and how to search it:
cat /tmp/ops-context/_sources/*.mdstash tool list opsChange a source
Section titled “Change a source”create keeps a copy of the config, so a later edit of stash.toml doesn’t
change the mount. To add, change, or remove a source, edit stash.toml and run
stash update:
stash update ops --config stash.toml
# Typical output:# mount ops:# + web added# ~ runbooks changed: its files stay# mount ops is updatedupdate restarts only this mount, and prints each change with what it removes. A
removed source takes its files with it. The notes stay. update can’t change
mount_point or cache_max_bytes: for those, delete the mount with --remove-data and
create it again.
Next steps
Section titled “Next steps”- Attachment modes: choose how the agent reads the mount.
- Supported harnesses and frameworks: connect Claude Code, Codex, Kiro, or Strands Agents.
- AgentCore Memory source, Gateway sources, MCP source, and Plugin source: each key of each kind.
- Configuration reference: the whole config.