AgenticCandidateSearcher

class AgenticCandidateSearcher(repository: <Error class: unknown class>, ai: <Error class: unknown class>, llmOptions: <Error class: unknown class>) : CandidateSearcher

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

  1. Configures a ToolishRag with text and vector search for the entity type

  2. The LLM crafts search queries based on the entity name and summary

  3. The LLM examines search results and can refine queries iteratively

  4. 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

repository

The entity repository providing search operations

ai

The AI instance for running the agentic loop

llmOptions

LLM configuration for the search agent

See also

for embedding-based search without LLM

for heuristic fuzzy matching

Constructors

Link copied to clipboard
constructor(repository: <Error class: unknown class>, ai: <Error class: unknown class>, llmOptions: <Error class: unknown class>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val resolutionLevel: ResolutionLevel

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

Link copied to clipboard
open override fun search(suggested: SuggestedEntity, schema: <Error class: unknown class>): SearchResult

Search for candidates matching the suggested entity.