Persistent, semantic memory for AI agents. Store memories with types and metadata, then retrieve them with semantic search or direct lookup.
Base URL: https://api.agenttool.dev ยท All endpoints require Authorization: Bearer YOUR_API_KEY
Store a new memory. Embeddings are generated automatically for semantic search.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| type | string | required | One of: episodic, semantic, procedural, working |
| content | string | required | The memory text. 1โ100,000 characters. |
| key | string | null | optional | Namespace key for grouping memories (e.g. "user-prefs"). |
| agent_id | string | null | optional | ID of the agent creating this memory. |
| metadata | object | optional | Arbitrary key-value pairs for filtering and context. |
| importance | number | optional | 0.0โ1.0, default 0.5. Higher = more important in search ranking. |
| ttl_seconds | integer | null | optional | Auto-delete after N seconds. null = no expiry. |
curl -X POST https://api.agenttool.dev/v1/memories \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "semantic",
"content": "User prefers concise replies. Timezone: UTC+8.",
"key": "user-prefs",
"agent_id": "agent-42",
"metadata": {"source": "onboarding"},
"importance": 0.8
}'
await at.memory.store("User prefers concise replies", { type: "semantic", key: "user-prefs", agentId: "agent-42", importance: 0.8 })
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-03-09T12:00:00Z"
}
Returned when type doesn't match the allowed pattern or content is empty. Check that type is one of: episodic, semantic, procedural, working.
Semantic search across stored memories. Returns results ranked by similarity score. No exact keyword matching needed โ the API understands meaning.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| query | string | required | Natural language query. Minimum 1 character. |
| type | string | null | optional | Filter by memory type. |
| agent_id | string | null | optional | Filter to a specific agent's memories. |
| limit | integer | optional | Max results, 1โ100. Default: 10. |
| min_score | number | optional | Minimum similarity score, 0.0โ1.0. Default: 0. |
curl -X POST https://api.agenttool.dev/v1/memories/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "how does the user like to communicate?",
"limit": 5,
"min_score": 0.7
}'
const results = await at.memory.search("communication style", { limit: 5, minScore: 0.7 })
[
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "semantic",
"key": "user-prefs",
"content": "User prefers concise replies. Timezone: UTC+8.",
"agent_id": "agent-42",
"metadata": { "source": "onboarding" },
"importance": 0.8,
"created_at": "2026-03-09T12:00:00Z",
"accessed_at": "2026-03-09T14:30:00Z",
"score": 0.97
}
]
Retrieve a single memory by its UUID. Updates the accessed_at timestamp.
| Field | Type | Required | Description |
|---|---|---|---|
| memory_id | uuid | required | The memory's UUID, returned from create or search. |
curl https://api.agenttool.dev/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \ -H "Authorization: Bearer YOUR_API_KEY"
const mem = await at.memory.get("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "semantic",
"key": "user-prefs",
"content": "User prefers concise replies. Timezone: UTC+8.",
"agent_id": "agent-42",
"metadata": { "source": "onboarding" },
"importance": 0.8,
"created_at": "2026-03-09T12:00:00Z",
"accessed_at": "2026-03-09T15:00:00Z"
}
No memory with that ID exists. Check the UUID โ it's returned from POST /v1/memories or search results.
Retrieve all memories with a given key. Useful for loading a namespace of related memories.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| key | string | required | The namespace key to look up. |
| agent_id | string | optional | Filter by agent ID within the key. |
curl "https://api.agenttool.dev/v1/memories?key=user-prefs&agent_id=agent-42" \ -H "Authorization: Bearer YOUR_API_KEY"
const mems = await at.memory.list({ key: "user-prefs", agentId: "agent-42" })
[
{
"id": "a1b2c3d4-...",
"type": "semantic",
"key": "user-prefs",
"content": "User prefers concise replies...",
"agent_id": "agent-42",
"metadata": {},
"importance": 0.5,
"created_at": "2026-03-09T12:00:00Z",
"accessed_at": null
}
]
Delete a single memory by its UUID. Permanent โ cannot be undone.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| memory_id | uuid | required | The memory's UUID. |
curl -X DELETE https://api.agenttool.dev/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \ -H "Authorization: Bearer YOUR_API_KEY"
await at.memory.delete("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
{ "deleted": 1 }
Delete all memories with a given key. Use with caution โ this is a bulk delete.
๐ Bearer token required| Field | Type | Required | Description |
|---|---|---|---|
| key | string | required | All memories with this key will be permanently deleted. |
curl -X DELETE "https://api.agenttool.dev/v1/memories?key=user-prefs" \ -H "Authorization: Bearer YOUR_API_KEY"
await at.memory.deleteByKey("user-prefs")
{ "deleted": 7 }
Get usage statistics for the current project. Shows reads, writes, searches, total memories, and current plan.
๐ Bearer token requiredcurl https://api.agenttool.dev/v1/usage \ -H "Authorization: Bearer YOUR_API_KEY"
const usage = await at.memory.usage()
{
"writes": 1247,
"reads": 3891,
"searches": 562,
"total_memories": 842,
"plan": "builder"
}
Memories are categorized by cognitive type, inspired by human memory systems:
| Type | Use for | Example |
|---|---|---|
episodic |
Events and experiences | "User asked about pricing on March 9th" |
semantic |
Facts and knowledge | "User's timezone is UTC+8" |
procedural |
How-to knowledge | "To deploy, run `npm run deploy`" |
working |
Temporary/session context | "Currently debugging the auth flow" |
Tip: Use working with ttl_seconds for context that should auto-expire when a session ends.
Missing or invalid API key. Ensure Authorization: Bearer YOUR_API_KEY is set.
Memory ID doesn't exist or belongs to a different project.
Request body is invalid. The response includes a detail array with the exact field and error message. Common causes: missing type or content, invalid type value, importance outside 0โ1 range.
You've exceeded your plan's request limit. Upgrade your plan or wait until the next billing cycle.