Run Hybrid Search
Best-of-both-worlds: combines semantic understanding with exact keyword matching, then AI-reranks for maximum relevance.
Hybrid search runs both dense (semantic) and sparse (keyword) searches simultaneously, merges the results, and uses AI reranking to deliver the highest quality matches.
When to Use Hybrid Search
✅ Good for:
- Complex queries mixing concepts and keywords: "senior Python developer who can lead teams"
- Maximum quality needed: production searches, critical hires
- Unclear if semantic or keyword search is better
- Queries with both technical skills AND soft requirements
- When you want the absolute best results and can accept slower processing
❌ Not ideal for:
- Simple keyword-only queries (use Sparse instead)
- Simple semantic queries (use Dense instead)
- Speed-critical applications (15-30s vs 5-10s)
- High-volume automated searches (higher compute cost)
How It Works
- Parallel Search - Runs dense and sparse searches simultaneously (5-10s)
- Result Fusion - Merges both result sets, prioritizing candidates found by both algorithms
- AI Reranking - Cohere AI scores each candidate against your exact query for optimal relevance
- Top Results - Returns the best matches after AI evaluation
Processing time: 15 to 30 seconds
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Your search query (1 to 500 characters). Can mix concepts and keywords. |
top_k | integer | No | Initial results from each search type (1 to 100, default: 20) |
rerank_top_n | integer | No | Final results after AI reranking (1 to 100, default: 30) |
searchGroupId | string (UUID) | No | Group this search with others for comparison |
Understanding the parameters:
top_k=20means 20 from dense + 20 from sparse = ~40 candidates go to rerankingrerank_top_n=30means return the best 30 after AI reranking- Tip: Set
rerank_top_nslightly higher thantop_kfor best coverage
Response Flow
This endpoint returns immediately with a searchId. The actual search runs asynchronously in the background.
Next steps:
- Save the returned
searchId - Poll
GET /v1/public/searches/:searchIdevery 3 to 5 seconds (note: slower than dense/sparse) - When
statusis"completed", fetch results fromGET /v1/public/searches/:searchId/results
Rate limit
For rate limit, please check the rate limit in the dedicated API documentation section.
Example Request
POST /v1/public/searches/hybrid
{
"query": "experienced backend engineer who knows Python and can lead teams, preferably with startup experience",
"top_k": 30,
"rerank_top_n": 20
}Why this query benefits from hybrid:
- Has keywords: "Python", "backend engineer"
- Has concepts: "can lead teams", "startup experience"
- Needs both exact matches AND semantic understanding
Example Response
202 Accepted
{
"searchId": "550e8400-e29b-41d4-a716-446655440000",
"searchGroupId": "660e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"searchType": "hybrid",
"query": "experienced backend engineer who knows Python and can lead teams, preferably with startup experience",
"estimatedTime": "15 to 30 seconds",
"statusUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000",
"resultsUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000/results"
}Tips for Better Results
- Use for complex queries: Mix specific skills with soft requirements
- Set appropriate top_k: Use 30-50 to give reranker enough candidates to evaluate
- Balance quality vs speed: Hybrid is 2-3x slower but delivers best quality
- Compare with other methods: Use
searchGroupIdto see if hybrid actually performs better for your query
Error Responses
| Status | Reason | Solution |
|---|---|---|
| 400 | Invalid query format | Check query length (1 to 500 chars), top_k range (1 to 100), rerank_top_n range (1 to 100) |
| 401 | Invalid API key | Verify your API key in request headers |
| 500 | Search initiation failed | Retry request or contact support with searchId |
Result Expiration
- Search results are stored in the database and can be retrieved anytime using the same searchId
Comparing Algorithms
Use searchGroupId to compare hybrid with other search types on the same query:
# Run hybrid search
POST /v1/public/searches/hybrid
{ "query": "Python developer with leadership skills", "searchGroupId": "abc-123", "top_k": 30, "rerank_top_n": 20 }
# Run dense search with same groupId
POST /v1/public/searches/dense
{ "query": "Python developer with leadership skills", "searchGroupId": "abc-123" }
# Run sparse search with same groupId
POST /v1/public/searches/sparse
{ "query": "Python developer with leadership skills", "searchGroupId": "abc-123" }
# Compare all results
GET /v1/public/searches/groups/abc-123/resultsAPI key for public API access. Get yours at https://app.floreal.ai?tab=api
In: header
1 <= length <= 5001 <= value <= 1001 <= value <= 100Response Body
curl -X POST "https://api.floreal.ai/v1/public/searches/hybrid" \
-H "Content-Type: application/json" \
-d '{
"query": "string"
}'{
"searchId": "550e8400-e29b-41d4-a716-446655440000",
"searchGroupId": "660e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"searchType": "hybrid",
"query": "experienced backend engineer who knows Python and can lead teams",
"estimatedTime": "15 to 30 seconds",
"statusUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000",
"resultsUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000/results"
}{
"error": "string",
"message": "string"
}{
"error": "string"
}{
"error": "string",
"message": "string"
}