Connect your agent to SPM memory
After this page you can save and recall a fact through the Hosted Provider Proxy at https://api.spmos.ai/v1.
Prerequisite: Create an SPM API key with memory:read, memory:write, and gateway:invoke.
1. Create a key
Sign in at https://app.spmos.ai, open API Keys, and create a key. It is shown once.
Add memory:delete only if the agent should delete memories. For one key across several end users, add memory:partition and send a stable user_partition value, which separates users' memories.
2. Connect your agent
In the console, open Settings → Providers, add your provider and models, then point your client at SPM:
from openai import OpenAI
client = OpenAI(
base_url="https://api.spmos.ai/v1",
api_key="spm_live_...",
)
response = client.chat.completions.create(
model="your-configured-model",
messages=[{"role": "user", "content": "Remember that our deploy window is Friday."}],
)
print(response.choices[0].message.content)
The console pre-selects gateway:invoke, the permission to send model requests through SPM.
3. Save a fact
Save something with remember, using a fresh source_id and idempotency_key:
{
"text": "The docs-smoke project deployment window is Friday at 16:00 UTC.",
"source_id": "docs-smoke-20261020-01",
"idempotency_key": "docs-smoke-20261020-01-save"
}
Call status with {"source_ids":["docs-smoke-20261020-01"]} until that source is searchable. Then call recall with {"question":"When is the docs-smoke project deployment window?"} and check the evidence against what you saved. Pass the returned read_token values, which identify saved text for reading, to read to see the original text. Delete the test source afterwards.
4. Run the conformance check
The conformance probe does the same round trip, checks the verdicts, and cleans up:
curl -fsSLO https://docs.spmos.ai/assets/mcp-conformance.py
export SPM_API_KEY=spm_live_...
python3 mcp-conformance.py
It exits non-zero on a failed check, so it also works as a CI smoke test.
Understand token savings
You see token savings only when older exchanges are stored as sources and left out of a later prompt. Short or new conversations can correctly show none.
Verify
Run the conformance check:
curl -fsSLO https://docs.spmos.ai/assets/mcp-conformance.py
export SPM_API_KEY=spm_live_...
python3 mcp-conformance.py
Expected: the command exits with status 0 after the round trip, verdict checks, and cleanup pass.