Agentic Candidate Searcher
Agentic candidate searcher that uses ToolishRag to let an LLM drive the search process.
Unlike heuristic searchers that apply fixed matching rules, this searcher gives the LLM full control to craft queries, examine results, and iteratively refine searches.
When to Use
Add this as the last searcher in com.embabel.dice.common.resolver.EscalatingEntityResolver when:
Heuristic matching (exact, normalized, partial, fuzzy, vector) is insufficient
Entities have many alternate names or translations (e.g., musical works, places)
Semantic understanding is required to match entities
How It Works
Configures a ToolishRag with text and vector search for the entity type
The LLM crafts search queries based on the entity name and summary
The LLM examines search results and can refine queries iteratively
Returns SearchResult.confident if LLM finds a match, otherwise candidates
Trade-offs
Slower than heuristic searchers (LLM calls per entity)
Higher cost due to LLM usage
Should be placed last in the searcher chain after cheaper options
Parameters
The entity repository providing search operations
The AI instance for running the agentic loop
LLM configuration for the search agent
See also
for embedding-based search without LLM
for heuristic fuzzy matching
Constructors
Properties
Which ResolutionLevel a confident hit from this searcher counts as, for the per-level telemetry EscalatingEntityResolver logs. Each searcher declares its own tier so the counts stay accurate whatever the chain's length or order. Defaults to ResolutionLevel.HEURISTIC_MATCH; exact-lookup searchers report ResolutionLevel.EXACT_MATCH and vector search reports ResolutionLevel.EMBEDDING_MATCH.
Functions
Search for candidates matching the suggested entity.