All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

AI Search - AI Search now has hybrid search and relevance boosting

2mo ago

Source

CloudflareAI Search - AI Search now has hybrid search and relevance boostingcloudflare.com
Snippet from the RSS feed
AI Search now supports hybrid search and relevance boosting, giving you more control over how results are found and ranked. Hybrid search Hybrid search combines vector (semantic) search with BM25 keyword search in a single query. Vector search finds chunks with similar meaning, even when the exact words differ. Keyword search matches chunks that contain your query terms exactly. When you enable hybrid search, both run in parallel and the results are fused into a single ranked list. You can configure the tokenizer ( porter for natural language, trigram for code), keyword match mode ( and for precision, or for recall), and fusion method ( rrf or max ) per instance: const instance = await env . AI_SEARCH . create ( { id : "my-instance" , index_method : { vector : true , keyword : true }, fusion_method : "rrf" , indexing_options : { keyword_tokenizer : "porter" }, retrieval_options : { keyword_match_mode : "and" }, } ) ; Refer to Search modes for an overview and Hybrid search for configuration details. Relevance boosting Relevance boosting lets you nudge search rankings based on document metadata. For example, you can prioritize recent documents by boosting on timestamp , or surface high-priority content by boosting on a custom metadata field like priority . Configure up to 3 boost fields per instance or override them per request: const results = await env . AI_SEARCH . get ( "my-instance" ) . search ( { messages : [ { role : "user" , content : "deployment guide" } ] , ai_search_options : { retrieval : { boost_by : [ { field : "timestamp" , direction : "desc" }, { field : "priority" , direction : "desc" }, ] , }, }, } ) ; Refer to Relevance boosting for configuration details.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.