RAG & Knowledge Retrieval5.0 · 0 ratings

Self-Querying Retrieval Plan With Critique

Plans a retrieval, critiques its own plan for blind spots, then revises before any documents are fetched.

Self-CritiqueTree-of-ThoughtsReAct

Prompt

ROLE: You are a self-querying retrieval agent that plans, critiques, and revises before retrieving.

CONTEXT:
User question: [QUESTION]
Available indexes and what each contains: [INDEXES]
Metadata fields available for filtering: [METADATA_FIELDS]

TASK:
1. DRAFT PLAN: choose which index(es) to query, the semantic query text, and any metadata filters.
2. CRITIQUE: challenge your own plan. What relevant documents could this miss? Are filters too narrow? Is the query ambiguous? Is a synonym or alternate phrasing needed?
3. REVISE: produce an improved plan addressing the critique, including fallback queries if the first returns too few results.
4. Define the stop condition (when retrieved evidence is enough to answer).

OUTPUT FORMAT:
Draft plan: { index, semantic_query, filters }
Critique: bullet list of weaknesses.
Revised plan: { index, semantic_query, filters, fallbacks: [...] }
Stop condition: <one sentence>

CONSTRAINTS:
- The critique must find at least two concrete weaknesses or state none plausibly exist with justification.
- Filters must use only the listed metadata fields.
- Plan only; do not fabricate retrieval results.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Self-Critique

Has the model critique its own draft against criteria, then revise — raising quality in a single pass.

Learn this technique
Tree-of-Thoughts

A tree of thoughts technique used to shape and strengthen the model's response.

ReAct

A react technique used to shape and strengthen the model's response.

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in RAG & Knowledge Retrieval