Skip to main content

Search API

Semantic search across your agent's memories using natural language queries and advanced filtering.

Overview

The Search API enables powerful semantic search across your memories using natural language. Queries are embedded and matched against your memory embeddings using semantic similarity, returning the most relevant results.

Pro tip: For best results, phrase your search queries as questions or statements that match how you stored the original memories.

Find Similar Memories

GET /search/similar/:memoryId — Similar memories to a given memory

Returns memories most similar (by embedding) to the given memory.

Path Parameters

NameTypeRequiredDescription
memoryIdstringyesSource memory UUID.

Response (200)

Returns ranked similar memories.

Search Result Object

Each unified-search result has a type discriminator plus type-specific fields:

FieldTypeDescription
typestringmemory or audio_segment.
idstringResult UUID (memory ID or audio segment ID).
scorenumberFused relevance score (0-1). Higher is better.
contentstringMemory content (when type = memory).
content_typestringMemory content type (text, audio, image, …).
tagsstring[]Memory tags.
metadataobjectMemory metadata.
warningsobject[]Optional warnings, e.g. when a superseded memory is included.
audio_file_idstringParent audio file UUID (when type = audio_segment).
textstringSegment text (audio segments).
highlightstringHighlighted phrase (audio segments).
start_timenumberSegment start in seconds.
end_timenumberSegment end in seconds.
clip_urlstringSigned clip URL (audio segments).

Best Practices

Writing Effective Queries

  • Use natural-language questions: "What does the user prefer for authentication?"
  • Be specific when searching technical content: "React component state management patterns"
  • Use /search/aggregate when you want to browse results by tag or cluster.
  • Use /search/topic when you want memories that carry a specific tag.

Optimizing Performance

  • Filter by space_id to reduce search scope.
  • Set a threshold to skip low-similarity matches.
  • Use include=memories to skip audio scanning when you only want text.
  • Use a pipeline preset to apply tuned retrieval defaults.

Understanding Scores

  • 0.9+ — Excellent match, highly relevant
  • 0.8-0.9 — Good match, likely relevant
  • 0.7-0.8 — Moderate match, possibly relevant
  • <0.7 — Weak match, may not be useful