Skip to content

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.

  • 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 = 1
mount_point = "/tmp/ops-context"

The mount point is an absolute path. If the folder exists, it must be empty.

KindUse it forHydrationSearchToolsWrite-back
agentcore-memoryLong-term memory in AgentCore Memoryyesyesyes
gateway.bedrock-knowledge-basesA Bedrock knowledge base through a Gatewayyesyes
gateway.web-searchThe web through a Gatewayyesyes
gateway.aws-contextAn AWS Context knowledge graph through a Gatewayyesyes
mcpThe tools of any MCP serveryes
pluginAny other store, through a plugin programyesyesyes

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 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.

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 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.

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 with the credentials that its sources need:

Terminal window
AWS_PROFILE=ops AWS_REGION=us-east-1 stash create ops --config stash.toml
stash status ops

create 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-context
Sources
incidents (agentcore-memory): started
runbooks (gateway.bedrock-knowledge-bases): started
ticketing (mcp): started

health: 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:

Terminal window
cat /tmp/ops-context/_sources/*.md
stash tool list ops

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:

Terminal window
stash update ops --config stash.toml
# Typical output:
# mount ops:
# + web added
# ~ runbooks changed: its files stay
# mount ops is updated

update 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.