Base URL: http://localhost:9100
Auth: x-api-key: mtk_... header or Authorization: Bearer mtk_...
Returns service status. No auth required.
{"status": "ok", "service": "memtrace", "uptime": "2h30m15s"}Checks Arc connectivity. No auth required.
{"status": "ready", "arc": "connected"}Create a memory (single or batch).
Single:
{
"agent_id": "agent_web_crawler",
"session_id": "sess_abc123",
"memory_type": "episodic",
"event_type": "page_crawled",
"content": "Crawled https://example.com — found 3 product pages",
"metadata": {"url": "https://example.com", "pages_found": 3},
"tags": ["crawling", "products"],
"importance": 0.7,
"dedup_key": "crawl_example_2026-02-07"
}Batch:
{
"memories": [
{"agent_id": "agent_1", "content": "First memory", "memory_type": "episodic"},
{"agent_id": "agent_1", "content": "Second memory", "memory_type": "decision"}
]
}| Field | Type | Required | Default | Description |
|---|---|---|---|---|
agent_id |
string | yes | — | Agent identifier |
content |
string | yes | — | Memory content |
memory_type |
string | no | episodic |
episodic, session, decision, entity |
event_type |
string | no | general |
App-defined event type |
session_id |
string | no | — | Session scope |
metadata |
object | no | — | Arbitrary key-value data |
tags |
string[] | no | — | Tags for filtering |
importance |
float | no | 0 | 0.0 to 1.0 |
dedup_key |
string | no | auto | Deduplication key |
parent_id |
string | no | — | Parent memory for threading |
Response: 201 Created
{
"time": "2026-02-07T20:15:00Z",
"org_id": "org_default",
"agent_id": "agent_web_crawler",
"content": "Crawled https://example.com — found 3 product pages",
"memory_type": "episodic",
"event_type": "page_crawled",
"dedup_key": "a1b2c3d4..."
}List memories with filters.
| Param | Type | Description |
|---|---|---|
agent_id |
string | Filter by agent |
session_id |
string | Filter by session |
memory_type |
string | Filter by type |
event_type |
string | Filter by event type |
tags |
string | Comma-separated tags (AND) |
since |
string | Relative (2h, 7d) or ISO8601 |
until |
string | Relative or ISO8601 |
limit |
int | Max results (default 100, max 1000) |
offset |
int | Pagination offset |
order |
string | asc or desc (default) |
Response:
{
"memories": [...],
"count": 42,
"has_more": true
}Get a specific memory by ID.
Register a new agent.
{
"name": "web_crawler",
"description": "Crawls product pages",
"config": {"max_depth": 3}
}List all agents in the organization.
Get a specific agent.
Get memory statistics for an agent.
{
"agent_id": "agent_abc",
"memory_count": 1523,
"memories_24h": 47,
"errors_24h": 2,
"session_count": 12,
"active_sessions": 1,
"memory_types": {
"episodic": 1200,
"decision": 300,
"entity": 23
}
}Delete an agent.
Create a new session.
{
"agent_id": "agent_abc",
"metadata": {"task": "product_research"}
}List sessions. Optional agent_id query param to filter.
Get a specific session.
Update session status or metadata.
{"status": "closed"}Get LLM-ready formatted context for a session.
{
"since": "4h",
"include_types": ["episodic", "decision"],
"max_tokens": 2000
}Response:
{
"session_id": "sess_abc",
"context": "## Session Context (sess_abc)\n\n### Recent Actions (12)\n...",
"memory_count": 15
}Search memories with structured filters.
{
"agent_id": "agent_abc",
"memory_types": ["episodic", "decision"],
"event_types": ["page_crawled"],
"tags": ["products"],
"content_contains": "example.com",
"min_importance": 0.5,
"since": "7d",
"order": "desc",
"limit": 50
}Response:
{
"results": [...],
"count": 23,
"query_time_ms": 12
}