Four Agent Architectures
Tesslate Studio provides four agent types, each built on theAbstractAgent base class. They share a common interface (run() method, system prompt, optional tool registry) but differ in how they interact with the LLM and execute tasks.
StreamAgent
Single-pass streaming. One LLM call, no tools. Fastest and cheapest.
IterativeAgent
Multi-step tool loop. Think, Act, Observe cycle with JSON tool calls.
ReActAgent
Explicit reasoning. Mandatory THOUGHT sections before every action.
TesslateAgent
Production default. Native function calling, subagents, trajectory, compaction.
StreamAgent
StreamAgent makes a single LLM call and streams the response directly to you. It does not use tools; instead, it extracts code blocks from the response and saves them as files.How It Works
Extract Code Blocks
The agent detects code blocks with file markers (e.g.,
// File: src/App.jsx) and extracts them.File Marker Formats
StreamAgent recognizes these patterns inside code blocks:When to Use StreamAgent
Quick UI Generation
Landing pages, component scaffolding, layout prototyping
One-Shot Creation
Generating a single file or component from scratch
Cost Optimization
Lowest token usage of any agent type
Speed Priority
When you need results instantly and can iterate manually
Limitations
- No tool calling (cannot execute shell commands or read existing files)
- No iterative refinement (single pass only)
- No error recovery
- Limited to code block extraction for file creation
IterativeAgent
IterativeAgent runs a multi-step loop. It sends a request to the LLM, parses tool calls from the JSON in the response, executes them, feeds results back, and repeats until the task is complete.How It Works
Receive Request
You describe your task. The agent builds the system prompt with tool descriptions and context.
LLM Call
The message history is sent to the LLM. The response includes a THOUGHT section and tool calls in JSON format.
Parse Tool Calls
The agent parses JSON tool calls from the response text. Both single objects and arrays are supported.
Execute Tools
Each tool call is executed through the ToolRegistry, which checks edit mode permissions and handles approval flows.
Feed Results Back
Tool results are appended to the message history and sent back to the LLM for the next iteration.
Tool Calling Format
IterativeAgent uses JSON-in-text for tool calls:Error Recovery
When a tool call fails, IterativeAgent automatically retries with corrected parameters. It appends retry instructions to the message history and forces the next iteration.Resource Limits
To prevent infinite loops, IterativeAgent enforces configurable limits:- Max iterations: 25 (default)
- Max tool calls: 100 (default)
- Per-run cost limit: $5.00
When to Use IterativeAgent
Multi-Step Tasks
Installing packages, creating files, running tests
File Operations
Reading, editing, and writing multiple files
Shell Commands
Running builds, tests, git operations
General Development
Most day-to-day coding tasks
ReActAgent
ReActAgent implements the ReAct (Reasoning + Acting) paradigm from the research paper ReAct: Synergizing Reasoning and Acting in Language Models. It enforces explicit reasoning before every action.How It Works
Receive Request
Same initialization as IterativeAgent, with additional ReAct-specific instructions in the system prompt.
THOUGHT (Reasoning)
The agent must produce a THOUGHT section explaining its reasoning before any action. This is mandatory, not optional.
OBSERVATION (Results)
Tool results are formatted as numbered observations with clear success/failure indicators and content previews.
Observation Format
Tool results in ReActAgent are formatted as structured observations:Key Difference from IterativeAgent
| Aspect | IterativeAgent | ReActAgent |
|---|---|---|
| Reasoning | Optional THOUGHT sections | Mandatory THOUGHT sections (enforced in prompt) |
| Result Format | Standard tool results | Structured Observations |
| Prompt Style | Action-focused | Thought-focused |
| Token Usage | Medium | Higher (due to verbose reasoning) |
When to Use ReActAgent
Complex Debugging
When you need the agent to reason step by step through a problem
Architecture Decisions
Planning and evaluating design options before acting
Auditable Reasoning
When you want to see and verify the agent’s thought process
Investigation Tasks
Tracing issues across multiple files and dependencies
TesslateAgent
TesslateAgent is the full-featured production agent. It uses native LLM function calling instead of parsing JSON from text, and adds several advanced capabilities on top of the base agent system.Key Capabilities
Native Function Calling
Native Function Calling
Uses
tool_converter.py to transform tool definitions into the provider’s native format (Anthropic tool_use, OpenAI function_calling). The LLM returns structured tool calls directly, which eliminates JSON parsing errors.Subagent System
Subagent System
Managed by
subagent_manager.py, TesslateAgent can spawn specialized sub-agents for focused tasks. Subagents are configured per-agent in the marketplace and have their own turn limits (default: 100 turns per invocation).Trajectory Recording
Trajectory Recording
trajectory.py and trajectory_writer.py record every agent step (tool calls, results, reasoning) for debugging, analytics, and replay. Trajectories are stored persistently.Planning Mode
Planning Mode
plan_manager.py manages plan state when the agent operates in plan mode, creating structured plans before executing changes.Context Compaction
Context Compaction
compaction.py handles automatic compaction of long conversation contexts to stay within token limits while preserving essential information.Apply Patch
Apply Patch
apply_patch.py provides a unified diff-based file editing tool as an alternative to search/replace patches.When to Use TesslateAgent
TesslateAgent is the recommended default for most tasks. Use it when:- You need reliable tool calling without JSON parsing issues
- Tasks are complex and may benefit from subagent delegation
- You want trajectory data for debugging or analytics
- Long conversations require context compaction
- You need planning mode support
Full Comparison Table
| Feature | StreamAgent | IterativeAgent | ReActAgent | TesslateAgent |
|---|---|---|---|---|
| Tool Support | No | Yes (JSON-in-text) | Yes (JSON-in-text) | Yes (native function calling) |
| Iteration | Single pass | Multi-step loop | Multi-step loop | Multi-step loop |
| Error Recovery | None | Automatic retry | Automatic retry | Retry + context compaction |
| Reasoning | Implicit | Optional | Mandatory / explicit | Flexible |
| Approval Mode | N/A | Supported | Supported | Supported |
| Planning Mode | No | No | No | Yes |
| Subagents | No | No | No | Yes |
| Trajectory | No | No | No | Yes |
| Context Compaction | No | No | No | Yes |
| Speed | Fastest | Moderate | Moderate | Moderate |
| Token Usage | Low | Medium | High | Medium |
| Best For | Quick generation | General tasks | Complex reasoning | Production development |
Choosing the Right Agent
- Use StreamAgent When
- Use IterativeAgent When
- Use ReActAgent When
- Use TesslateAgent When
- You want instant results
- The task is straightforward (create a component, generate a config)
- No shell commands are needed
- Cost optimization is a priority
- You are prototyping and will refine manually
Example Workflows
Building a Login Page
- StreamAgent Approach
- IterativeAgent Approach
- TesslateAgent Approach
- Combined Approach
Fast visual iteration:
- “Create a login form with email and password fields, a gradient background, and an orange submit button”
- “Add a ‘Forgot Password’ link below the form”
- “Make the form card have rounded corners and a shadow”
Switching Between Agents
You can switch agents at any time during a project:A common workflow: use StreamAgent for initial UI scaffolding, switch to IterativeAgent or TesslateAgent for adding functionality, then switch back to StreamAgent for visual polish.
Next Steps
Using Agents
Practical guide to chatting with agents
Customizing Agents
Create and configure custom agents
Agent Marketplace
Discover specialized agents
AI Agents Overview
Return to core concepts