Skip to main content
POST
Search memory entries

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
q
string
required

Search query string

Minimum string length: 1
Example:

"what are the API rate limits"

containerTag
string

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.

Maximum string length: 100
Pattern: ^[a-zA-Z0-9_:-]+$
Example:

"user_alex"

threshold
number
default:0.6

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

Required range: 0 <= x <= 1
Example:

0.5

filters
object

Optional filters to apply to the search. Can be a JSON string or Query object.

include
object
limit
integer
default:10

Maximum number of results to return

Required range: 1 < x <= 100
Example:

10

rerank
boolean
default:false

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

Example:

false

aggregate
boolean
default:false

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.

Example:

false

rewriteQuery
boolean
default:false

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

Example:

false

searchMode
enum<string>
default:memories

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

Available options:
memories,
hybrid,
documents
Example:

"memories"

filepath
string

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

Response

Memory search results

results
object[]
required

Array of matching memory entries and chunks with similarity scores. Contains memory results when searchMode='memories', both memory and chunk results when searchMode='hybrid', or only chunk results when searchMode='documents'. Memory results have 'memory' field, chunk results have 'chunk' field. BACKWARD COMPATIBILITY: When using deprecated include.chunks=true, only memory results are returned with chunks embedded in them (old format).

timing
number
required

Search execution time in milliseconds

Example:

245

total
number
required

Total number of results returned

Example:

5