Skip to content

Add retrieval_strategy argument to Search Mode#91

Open
CShorten wants to merge 5 commits into
mainfrom
add-search-strategy
Open

Add retrieval_strategy argument to Search Mode#91
CShorten wants to merge 5 commits into
mainfrom
add-search-strategy

Conversation

@CShorten
Copy link
Copy Markdown
Member

@CShorten CShorten commented May 20, 2026

Description

Adds a retrieval_strategy parameter to the Query Agent's Search Mode. This allows users to control the trade-off between recall and precision.

The parameter accepts two values: "recall" to optimize for finding all relevant results, or "precision"` to optimize for the accuracy of returned results.

Usage example:

agent = QueryAgent(
  client=client, 
  collections=["FinancialContracts"]
)
                                                                                
# Default behavior (recall) 
results = agent.search("Find all NDAs signed by Jane Doe in 2024.")           
                                                                                
# Optimize for precision
results = agent.search(
  "Find all NDAs signed by Jane Doe in 2024.",
  retrieval_strategy="precision"
)

Pagination Fix

Empty search lists are cached from precision mode's ability to output no searches, ensuring pagination requests are consistent.

Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@CShorten CShorten changed the title Add search_strategy argument to Search Mode Add retrieval_strategy argument to Search Mode May 21, 2026
@CShorten CShorten self-assigned this May 21, 2026
@CShorten CShorten requested a review from a team May 21, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant