Arcana.Agent.Expander.LLM (Arcana v1.3.3)

View Source

LLM-based query expander.

Uses the configured LLM to add synonyms and related terms to queries. This is the default expander used by Agent.expand/2.

Usage

# With Agent pipeline (uses ctx.llm automatically)
ctx
|> Agent.expand()
|> Agent.search()
|> Agent.answer()

# Directly
{:ok, expanded} = Arcana.Agent.Expander.LLM.expand(
  "ML models",
  llm: &my_llm/1
)