AI Search (RAG)
The AI search endpoint returns results pre-formatted for RAG pipelines. Instead of raw engine hits, you get clean text chunks with structured metadata — ready to inject directly into an LLM context window.
AI Search Endpoint
POST
/v1/ai/searchSearch an index and return RAG-formatted results with clean text, metadata, and source attribution.
Auth admin or search keyReturns 200
Request body
{
"index": "articles",
"q": "how to deploy next.js",
"limit": 10,
"filter": "category = 'tutorials'"
}Response
{
"results": [
{
"content": "Deploy your Next.js application to Vercel...",
"metadata": { "publishedAt": 1715000000, "author": "Jane" },
"source": { "index": "articles", "documentId": "doc-42" },
"relevanceScore": 0.98
}
],
"query": "how to deploy next.js",
"processingTimeMs": 12,
"totalResults": 42
}| Parameter | Type | Default | Description |
|---|---|---|---|
index | string | required | Index UID to search |
q | string | "" | Search query |
limit | number | 20 | Maximum number of results to return |
filter | string | — | Optional filter expression |
Response Format
Each result is a structured object designed for LLM consumption:
contentClean text with HTML stripped, whitespace normalized — all string fields from the document concatenatedmetadataNon-string fields (numbers, booleans, nested objects) preserved as structured datasource.indexThe index UID this result came fromsource.documentIdThe document's primary key valuerelevanceScoreEngine ranking score (0-1) when availableThe AI search endpoint counts against your search quota. No LLM calls are made — this is pure retrieval with formatting.