Documentation

Everything you need to integrate AgentMem into your AI agents.

Quickstart

Get started with AgentMem in under a minute.

1. Register an Agent

Create your first agent and get an API key:

curl -X POST https://api.agentmem.dev/api/agents/register \ -H "Content-Type: application/json" \ -d '{"name": "my-agent", "framework": "langchain"}'

Response:

{ "id": "abc123-def456-...", "name": "my-agent", "apiKey": "am_live_xxx...", "framework": "langchain", "createdAt": "2026-03-01T00:00:00.000Z" }

2. Store a Memory

curl -X POST https://api.agentmem.dev/api/memories \ -H "Content-Type: application/json" \ -H "X-API-Key: am_live_xxx..." \ -d '{"content": "User prefers dark mode and speaks English"}'

3. Search Memories

curl -X POST https://api.agentmem.dev/api/memories/search \ -H "Content-Type: application/json" \ -H "X-API-Key: am_live_xxx..." \ -d '{"query": "user preferences", "limit": 5}'

Response includes semantic search results:

{ "query": "user preferences", "count": 1, "results": [ { "memory": { "id": "mem-xxx", "content": "User prefers dark mode and speaks English", "createdAt": "2026-03-01T00:00:00.000Z" }, "score": 0.87 } ] }

Authentication

All API requests require an API key in the X-API-Key header:

-H "X-API-Key: am_live_xxx..."

Get your API key by registering an agent.

API Reference

Agents

POST /api/agents/register

Register a new agent and get an API key.

Parameters

Field Type Description
name string Agent name (required)
framework string Framework name (optional): langchain, crewai, openai, claude, etc.
metadata object Custom metadata (optional)

Memories

POST /api/memories

Store a new memory. Automatically embedded for semantic search.

Parameters

Field Type Description
content string Memory content (required)
metadata object Custom metadata (optional)
expiresAt string Expiration timestamp (optional)
GET /api/memories/:id

Retrieve a specific memory by ID.

DELETE /api/memories/:id

Delete a memory.

POST /api/memories/search

Semantic search across your agent's memories.

Parameters

Field Type Description
query string Search query (required)
limit number Max results (default: 10)
threshold number Minimum similarity score 0-1 (default: 0.5)

SDKs

JavaScript/TypeScript

npm install @agentmem/sdk import { AgentMem } from '@agentmem/sdk'; const client = new AgentMem('am_live_xxx...'); // Store await client.memories.store('User likes pizza'); // Search const results = await client.memories.search('food preferences'); // List const all = await client.memories.list({ limit: 100 });

Python

pip install agentmem from agentmem import AgentMem client = AgentMem('am_live_xxx...') # Store client.memories.store('User likes pizza') # Search results = client.memories.search('food preferences') # List all_memories = client.memories.list(limit=100)

SDKs coming soon. For now, use the REST API directly.