v46

latestOpenAPI 3.1.0raw.githubusercontent.com2026-04-253903.6 MB
Recall (Search)

Search memory entries

Search memory entries - Low latency for conversational

post/v4/search

Request body

containerTagstring

Optional tag this search should be containerized by. This can be an ID for your user, a project ID, or any other identifier you wish to use to filter memories.

thresholdnumber

Threshold / sensitivity for memories selection. 0 is least sensitive (returns most memories, more results), 1 is most sensitive (returns lesser memories, accurate results)

limitinteger

Maximum number of results to return

qstring required

Search query string

rerankboolean

If true, rerank the results based on the query. This is helpful if you want to ensure the most relevant results are returned.

aggregateboolean

If true, aggregates information from multiple memories to create new synthesized memories. The result will be a mix of aggregated and non-aggregated memories, reranked by relevance to the query. Works in conjunction with reranking.

rewriteQueryboolean

If true, rewrites the query to make it easier to find documents. This increases the latency by about 400ms

searchMode'memories' | 'hybrid' | 'documents'

Search mode. 'memories' searches only memory entries (default). 'hybrid' searches both memories and document chunks. 'documents' searches only document chunks.

filepathstring

Filter search results by filepath. Exact match for full paths, prefix match if ending with /

Response

Memory search results

timingnumber required

Search execution time in milliseconds

totalnumber required

Total number of results returned

Example response

{
  "results": [
    {
      "id": "mem_abc123",
      "memory": "John prefers machine learning over traditional programming",
      "chunk": "This is a chunk of content from a document...",
      "metadata": {
        "source": "conversation",
        "confidence": 0.9
      },
      "similarity": 0.89,
      "filepath": "/docs/architecture.md",
      "version": 3,
      "context": {
        "parents": [
          {
            "relation": "updates",
            "version": -1,
            "memory": "Earlier version: Dhravya is working on a patent at Cloudflare."
          }
        ],
        "children": [
          {
            "relation": "extends",
            "version": 1,
            "memory": "Later version: Dhravya has filed the patent successfully."
          }
        ]
      },
      "documents": [
        {
          "id": "doc_xyz789",
          "title": "Introduction to Machine Learning",
          "type": "web",
          "metadata": {
            "category": "technology",
            "isPublic": true,
            "readingTime": 5,
            "source": "web",
            "tag_1": "ai",
            "tag_2": "machine-learning"
          },
          "summary": "A comprehensive guide to understanding the basics of machine learning and its applications."
        }
      ],
      "chunks": [
        {
          "content": "This is a chunk of content from the document...",
          "score": 0.85,
          "documentId": "doc_xyz789"
        }
      ]
    }
  ],
  "timing": 245,
  "total": 5
}