Skip to main content

Four Agent Architectures

Tesslate Studio provides four agent types, each built on the AbstractAgent 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

1

Receive Request

You describe what you want to build.
2

Build Prompt

The system prompt and your message are sent to the LLM.
3

Stream Response

The LLM response streams token by token to the chat interface.
4

Extract Code Blocks

The agent detects code blocks with file markers (e.g., // File: src/App.jsx) and extracts them.
5

Save Files

Extracted code blocks are saved to your project automatically.

File Marker Formats

StreamAgent recognizes these patterns inside code blocks:
// File: src/components/Button.jsx    (JavaScript/TypeScript comment)
# File: config/settings.py            (Python comment)
<!-- File: public/index.html -->       (HTML comment)

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

1

Receive Request

You describe your task. The agent builds the system prompt with tool descriptions and context.
2

LLM Call

The message history is sent to the LLM. The response includes a THOUGHT section and tool calls in JSON format.
3

Parse Tool Calls

The agent parses JSON tool calls from the response text. Both single objects and arrays are supported.
4

Execute Tools

Each tool call is executed through the ToolRegistry, which checks edit mode permissions and handles approval flows.
5

Feed Results Back

Tool results are appended to the message history and sent back to the LLM for the next iteration.
6

Check Completion

The loop continues until the agent signals TASK_COMPLETE, produces no more tool calls, or reaches resource limits.

Tool Calling Format

IterativeAgent uses JSON-in-text for tool calls:
THOUGHT: I need to read the file to understand the current implementation.

{
  "tool_name": "read_file",
  "parameters": {
    "file_path": "src/App.jsx"
  }
}
Multiple tool calls can be batched in an array:
THOUGHT: I will read the component and check the package dependencies.

[
  {
    "tool_name": "read_file",
    "parameters": {"file_path": "src/App.jsx"}
  },
  {
    "tool_name": "bash_exec",
    "parameters": {"command": "cat package.json"}
  }
]

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

1

Receive Request

Same initialization as IterativeAgent, with additional ReAct-specific instructions in the system prompt.
2

THOUGHT (Reasoning)

The agent must produce a THOUGHT section explaining its reasoning before any action. This is mandatory, not optional.
3

ACTION (Tool Calls)

Tool calls are parsed and executed, same as IterativeAgent.
4

OBSERVATION (Results)

Tool results are formatted as numbered observations with clear success/failure indicators and content previews.
5

Repeat Until Done

The Thought, Action, Observation cycle continues until the agent concludes the task is complete.

Observation Format

Tool results in ReActAgent are formatted as structured observations:
Observation:

1. read_file: Success
   message: Read 245 bytes from 'src/App.jsx'
   content:
   | import React from 'react';
   | import { BrowserRouter, Routes, Route } from 'react-router-dom';
   | ...

2. bash_exec: Success
   message: Executed 'cat package.json'
   output:
   | {
   |   "dependencies": {
   |     "react": "^18.0.0"
   |   }
   | }

Key Difference from IterativeAgent

AspectIterativeAgentReActAgent
ReasoningOptional THOUGHT sectionsMandatory THOUGHT sections (enforced in prompt)
Result FormatStandard tool resultsStructured Observations
Prompt StyleAction-focusedThought-focused
Token UsageMediumHigher (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

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.
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.py and trajectory_writer.py record every agent step (tool calls, results, reasoning) for debugging, analytics, and replay. Trajectories are stored persistently.
plan_manager.py manages plan state when the agent operates in plan mode, creating structured plans before executing changes.
compaction.py handles automatic compaction of long conversation contexts to stay within token limits while preserving essential information.
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

FeatureStreamAgentIterativeAgentReActAgentTesslateAgent
Tool SupportNoYes (JSON-in-text)Yes (JSON-in-text)Yes (native function calling)
IterationSingle passMulti-step loopMulti-step loopMulti-step loop
Error RecoveryNoneAutomatic retryAutomatic retryRetry + context compaction
ReasoningImplicitOptionalMandatory / explicitFlexible
Approval ModeN/ASupportedSupportedSupported
Planning ModeNoNoNoYes
SubagentsNoNoNoYes
TrajectoryNoNoNoYes
Context CompactionNoNoNoYes
SpeedFastestModerateModerateModerate
Token UsageLowMediumHighMedium
Best ForQuick generationGeneral tasksComplex reasoningProduction development

Choosing the Right Agent

  • 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

Fast visual iteration:
  1. “Create a login form with email and password fields, a gradient background, and an orange submit button”
  2. “Add a ‘Forgot Password’ link below the form”
  3. “Make the form card have rounded corners and a shadow”
Good for getting the UI built quickly.

Switching Between Agents

You can switch agents at any time during a project:
1

Open Agent Selector

Click the agent dropdown in the chat interface
2

Choose Agent

Select a different agent from your enabled agents
3

Continue Working

Each agent maintains its own chat context. Switch as often as you need.
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