Simple & Reflection Agents
Where the legacy SimpleAgent and ReflectionAgent node types went, and how to build single-call and self-review agents with the unified Agent node.
Earlier Dynamiq versions shipped three agent node types: ReAct Agent, Simple Agent (dynamiq.nodes.agents.SimpleAgent), and Reflection Agent (dynamiq.nodes.agents.ReflectionAgent). They have been unified: there is now a single Agent node that covers all three behaviors. This page explains what changed, how to migrate, and how to get "simple" and "reflection" behavior from the unified agent.
What changed
- The Python SDK merged the separate classes into one
Agentclass (from dynamiq.nodes.agents import Agent).SimpleAgent,ReflectionAgent, andReActAgentwere kept as aliases ofAgentfor one transition period and have since been removed — importing them now fails. - The Workflow canvas offers only the Agent node. The legacy node types no longer appear in the node menu.
- Traces from older runs still render correctly: the trace viewer recognizes the deprecated
SimpleAgent,ReflectionAgent, andReActAgentnode types and displays them as agent nodes, so historical runs stay readable.
Nothing was lost in the merge. SimpleAgent was literally the base agent with a different default name, and ReflectionAgent was the base agent with a built-in self-reflection instruction block — both behaviors are reproducible with plain configuration, shown below.
Which agent setup do you need?
| You want | Use | Why |
|---|---|---|
| One model call with a prompt you fully control | LLM node | No loop, no agent instructions — cheapest and most predictable. Supports saved Prompts. |
| A conversational agent: role, memory, structured output — but no tools | Agent node with an empty tool list | The agent detects it has no tools and switches to direct-answer instructions (one reasoning pass, no action protocol). You keep memory, streaming, files, and Response format. |
| Visible self-critique before the final answer | Agent node + reflection instructions | The legacy ReflectionAgent's behavior, recreated with the role/instructions fields (recipe below). |
| Tasks that need tools, search, or multiple steps | Agent node with tools | The full ReAct loop — see The Agent Node. |
| Several specialized agents cooperating | Agent with sub-agents or an orchestrator | Keep each agent's role and tool list small. |
Simple agent: an Agent without tools
Attach no tools and the Agent node behaves like the old SimpleAgent. Its system prompt switches to a no-tools instruction set — the model is told to reason (Thought:) and answer (Answer:) directly, and explicitly told not to mention tools or actions — so a typical run is a single reasoning pass rather than a tool loop.
from dynamiq.connections import OpenAI as OpenAIConnection
from dynamiq.nodes.agents import Agent
from dynamiq.nodes.llms import OpenAI
agent = Agent(
name="writing-assistant",
llm=OpenAI(connection=OpenAIConnection(), model="gpt-4o"),
role=(
"You are a precise technical writing assistant. Rewrite the user's text "
"for clarity, keep their meaning, and explain your most significant edit."
),
max_loops=2,
)
result = agent.run(
input_data={"input": "Pls rewrite: the system do retries automatic when error happen."}
)
print(result.output["content"])max_loops has a minimum of 2 — with no tools, the spare iteration is only consumed if the first reply fails to parse and the agent retries. Everything else on the node works as usual: enable memory for multi-turn chat, set a Response format for structured answers, or turn on streaming.
If you do not need a role, memory, or structured output, prefer a plain LLM node over a tool-less agent — it skips the agent instruction overhead entirely and gives you full control of the prompt.
Reflection agent: self-review via instructions
The legacy ReflectionAgent injected an instruction block that made the model think inside <thinking> tags, write <reflection> passes that question that thinking, then produce the final text in <output> tags — and returned only the output. You can reproduce the pattern with the unified Agent's instructions field:
from dynamiq.connections import OpenAI as OpenAIConnection
from dynamiq.nodes.agents import Agent
from dynamiq.nodes.llms import OpenAI
REFLECTION_INSTRUCTIONS = (
"Before giving your final answer, reason step by step about the request. "
"Then write one or more reflection passes in which you challenge your own "
"reasoning: list the possibilities you considered, look for mistakes or "
"ambiguities, and resolve them. Only after reflecting, produce the final "
"answer. The final answer must be self-contained and must not mention the "
"reflection process."
)
agent = Agent(
name="careful-analyst",
llm=OpenAI(connection=OpenAIConnection(), model="gpt-4o"),
role="You analyze contracts and flag risky clauses for a procurement team.",
instructions=REFLECTION_INSTRUCTIONS,
max_loops=2,
)
result = agent.run(
input_data={
"input": "Clause: 'Vendor may modify service levels at its sole discretion.' Risky?"
}
)
print(result.output["content"])In the UI, append the same guidance to Role & Instructions. The trade-off is unchanged from the old node type: reflection spends extra tokens on every answer, so reserve it for tasks where a wrong first draft is expensive — analysis, review, scoring — not for chit-chat.
For reflection across steps rather than within one answer, give a parent agent a reviewer sub-agent, or use an orchestrator — see Subagents & Delegation.
Migrating old code and workflows
| Before | Now |
|---|---|
from dynamiq.nodes.agents import SimpleAgent | from dynamiq.nodes.agents import Agent — drop tools |
from dynamiq.nodes.agents import ReflectionAgent | Agent + reflection instructions (above) |
from dynamiq.nodes.agents import ReActAgent | Agent — same configuration fields |
| Simple Agent / Reflection Agent node in an old workflow | Replace with an Agent node; copy the role over |
Constructor fields you already used — llm, role, memory, streaming — carry over unchanged, since the legacy classes were subclasses of the same base agent.
Next steps
File Store & Artifacts
Give your agent a file workspace without a full sandbox — file read/write/search tools, todo lists, and how files flow in and out of a run.
Orchestration Overview
Choose the right coordination pattern — a single Agent, the Graph Orchestrator, legacy Linear/Adaptive orchestrators, or deterministic Choice and Map operators.