SIM-RAG-Inspired Iterative RAG
Use this immutable Agentic Skill to run a bounded retrieve-generate-critique
loop. It borrows SIM-RAG's inference architecture, but does not reproduce its
Self-Practicing, Critic training, rationale generation, or experiments.
Contract
- Bind exactly one retriever, generator, and critic.
- Optionally bind one rewriter and one reranker.
- Keep the user's original query for reranking, generation, and critique.
- Treat rewritten queries as retrieval aids, never as evidence.
- Return an answer only when the Critic approves a direct, non-abstaining answer.
- Require evidence for every fact or reasoning hop needed by the answer.
- Regenerate once with the same evidence when a rejection is clearly about
answer form only; ambiguous or evidence-related rejections continue retrieval.
Component selection
- Prefer BM25 for exact names, dates, titles, identifiers, and questions with
strong lexical overlap with the corpus.
- Prefer Vector retrieval when paraphrases, synonyms, or semantic similarity
are more important than exact token overlap.
- Use HyDE only with Vector retrieval, and only when a concise hypothetical
passage is likely to bridge a vocabulary or intent gap. Never treat the HyDE
passage as evidence.
- Use BGE Reranker when multi-hop reasoning, noisy candidates, or accumulated
evidence make top-rank precision important.
- Leave optional slots empty when their expected retrieval benefit does not
justify added model calls, latency, or local model cost.
- Always bind the required Generator and Critic after choosing the retrieval
path.
Request options
max_iterations defaults to 3 and must be positive.
max_tokens controls answer generation only.
critic_max_tokens controls critique generation, defaults to 4096, and
must be positive.
Follow-up retrieval
Use at most three concrete missing-evidence issues from the Critic, bounded to
160 characters each. Use bounded feedback only when no usable issue exists.
The trace exposes accumulated and newly added document IDs for every round.
Answer regeneration
Treat Critic feedback as answer-form-only when it clearly requests a shorter,
more direct, or better-formatted answer and contains no missing-evidence signal.
Regenerate once in that iteration using the original question, bounded Critic
guidance, and the same accumulated evidence. Critique the revised answer again
before returning it. Mixed or unrecognized rejection reasons must continue the
normal retrieval loop.
Record a regeneration trace event with the original answer, bounded guidance,
revised answer, and revised Critic result. An approved revision stops with
critic_approved_after_regeneration.
Safe stopping
Stop with Insufficient evidence to answer reliably. when the iteration limit
is reached or a rejected round contributes no new evidence. Treat generated
abstentions as rejected even if a model Critic mistakenly approves them.
1---2name: agentic-iterative-rag3description: Use when a RAG request needs bounded multi-round evidence gathering with Critic-based sufficiency checks before returning an answer.4---56# SIM-RAG-Inspired Iterative RAG78Use this immutable Agentic Skill to run a bounded retrieve-generate-critique9loop. It borrows SIM-RAG's inference architecture, but does not reproduce its10Self-Practicing, Critic training, rationale generation, or experiments.1112## Contract1314- Bind exactly one retriever, generator, and critic.15- Optionally bind one rewriter and one reranker.16- Keep the user's original query for reranking, generation, and critique.17- Treat rewritten queries as retrieval aids, never as evidence.18- Return an answer only when the Critic approves a direct, non-abstaining answer.19- Require evidence for every fact or reasoning hop needed by the answer.20- Regenerate once with the same evidence when a rejection is clearly about21 answer form only; ambiguous or evidence-related rejections continue retrieval.2223## Component selection2425- Prefer BM25 for exact names, dates, titles, identifiers, and questions with26 strong lexical overlap with the corpus.27- Prefer Vector retrieval when paraphrases, synonyms, or semantic similarity28 are more important than exact token overlap.29- Use HyDE only with Vector retrieval, and only when a concise hypothetical30 passage is likely to bridge a vocabulary or intent gap. Never treat the HyDE31 passage as evidence.32- Use BGE Reranker when multi-hop reasoning, noisy candidates, or accumulated33 evidence make top-rank precision important.34- Leave optional slots empty when their expected retrieval benefit does not35 justify added model calls, latency, or local model cost.36- Always bind the required Generator and Critic after choosing the retrieval37 path.3839## Request options4041- `max_iterations` defaults to `3` and must be positive.42- `max_tokens` controls answer generation only.43- `critic_max_tokens` controls critique generation, defaults to `4096`, and44 must be positive.4546## Follow-up retrieval4748Use at most three concrete missing-evidence issues from the Critic, bounded to49160 characters each. Use bounded feedback only when no usable issue exists.50The trace exposes accumulated and newly added document IDs for every round.5152## Answer regeneration5354Treat Critic feedback as answer-form-only when it clearly requests a shorter,55more direct, or better-formatted answer and contains no missing-evidence signal.56Regenerate once in that iteration using the original question, bounded Critic57guidance, and the same accumulated evidence. Critique the revised answer again58before returning it. Mixed or unrecognized rejection reasons must continue the59normal retrieval loop.6061Record a `regeneration` trace event with the original answer, bounded guidance,62revised answer, and revised Critic result. An approved revision stops with63`critic_approved_after_regeneration`.6465## Safe stopping6667Stop with `Insufficient evidence to answer reliably.` when the iteration limit68is reached or a rejected round contributes no new evidence. Treat generated69abstentions as rejected even if a model Critic mistakenly approves them.