API reference for AgentMemry. Memory that understands.
# Python
pip install agentmemry
# JavaScript
npm install agentmemry
from agentmemory import AgentMemory
mem = AgentMemory("am_your_api_key")
# Store a memory
mem.store("User loves Thai food and is vegetarian")
# Search by meaning
results = mem.search("restaurant recommendations")
# → Returns the Thai food memory!
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer am_your_api_key
Get your API key at agentmemry.ai
Store a memory with automatic vector embedding for semantic search.
| Parameter | Type | Description |
|---|---|---|
| content | string | The memory to store (required) |
| key | string | Custom key (optional, auto-generated if omitted) |
| namespace | string | Namespace for organization (default: "default") |
| metadata | object | Custom metadata (optional) |
| ttl | number | Time-to-live in seconds (optional) |
curl -X POST https://api.agentmemry.ai/v1/store \
-H "Authorization: Bearer am_your_key" \
-H "Content-Type: application/json" \
-d '{"content": "User prefers dark mode"}'
Search memories by meaning, not just keywords. Uses vector embeddings.
| Parameter | Type | Description |
|---|---|---|
| query | string | What you're looking for (required) |
| namespace | string | Namespace to search (default: "default") |
| limit | number | Max results (default: 10, max: 50) |
| threshold | number | Min similarity score 0-1 (default: 0) |
curl -X POST https://api.agentmemry.ai/v1/search \
-H "Authorization: Bearer am_your_key" \
-H "Content-Type: application/json" \
-d '{"query": "what are their UI preferences?"}'
Retrieve a specific memory by its key.
curl https://api.agentmemry.ai/v1/recall/user_preferences \
-H "Authorization: Bearer am_your_key"
List all memories in a namespace.
| Parameter | Type | Description |
|---|---|---|
| namespace | string | Namespace (default: "default") |
| limit | number | Max results (default: 50, max: 100) |
Delete a memory by key.
curl -X DELETE https://api.agentmemry.ai/v1/forget/old_memory \
-H "Authorization: Bearer am_your_key"
Send a conversation, get relevant memories back, and optionally auto-extract new facts.
| Parameter | Type | Description |
|---|---|---|
| messages | array | Conversation messages [{role, content}] |
| extract | boolean | Auto-extract and store facts (default: false) |
| limit | number | Max memories to return (default: 5) |
Check your API usage statistics.
| Plan | Price | Requests | Storage |
|---|---|---|---|
| free | $0 | 1k/mo | 1 MB |
| pro | 0.002 ETH | 50k/mo | 100 MB |
| scale | 0.01 ETH | unlimited | 1 GB |
Pay with ETH on Base network. Get started free →