What Are the Agent Types Available in Hello-Agents? A Complete Guide to Simple, Reflection, ReAct, and Plan-and-Solve Agents
Hello-Agents ships with four core agent types—SimpleAgent, ReflectionAgent, ReActAgent, and PlanAndSolveAgent—all inheriting from the abstract base Agent class defined in core/agent.py to provide distinct LLM interaction patterns ranging from basic conversation to iterative self-reflection and strategic planning.
The hello-agents repository by Datawhale China provides a lightweight, extensible toolkit for building language model applications. Understanding the specific agent types available in hello-agents is essential for selecting the right architecture for your task, whether you need straightforward question answering or complex multi-step reasoning workflows.
SimpleAgent: Direct Conversational Interface
SimpleAgent implements the most straightforward interaction pattern: a conversational agent that optionally invokes registered tools while maintaining message history.
Located in agents/simple_agent.py, this agent type is ideal for quick Q&A tasks, customer support chatbots, or scenarios requiring minimal tool usage like calculator or search calls. It accepts a system_prompt, an llm instance (HelloAgentsLLM), and exposes the standard run(input_text, **kwargs) → str interface that returns the final assistant response.
from agents.simple_agent import SimpleAgent
from core.llm import HelloAgentsLLM
llm = HelloAgentsLLM(provider="openai", model="gpt-4")
simple = SimpleAgent(name="ChatBot", llm=llm, system_prompt="You are a helpful assistant.")
response = simple.run("What is the capital of France?")
print(response)
ReflectionAgent: Iterative Self-Correction
ReflectionAgent implements a self-reflective workflow where the LLM critiques its own output and iteratively refines the answer until reaching satisfactory quality or exhausting the maximum iteration limit.
Defined in agents/reflection_agent.py, this pattern excels at tasks requiring progressive improvement such as code generation, report writing, or complex analysis. The agent runs an initial pass, requests a critique from the LLM, then refines the response, repeating this cycle up to max_iterations times.
from agents.reflection_agent import ReflectionAgent
reflex = ReflectionAgent(name="Reflex", llm=llm, max_iterations=3)
final = reflex.run("Write a short summary of the novel *Dune*.")
print(final)
ReActAgent: Interleaved Reasoning and Action
ReActAgent realizes the ReAct (Reason → Act) paradigm, where the LLM produces explicit reasoning steps and tool calls within the same response stream, observing results before continuing.
Implemented in agents/react_agent.py, this agent type suits scenarios requiring interleaved reasoning and external tool execution, such as multi-step web research or data retrieval tasks. The agent parses its own reasoning, executes actions via the tool registry, and incorporates observations back into the context before proceeding to the next thought.
from agents.react_agent import ReActAgent
react = ReActAgent(name="ReActBot", llm=llm, system_prompt="You can browse the web.")
result = react.run("Find the latest COVID-19 statistics for Italy.")
print(result)
PlanAndSolveAgent: Strategy Before Execution
PlanAndSolveAgent (also referenced as Plan-and-Solve) first prompts the LLM to generate a high-level plan, then executes that plan step-by-step with optional tool invocation.
Found in agents/plan_solve_agent.py, this approach benefits problems where strategic overview improves execution quality, such as project planning, workflow automation, or multi-stage data processing pipelines. The separation between planning and execution phases helps maintain coherence in complex, multi-step tasks.
from agents.plan_solve_agent import PlanAndSolveAgent
planner = PlanAndSolveAgent(name="Planner", llm=llm)
plan_result = planner.run("Create a weekly workout schedule for a beginner.")
print(plan_result)
Core Architecture and Shared Behavior
All four agent types inherit from the abstract Agent base class in core/agent.py and share consistent interfaces:
- Initialization: Each accepts
name,llm(aHelloAgentsLLMinstance), and optionalsystem_promptparameters - Execution: All implement
run(input_text, **kwargs) → strto process inputs and return string responses - State management: They maintain internal message history via
core/message.pydata structures, accessible viaagent.get_history() - Extensibility: Agents can be composed (e.g., a
ReflectionAgentcan embed aSimpleAgentfor the initial generation pass)
Additional example implementations (such as FashionAgent, MultiAgentCoordinator, and WriterAgent) reside in the Co-creation-projects directories, demonstrating how to assemble custom behaviors atop these four foundational types.
Summary
- SimpleAgent provides direct conversational capability with optional tool calling for quick Q&A tasks.
- ReflectionAgent implements iterative self-critique and refinement loops, ideal for quality-sensitive content generation.
- ReActAgent combines reasoning and action in a single workflow, enabling dynamic multi-step tool usage.
- PlanAndSolveAgent separates strategic planning from execution, improving coherence in complex, multi-stage workflows.
Frequently Asked Questions
How do I choose between the agent types available in hello-agents?
Select SimpleAgent for straightforward conversations with minimal tool usage, ReflectionAgent when output quality requires multiple revision passes, ReActAgent for tasks requiring dynamic decision-making between reasoning steps and tool calls, and PlanAndSolveAgent when a structured plan should precede execution.
Can I combine different hello-agents agent types in a single application?
Yes. Since all agents inherit from the common Agent base class in core/agent.py, they share compatible interfaces. You can compose agents hierarchically—for example, using a ReflectionAgent to refine outputs generated by an embedded SimpleAgent instance.
Where are the agent classes defined in the hello-agents repository?
The base Agent abstract class is located in Co-creation-projects/YYHDBL-HelloCodeAgentCli/core/agent.py. Concrete implementations reside in the agents/ subdirectory: simple_agent.py, reflection_agent.py, react_agent.py, and plan_solve_agent.py.
How do I access the conversation history in hello-agents?
All agent instances automatically record dialogue turns in their internal message history. Retrieve past messages by calling agent.get_history(), which returns the message objects defined in core/message.py.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →