POST /api/search/semantic
Converts a natural-language query into a 768-dimension embedding using Geminitext-embedding-004, searches the Qdrant prism_documents collection for the nearest vectors (filtered to the specified user), and returns both a flat list of matching chunks and a grouped view organised by document.
The route has a maximum execution time of 60 seconds.
Request body
Natural-language search query. The text is embedded by Gemini before being
compared against stored vectors.
Appwrite user ID. Restricts results to vectors belonging to this user.
Optional array of file type strings to filter results, e.g.
["PDF", "MD"]. When omitted, all file types are searched.Maximum number of individual chunk results to return from Qdrant.
Minimum cosine similarity score (0–1). Chunks below this threshold are
excluded.
Response
true on success.Echo of the search query.
Flat list of matching chunk objects, ordered by Qdrant’s default score
ordering.
Results grouped by document, sorted by
maxScore descending. Useful for
displaying one card per document with its best-matching chunks.Total number of individual chunk results.
Number of unique documents that contain at least one matching chunk.
Errors
| Status | Condition |
|---|---|
400 | query or userId is missing |
500 | Gemini embedding failed or Qdrant search failed |