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/v1/projects/{id}/search
Searches across everything the project knows — both the ingested document content and the accumulated conversation memories — and returns the matches grouped by source. A single query surfaces the full picture, which is what you typically want in a chat assistant that grounds answers on documents and personalizes them with memories.
Items in documents and memories have the same shapes as Search Documents and Search Memories respectively — the relevant request knobs (top_n, threshold) carry the same meaning here.

Path Parameters

id
string
required
Project ID

Request Body

query
string
required
Natural-language search query. Used by both sub-searches.
user_id
string
required
User ID filter for the memory sub-search. Document search ignores this field.
top_n
integer
default:"10"
Maximum number of results to return, 1–1000. Applied to both document and memory matches — e.g. top_n=10 yields up to 10 documents and up to 10 memories.
threshold
number
default:"0.3"
Minimum similarity score for memory results. Scores below this are filtered out. Does not apply to documents.
with_conflicts
boolean
default:"false"
Include conflict info on memory results.
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v1/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/search' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "What were the quarterly sales figures in 2024?",
    "user_id": "user-abc123",
    "top_n": 10,
    "threshold": 0.3
  }'

Response

data
object
{
  "success": true,
  "data": {
    "documents": [
      {
        "type": "paragraph",
        "document_id": "doc-123",
        "document_name": "report_2024.pdf",
        "paragraph_block_id": "blk-456",
        "highlight": {
          "chunks": [
            { "text": "Q1 2024 sales reached $2.5M...", "range": "p12" }
          ]
        },
        "source_document": { "file_name": "report_2024.pdf" }
      }
    ],
    "memories": [
      {
        "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"
      }
    ]
  }
}
Either list can be empty if no matches cross the threshold. Treat documents and memories independently — they’re just two lookups returned together for convenience.