Prompt for controlling the multi-hop retrieval loop.
Given the query and the candidates retrieved so far, decides whether the accumulated evidence is sufficient to stop retrieval, and if not, selects a small focus set of candidates that should drive the next hop.
Returns structured output via chat_structured/3 using a Zoi schema.
Summary
Functions
Builds the system and user messages for the retrieval control prompt.
Parses the control decision from the LLM response.
Returns the Zoi schema for structured LLM output validation.
Functions
Builds the system and user messages for the retrieval control prompt.
@spec parse_response(map()) :: {:ok, %{enough: boolean(), top_indices: [integer()]}} | {:error, Mnemosyne.Errors.Invalid.PromptError.t()}
Parses the control decision from the LLM response.
@spec schema() :: Zoi.Type.t()
Returns the Zoi schema for structured LLM output validation.