text-embedding-3-large at 1536 dims) and indexed in Cloudflare
Vectorize. You query with plain text; we embed it and run k-NN with
metadata-filtered tenant isolation.
No vector store to provision, no embedding pipeline to maintain. Search
becomes available within a few seconds of each thread message persisting.
GET /v1/threads/:id/search — Within one thread
GET /v1/search — Across every thread you own
Query
| Param | Default | Description |
|---|---|---|
q | required | Natural-language search string. We embed it and find the closest message turns. |
limit | 10 (max 50) | Top-K hits to return. |
end_user_id | — | Narrow to one of your end-users (the value passed at thread create time). Account-wide search only. |
Response
Score
Cosine similarity, range-1.0 to 1.0. Roughly:
| Score | Meaning |
|---|---|
| > 0.6 | Strong match — same topic |
| 0.3 – 0.6 | Related |
| 0.05 – 0.3 | Weakly related |
| < 0 | Anti-correlated (different topic) |
topK returns the closest N regardless
of score so you can render score badges in your UI.
Snippets
snippet is a ~240-char excerpt centered on the first matching token of
your query. For short messages, the full content is returned.
What gets embedded
- Every user turn (the
contentyou sent). - Every FINAL assistant turn (the model’s text response).
- Tool-loop intermediate turns (the
tool_use+tool_resultblocks inside a multi-turn dispatch) are NOT embedded — they’re internal state and would pollute search with non-prose noise. - Image/file/tool blocks within content are stripped at embed time; only text blocks contribute.
Tenant isolation
Every embedding is tagged with:user_id(your qlaud account)thread_idseq,role,created_atend_user_idif the thread was tagged with one at create time
user_id always;
optionally narrows by thread_id and/or end_user_id. Other qlaud
customers’ data is never visible.
Errors
| Status | Meaning |
|---|---|
| 400 | Missing q |
| 401 | Bad / revoked qlk key |
| 404 | Thread not found OR not owned by caller (per-thread search only) |
Limits (v1)
- Embedding takes a few seconds after a turn persists; very recent turns may not be searchable yet.
- Newly-tagged
end_user_idfilter requires the Vectorize metadata index — already created at the qlaud account level, no setup on your end. - Cross-account search is impossible by design.