Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.memorylake.ai/llms.txt

Use this file to discover all available pages before exploring further.

POST /openapi/memorylake/api/v2/projects/{id}/memories/search
Searches memories in the project using natural language. Results can be filtered by user, limited by score threshold, and optionally reranked for higher relevance.
Permission required: project:mem_search · instance

Path Parameters

id
string
required
Project ID

Request Body

query
string
required
The search query text
user_id
string
required
Filter by user ID
top_k
integer
default:"10"
Maximum number of results to return (1–1000)
threshold
number
default:"0.3"
Minimum similarity score threshold. Results below this score are filtered out.
rerank
boolean
default:"false"
Whether to apply reranking to improve result relevance
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v2/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/memories/search' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "What restaurants were recommended?",
    "user_id": "user-abc123",
    "top_k": 10,
    "threshold": 0.3,
    "rerank": false
  }'

Response

data
object
{
  "success": true,
  "data": {
    "results": [
      {
        "id": "mem-123",
        "content": "User prefers Hangzhou cuisine restaurants",
        "user_id": "user-abc123",
        "created_at": "2024-01-15T10:00:00Z",
        "updated_at": "2024-01-15T10:00:00Z"
      }
    ]
  }
}