Skip to content

Give an agent memory

Every agent that connects to your network gets its own folder on the pad: inseam://{network}/pad/agents/{name}/. It may always read, write and delete there, whatever else you allowed. Anything it writes is searchable at once, by the agent and by you. That folder is the agent’s memory.

Terminal window
claude mcp add --transport http inseam https://app.inseam.io/mcp

The first call opens your browser for the approval. Leave search and read on; write is not needed for the agent’s own folder. Then:

Search my network for everything about the Q3 report, write a two-paragraph summary in your inseam folder as q3/summary.md, and tell me the address.

Claude calls hosts to learn its padFolder, search, read for the hits, and write for the summary. In a later conversation:

What did you note about the Q3 report last time?

Claude calls search or list on its folder and read on the note. Nothing was configured: the folder existed from the first call.

A script without a browser gets its token with a device code, then uses the same REST calls. Once per machine:

Terminal window
INSEAM="https://app.inseam.io"
CLIENT_ID="https://example.com/inseam-client.json" # a URL that serves your client metadata, or an id from /oauth/register
# 1. Ask for a code.
RESP=$(curl -s -X POST "$INSEAM/oauth/device" -d "client_id=$CLIENT_ID" -d "scope=search read")
echo "$RESP" | jq -r '"Open \(.verification_uri) and type \(.user_code)"'
DEVICE_CODE=$(echo "$RESP" | jq -r .device_code)
# 2. Poll until approved.
until TOKEN=$(curl -s -X POST "$INSEAM/oauth/token" \
-d "grant_type=urn:ietf:params:oauth:grant-type:device_code" \
-d "device_code=$DEVICE_CODE" -d "client_id=$CLIENT_ID" | jq -er .access_token); do
sleep 5
done
echo "$TOKEN" > ~/.inseam-token

The client metadata document is a small JSON file at the CLIENT_ID URL:

{ "client_id": "https://example.com/inseam-client.json", "client_name": "Nightly summariser", "redirect_uris": [] }

Then the script reads and writes its folder like any other address. The folder’s name is the client id, so list it to find your own notes:

Terminal window
TOKEN=$(cat ~/.inseam-token)
PAD=$(curl -s "$INSEAM/v1/hosts" -H "Authorization: Bearer $TOKEN" | jq -r '.hosts[] | select(.id == "pad") | .id')
# Write a note.
printf '# Run %s\n\nSummarised 12 documents.\n' "$(date -u +%FT%TZ)" | \
curl -s -X PUT "$INSEAM/v1/o/pad/agents/$(printf %s "$CLIENT_ID" | jq -sRr @uri)/runs/$(date -u +%F).md" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: text/markdown" --data-binary @- | jq .entry.address
# Read the last run.
curl -s "$INSEAM/v1/list?prefix=pad/agents/$(printf %s "$CLIENT_ID" | jq -sRr @uri)/runs/" \
-H "Authorization: Bearer $TOKEN" | jq -r '.entries[-1].address'

The access token lasts as long as you chose at the approval. The same call that returned it also returned a refresh_token; exchange it with grant_type=refresh_token before the access token expires, or ask for a new device code.

Open your network page: the agent is listed with its permissions, when it last ran and when its access ends. Its folder is under pad/agents/ in your search results like any other, so you can read what your agent remembers, and delete it.