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

View Source

LLM-based query rewriter.

Uses the configured LLM to transform conversational input into clear search queries. This is the default rewriter used by Agent.rewrite/2.

Usage

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

# Directly
{:ok, rewritten} = Arcana.Agent.Rewriter.LLM.rewrite(
  "Hey, can you tell me about Elixir?",
  llm: &my_llm/1
)