Memory API
LivePersistent, namespace-isolated semantic memory for AI agents. Store text → embeddings generated automatically. Search by meaning. Forget on command.
https://sendryx.polsia.app
Model: text-embedding-3-small (1536 dims)
Similarity: cosine
Quick Start
Three calls to get persistent memory working in your agent:
Authentication
All Memory API endpoints require an API key. Create keys at /app. Every key is bound to a namespace — your memories are automatically isolated.
Rate Limits
Memory endpoints are rate-limited separately from gateway endpoints. Limits apply per API key.
| Window | Limit | Error |
|---|---|---|
| Per minute | 60 requests | 429 Too Many Requests — includes retry_after_seconds |
| Per hour | 600 requests | 429 Too Many Requests — includes retry_after_seconds |
Store and search generate embeddings on every call — rate limits protect against runaway embedding costs from misbehaving agents.
TTL & Expiry
Memories can be permanent (default) or short-lived. Set expires_in_seconds on store to create a TTL.
- •Expired memories are excluded from search results automatically
- •Expired memories are excluded from list results by default (use
include_expired=trueto see them) - •Expired rows are purged from the database hourly via background cleanup
- •
GET /v1/memory/statsshows counts for permanent, active TTL, and expired memories
Endpoints
Store a memory. Embeddings are auto-generated — just pass text.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Required | Text to store. Max 8,191 characters (embedding model limit). Will be trimmed. |
| metadata | object | Optional | Arbitrary JSON attached to the memory. Returned with search/list results. Default: {} |
| expires_in_seconds | integer | Optional | TTL in seconds from now. Omit for permanent memory. E.g. 3600 = 1 hour. |
Example
Semantic search via cosine similarity. Returns memories ranked by relevance to the query.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| query | string | Required | Natural language search query. Embedding generated, then compared via cosine similarity. |
| limit | integer | Optional | Max results to return. Default: 10. Max: 100. |
| threshold | float | Optional | Minimum cosine similarity (0–1). Default: 0.3. Higher = stricter relevance filter. Try 0.5 for precise recall, 0.2 for broad recall. |
Example
Only non-expired memories are returned. Similarity score is cosine similarity (0 = unrelated, 1 = identical).
Delete a specific memory by ID, or wipe an entire namespace. Explicit action required — nothing auto-wipes.
Options
| Field | Source | Description |
|---|---|---|
| id | body { id: N } or query ?id=N |
Delete a single memory by ID. Must be a positive integer. |
| wipe | body { wipe: true } or query ?wipe=true |
Delete ALL memories in the namespace. Irreversible. |
Examples
List all memories in the namespace with pagination. Returns most recent first.
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
| limit | integer | 50 |
Records per page. Max: 200. |
| offset | integer | 0 |
Pagination offset. |
| include_expired | boolean | false |
Include expired memories in the result. Set to true to see all records including past-TTL ones. |
Memory counts by type: total, permanent, active TTL, expired, oldest/newest timestamps.
Per-namespace API call counts and storage usage estimate.
Embedding bytes estimated at 1536 floats × 4 bytes per memory. Content bytes are exact character length.
Error Codes
| Status | When | Response |
|---|---|---|
400 |
Missing required fields, invalid ID, or no action specified on forget | { "success": false, "message": "..." } |
401 |
Missing or invalid API key | { "success": false, "message": "API key required..." } |
404 |
Memory ID not found in namespace | { "success": false, "message": "Memory 42 not found..." } |
429 |
Rate limit exceeded | { "success": false, "message": "...", "retry_after_seconds": 12 } |
500 |
Server error (e.g. OpenAI key not configured) | { "success": false, "message": "OpenAI not configured..." } |