Advanced Prompting — ReAct & Tree-of-Thought
ReAct, Tree-of-Thought, meta-prompting techniques
Once you have mastered basic prompting and chain of thought, the next level involves techniques that fundamentally change how AI approaches problems. ReAct, Tree of Thought, meta-prompting, and prompt chaining are used by AI engineers building production systems — but they are equally valuable for individual users who want the most out of their AI interactions.
What You'll Learn
- ReAct: combining reasoning with real-world actions
- Tree of Thought: exploring multiple solution paths simultaneously
- Meta-prompting: using AI to improve your prompts
- Prompt chaining: breaking complex tasks into connected steps
- Role-playing prompts: specialized personas for domain expertise
ReAct — Reasoning + Acting
ReAct (Reasoning + Acting) is a technique where the model alternates between reasoning steps and taking actions (searching, calculating, retrieving information) before giving a final answer.
In a standard ReAct-enabled system (like Perplexity or Claude with tools), the model:
- Thinks about what information it needs
- Acts — searches the web, calls an API, reads a file
- Observes the result
- Thinks again about what the result means
- Repeats until it has enough to answer
ReAct prompt (for models with tool access):
Research the current market share of Indian payment apps (PhonePe, Paytm, Google Pay, Amazon Pay) and calculate which one has grown the most in the last 12 months.
Use this ReAct approach:
1. First, search for current market share data
2. Search for data from 12 months ago
3. Calculate growth percentages
4. Present your findings with the sources you used
ReAct for research tasks (Perplexity is ideal): When using Perplexity, it automatically uses a ReAct-like approach — searching multiple sources and synthesizing them. Structure your prompt to encourage multi-step research:
Research this question thoroughly:
What are the actual requirements and typical success rates for Indian startups applying to Y Combinator?
Please:
1. Check YC's official requirements
2. Find data on Indian YC companies (how many per batch)
3. Look for founder accounts of what worked in their applications
4. Synthesize a practical answer with your sources
🇮🇳 India Note: ReAct is particularly powerful for Indian regulatory research — topics like GST rates, DPDP Act compliance, SEBI regulations — where information changes frequently and you need current, cited sources rather than potentially outdated training data.
Tree of Thought — Exploring Multiple Paths
Tree of Thought (ToT) prompting asks the model to generate multiple different solution approaches, evaluate each, and then pursue the most promising one. It is like having the AI think in parallel paths rather than one linear chain.
When to use ToT:
- Complex problems where you are not sure the obvious approach is best
- Creative tasks where you want genuinely different options
- Decision-making with multiple valid paths
- Architecture and design decisions
ToT prompt structure:
Consider this problem: [describe your problem]
Step 1 — Generate 3 different approaches to solving this.
For each approach, write it out as "Approach A: ...", "Approach B: ...", "Approach C: ..."
Step 2 — For each approach, list 2 pros and 2 cons.
Step 3 — Based on the analysis, recommend which approach is best for [your specific context] and why.
Step 4 — Implement the recommended approach.
Example — Architecture decision:
Problem: I am building a feature that sends SMS notifications to Indian mobile users when their order status changes. Currently I have about 1,000 orders/day but expect to scale to 50,000/day.
Step 1: Generate 3 different architectural approaches for this SMS notification system.
Step 2: Evaluate each for: reliability, cost at scale, implementation complexity, and India-specific factors (carrier support, delivery rates).
Step 3: Recommend the best approach for a startup with a 3-person engineering team targeting 50,000 messages/day in 6 months.
Step 4: Outline the implementation steps for the recommended approach.
Meta-Prompting — Using AI to Improve Your Prompts
Meta-prompting means using the AI to critique and improve your prompts before using them. It is a form of self-reflection where the model acts as a prompt engineer.
Basic meta-prompt:
I want to ask an AI this question, but I think my prompt could be improved.
My current prompt: "[paste your prompt]"
Please:
1. Identify weaknesses in this prompt (what is vague, missing, or likely to produce bad results)
2. Rewrite it as a more effective prompt
3. Explain what changes you made and why
Before/After example:
Original prompt: "Write me a marketing plan"
Meta-prompt result critique:
- Too vague — no target audience, no product, no budget, no timeframe
- No context about the market or competition
- No format specified — the AI will guess what structure you want
- No goal specified — brand awareness vs conversion vs retention are different
Improved prompt:
Write a 3-month digital marketing plan for a B2C SaaS product targeting small business owners in India.
Product: An invoicing and GST billing tool for businesses with revenue ₹10L-₹5Cr/year.
Budget: ₹50,000/month for paid channels.
Goal: 500 free trial signups in 3 months.
Current state: Product launched, 50 users, no paid marketing yet.
Plan should include:
- Channel mix (which platforms, why)
- Monthly budget allocation
- 3 key performance metrics to track
- Week 1 action items
Keep each section brief and actionable.
Automated meta-prompting workflow:
- Write your initial prompt
- Send it to Claude or GPT with "Critique this prompt and improve it"
- Use the improved version for your actual task
- Repeat for prompts you use regularly
Prompt Chaining — Breaking Complex Tasks Apart
Prompt chaining connects a series of prompts where each output becomes the input for the next. It handles complex tasks that would be too vague to ask in a single prompt.
Example chain — Writing a case study:
Step 1:
List 5 specific, compelling aspects of this company story that would resonate with Indian entrepreneurs:
[paste company background]
Step 2 (using output from Step 1):
Using these 5 aspects, write a brief outline for a 1,200-word case study:
[paste the 5 aspects from Step 1]
Structure: Challenge → Approach → Result → Lessons Learned
Step 3 (using outline from Step 2):
Write the full case study based on this outline, in a journalistic style:
[paste outline from Step 2]
Include: specific metrics, quotes where appropriate, and actionable insights for the reader.
Why chain works better than one big prompt:
- Each step is focused and produces higher quality output
- You can review and adjust between steps
- If one step produces a poor result, you fix only that step
- The final output benefits from accumulated context and quality
Role-Playing Prompts — Specialized Personas
Assigning a specific role to the AI activates domain-specific knowledge and the appropriate communication style for that expert.
Basic role assignment:
You are an expert [role] with [years] years of experience in [field].
Your specialty is [specific area].
Advanced role with constraints:
You are a SEBI-registered investment advisor in India with 15 years of experience.
You specialize in: retail investor education, mutual fund analysis.
You adhere to SEBI's guidelines, which means you:
- Never give specific buy/sell recommendations for individual stocks
- Always disclose when a topic is outside your expertise
- Always recommend consulting a SEBI-registered advisor for personal decisions
In this role, explain [topic].
Multi-role debate (useful for decisions):
I need to evaluate whether to [decision].
Please argue this from three different perspectives:
As a conservative CFP (financial planner) in India:
[argument from this perspective]
As a growth-focused venture capitalist:
[argument from this perspective]
As someone who just made this decision and regrets it:
[argument from this perspective]
After all three arguments, give me your own balanced view.
Combining Techniques
These techniques combine powerfully. A sophisticated prompt might use:
- Role-playing to establish domain expertise
- Chain of Thought to ensure reasoning is shown
- Tree of Thought to explore multiple paths
- Few-Shot examples to define output format
You are a senior system architect with 15 years of experience in distributed systems.
(Role-playing)
A startup is asking you to design a scalable notification system.
Think step by step through this problem.
(Chain of Thought)
Generate 3 distinct architectural approaches.
For each, evaluate tradeoffs in: scalability, cost, complexity, and reliability.
Then recommend the best approach with justification.
(Tree of Thought)
Format your response like this example:
Approach A: [Name]
- Architecture: [description]
- Pros: [2-3 bullets]
- Cons: [2-3 bullets]
(Few-Shot format)
Official Resources
- ReAct Paper — Original ReAct research by Shunyu Yao et al.
- Tree of Thought Paper — Original ToT research
- Learn Prompting — Advanced — Free advanced prompting guide
- Anthropic Prompt Engineering — Claude-specific advanced techniques
- Prompt Engineering Guide — Comprehensive open-source reference
Community Questions
0No questions yet. Be the first to ask!