Overview
Search your collection using AI-powered semantic search. This endpoint provides powerful search capabilities:
Search Strategies:
- hybrid (default): Combines neural (semantic) and keyword (BM25) matching
- neural: Pure semantic search using embeddings
- keyword: Traditional keyword-based BM25 search
Features:
- Query expansion: Generate query variations to improve recall
- Filter interpretation: Extract structured filters from natural language
- Reranking: LLM-based reranking for improved relevance
- Answer generation: AI-generated answers based on search results
Path Parameters
The unique readable identifier of the collection to search
Request Body
The search query text (max 2048 tokens)Example: “How do I reset my password?”
Search strategy: hybrid, neural, or keyword
Structured filter for metadata-based filtering (Qdrant filter format)
{
"must": [
{"key": "source_name", "match": {"value": "GitHub"}}
]
}
Number of results to skip for pagination
Maximum number of results to return (1-1000)
Generate query variations to improve recall
Extract structured filters from natural language (e.g., ‘from last week’)
Apply LLM-based reranking for improved relevance
Generate an AI answer based on search results
Response
Array of search result objects
Unique identifier of the matched entity
Source that this result came from (e.g., “GitHub”, “Slack”)
Markdown content of the result
Hierarchical path to the result
Direct link to the original source
AI-generated answer based on search results (only if generate_answer: true)
Example Request
curl -X POST https://api.airweave.ai/v1/collections/customer-support-tickets-x7k9m/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I reset my password?",
"limit": 10
}'
Example Response
{
"results": [
{
"entity_id": "abc123-def456-789012",
"source_name": "GitHub",
"md_content": "# Password Reset Guide\n\nTo reset your password...",
"metadata": {
"file_path": "docs/auth/password-reset.md",
"last_modified": "2024-03-15T09:30:00Z"
},
"score": 0.92,
"breadcrumbs": ["docs", "auth", "password-reset.md"],
"url": "https://github.com/company/docs/blob/main/docs/auth/password-reset.md"
}
],
"completion": "To reset your password, navigate to the login page and click 'Forgot Password'. You'll receive an email with a reset link that expires in 24 hours."
}
Error Responses
Collection with the specified readable_id does not exist
Invalid query (e.g., exceeds token limit)