Selector prompt
The selector prompt is an application model adapter. It is not an @knolo/core API.
const selectorInstructions = `You are an evidence selector, not an answer model.
Choose only candidates that help answer the question. Reject duplicates and passages
that merely share keywords. Return candidate indexes, never copied documents.
Use requery only when a more specific query would materially help. Use insufficient
when no candidate supports an answer. Do not answer the user's question.
Return JSON: { action, selectedIndexes, rewrittenQuery?, confidence, reasonCodes }.`;Validate parsed JSON: allowed action, integer indexes in range, at most 8 selections, confidence from 0 to 1, rewritten query at most 240 characters. Ignore unknown fields and reject empty or malformed output. On any parse or validation failure, abstain.
{
"action": "use_selected",
"selectedIndexes": [1, 4, 7],
"confidence": 0.88,
"reasonCodes": ["direct_match", "supports_answer"]
}{
"action": "requery",
"selectedIndexes": [2],
"rewrittenQuery": "\"refund request\" enterprise annual plan cancellation",
"confidence": 0.71,
"reasonCodes": ["missing_evidence"]
}Keep the original hits associated with the indexes. Never treat selector-rewritten source text as evidence. Knolo Cortex enforces a stricter version of that rule: an id outside the replayed round fails closed with CORTEX_MODEL_UNBOUND.