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

View Source

LLM-based re-ranker that uses your configured LLM to score chunk relevance.

Scores each chunk from 0-10 based on relevance to the question, then filters by threshold and sorts by score.

Usage

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

# Directly
{:ok, reranked} = Arcana.Agent.Reranker.LLM.rerank(
  "What is Elixir?",
  chunks,
  llm: &my_llm/1,
  threshold: 7
)