dspy-react

Installation
SKILL.md

Build Tool-Using Agents with dspy.ReAct

Guide the user through building agents that reason step-by-step and call tools to accomplish tasks. dspy.ReAct implements the Reasoning-Action-Observation loop -- the agent thinks about what to do, calls a tool, observes the result, and repeats until it has an answer.

What is ReAct

dspy.ReAct implements the Reasoning-Action-Observation loop as an optimizable module. The agent reasons about what to do, calls a tool, observes the result, and repeats until it has enough information to answer. DSPy handles the loop mechanics and prompt construction.

When to use ReAct

Use ReAct when... Use something else when...
The agent needs to call external tools (search, APIs, databases) You just need input -> output with no tools (dspy.ChainOfThought)
Multi-step reasoning with real-world data The task is purely computational / code-heavy (dspy.CodeAct)
You want the agent to decide which tools to call and in what order You have a fixed pipeline of steps (dspy.Module with sub-modules)
You need an interpretable trace of reasoning + actions You need agents coordinating with each other (see /ai-coordinating-agents)

Defining tools

Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
4
GitHub Stars
5
First Seen
Mar 17, 2026