AgentVault

docs / rest

REST quickstart

Plain HTTPS and JSON. Every endpoint takes an API key as a bearer token.

Base URL https://api.useagentvault.com (or http://localhost:4200 when you run the API yourself). Lists return { data, next_cursor }; errors return { error, message, request_id }.

Write a memory

POST /v1/memories
curl https://api.useagentvault.com/v1/memories -H "Authorization: Bearer $AGENTVAULT_API_KEY" -H "Content-Type: application/json" \
  -d '{ "space_id": "spc_…", "content": "Globex prefers email over phone for incidents.", "subject": "customer:globex", "tags": ["customer"] }'

The response says what happened: created, merged (it repeated an existing memory) or superseded (it replaced an older version). Send an Idempotency-Key header to make retries safe.

POST /v1/search
curl https://api.useagentvault.com/v1/search -H "Authorization: Bearer $AGENTVAULT_API_KEY" -H "Content-Type: application/json" \
  -d '{ "query": "how does globex want to be contacted", "limit": 5, "weights": { "semantic": 0.7, "keyword": 0.2, "recency": 0.1 } }'
POST /v1/recall
curl https://api.useagentvault.com/v1/recall -H "Authorization: Bearer $AGENTVAULT_API_KEY" -H "Content-Type: application/json" -d '{ "query": "deploy schedule" }'

List, history and forget

GET / DELETE
# newest first; filter by space, writer, tags, status or time
curl "https://api.useagentvault.com/v1/memories?space_id=spc_…&agent=claude-code&status=all" -H "Authorization: Bearer $AGENTVAULT_API_KEY"

# one memory with every version and every writer
curl https://api.useagentvault.com/v1/memories/mem_… -H "Authorization: Bearer $AGENTVAULT_API_KEY"

# forget (history kept), or erase every version
curl -X DELETE "https://api.useagentvault.com/v1/memories/mem_…?hard=true" -H "Authorization: Bearer $AGENTVAULT_API_KEY"

Say who is writing

Either put source in the body or set headers once in your HTTP client: X-AgentVault-Agent, X-AgentVault-Model, X-AgentVault-Provider, X-AgentVault-App.