Search

Hybrid search over contexts (PG tsvector + Elasticsearch BM25 + RRF fusion)

post/api/search

Request

  • Base URL: http://localhost:38200
  • URL: http://localhost:38200/api/search
  • Auth: one of:
    • HTTP bearer
    • API key in cookie token

Request body

querystring required
workspacestring
projectstring
type'reference' | 'feedback' | 'project' | 'incident' | 'lesson' | 'user' | 'synthesis' | 'map' | 'moc' | 'handoff' | 'endpoint' | 'trail'
tagsstring[]
scope'personal' | 'workspace' | 'team'
subjectIdstring

Filter to a single end-user's memories (Mem0-parity user_id axis).

include_subject_rowsboolean

Admin/owner (or API key scope=admin) only.

memoryKind'episodic' | 'semantic' | 'procedural'
epistemicMin'observed' | 'told' | 'inferred' | 'assumed'
limitinteger
offsetinteger
useMapboolean
includeMapsboolean
include_archivedboolean
lifecycle_boostboolean
chunk_searchboolean
level'full' | 'paragraph' | 'sentence'
min_scorenumber
rewrite_queryboolean
no_cacheboolean
grantsinteger[]

Explicit opt-in cross-tenant memory-sharing grant ids.

include_trace_eventsboolean
trace_session_idinteger
latency_budget_msinteger

T700: cross-stage wall-clock budget for the WHOLE request. Omit for unchanged behaviour -- this is strictly opt-in and nothing pays for it by default.

Distinct from the per-stage timeouts (SEARCH_QUERY_REWRITE_TIMEOUT_MS default 6000, SEARCH_RERANKING_TIMEOUT_MS default 8000), which are independent and ADDITIVE -- 14 s of stage timeout alone, before PG/ES/vector run -- so no combination of them can express "answer within a second".

Before each optional heavy stage (query-rewrite, graph-assist, cross-encoder rerank) the elapsed time is compared against the budget; a stage with too little room left is SKIPPED WITHOUT BEING ENTERED (no network call at all) and named in searchMeta.degradedStages[]. A stage that IS admitted has its own timeout clamped down to the remainder. The mandatory legs are never skipped -- a budget shapes which optional quality stages run, it is not a request-abort deadline, so the response is always well-formed.

Response

Ranked search results.

totalinteger
searchMetaobject
grantedResultsobject[]
traceEventsobject[]

Changes

No recorded changes to this operation across all 1 revision of this API.