Arcana.Pipeline.Expander.LLM (Arcana v2.0.1)

Copy Markdown 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 Pipeline.expand/2.

Usage

# With Arcana.Pipeline (uses ctx.llm automatically)
ctx
|> Pipeline.expand()
|> Pipeline.search()
|> Pipeline.answer()

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