Skip to main content
Price: $0.001 USDC

Request Body

query
string
required
Natural language search query. Max 8,192 characters.
limit
integer
Maximum number of results, 1–100. Default: 5.
min_similarity
number
Minimum similarity threshold, 0–1. Default: 0.0.
namespace
string
Filter results to a specific namespace.
filters
object
Additional filters to narrow results.

Scoring

Recall scoring formula:
score = (1 - cosine_distance) × (0.7 + 0.3 × importance)
Memories with higher importance get a ranking boost. At equal similarity, a memory with importance 1.0 scores ~43% higher than one with importance 0.

Response (200)

memories
array
Array of matching memories.
query_tokens
number
Tokens used for the query embedding.

Example

curl -X POST https://api.memoclaw.dev/v1/recall \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are the user editor preferences?",
    "limit": 5,
    "filters": {
      "tags": ["preferences"]
    }
  }'
Response
{
  "memories": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User prefers dark mode and vim keybindings",
      "similarity": 0.89,
      "metadata": {
        "tags": ["preferences", "ui"]
      },
      "importance": 0.8,
      "namespace": "default",
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "query_tokens": 12
}