POST /recall
Retrieve the most semantically similar memories to a query.
Request
POST https://api.lawmem.ai/recall
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Natural language query to search by |
| namespace | string | Yes | Namespace to search within |
| top_k | integer | No | Results to return (default: 5, max: 20) |
Example
curl -X POST https://api.lawmem.ai/recall \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What are this client preferences on dispute resolution?",
"namespace": "client-acme",
"top_k": 5
}'
Response
{
"results": [
{
"id": "mem_a1b2c3d4",
"text": "Client has a strict no-arbitration clause in all vendor contracts.",
"score": 0.91,
"metadata": {"source": "intake", "date": "2026-03-21"},
"created_at": "2026-03-21T12:00:00Z"
}
],
"namespace": "client-acme",
"query_tokens": 14
}
| Field | Description |
|---|---|
| results | Memories ranked by cosine similarity |
| score | Similarity score 0-1. Above 0.80 is a strong semantic match |
| query_tokens | Tokens used for the query embedding |