Semantic Search
Perform semantic search across your entire knowledge base using natural language queries.Endpoint
POST /api/retrieval/search
Request Body
Natural language search query
Maximum number of results to return (1-100)
Filter results by document metadata
Search strategy:
semantic, keyword, or hybridInclude source citations in results
Response
Array of search results ordered by relevance
Total number of matching results
Query execution time in milliseconds
Example
Hybrid Search
Combine semantic and keyword search for optimal results.How It Works
Hybrid search leverages both:- Semantic search: Understands meaning and context using vector embeddings
- Keyword search: Matches exact terms and phrases using BM25 algorithm
Configuration
Weight for semantic search (0-1)
Weight for keyword search (0-1)
Weights must sum to 1.0
Example
Retrieve by Document
Retrieve specific chunks from a document with optional filtering.Endpoint
GET /api/retrieval/document/{document_id}
Path Parameters
Document identifier
Query Parameters
Retrieve chunks from a specific page
Maximum chunks to return
Example
Advanced Filtering
Filter by Date Range
Filter by Tags
Filter by Multiple Criteria
Search Modes Comparison
Semantic
Best for:
- Conceptual queries
- Paraphrased questions
- Cross-lingual search
Keyword
Best for:
- Exact term matching
- Technical identifiers
- Product codes
Hybrid
Best for:
- General queries
- Mixed intent
- Balanced precision/recall
Ranking and Relevance
Results are ranked using multiple signals:- Semantic similarity: Cosine similarity between query and document embeddings
- Keyword match: BM25 score for term frequency and document length
- Recency: Newer documents receive a slight boost
- Source authority: Documents with more citations rank higher
Rate Limits
- Free tier: 100 queries per day
- Pro tier: 1,000 queries per day
- Enterprise: Unlimited queries
