Skip to main content

Canvas Agents

A canvas agent is a canvas-kind agent that powers chart generation on a Canvas. Chart generation uses your own LLM API key (BYOK) — TARX never bills you for canvas tokens.

Creating a Canvas Agent

  1. Go to AgentsNew Agent
  2. Set Agent Kind to Canvas
  3. Choose your preferred model (Claude, GPT-4o, Gemini, etc.)
  4. Select your API key for that provider
  5. The System Prompt is pre-filled with the ECharts expert template — customize if needed
ModelWhy
claude-sonnet-4-6Best JSON fidelity, rarely truncates large ECharts configs
gpt-4oFast, reliable JSON output
gemini/gemini-2.0-flashCost-efficient for high-volume generation

Canvas Agent Defaults

When you create a canvas-kind agent, these execution defaults are applied:

SettingValueReason
Max Tokens16,000ECharts configs with data can be large
Timeout120sAllows time for complex chart generation
Max Continuations1Single-call generation (no multi-turn)
Context StrategytruncateNo session history needed

Attaching an Agent to a Canvas

At Creation

The canvas creation modal requires a canvas agent. The dropdown shows only canvas-kind agents. You cannot create a canvas without selecting one.

In the Canvas Editor

The agent indicator in the Canvas editor top bar shows the currently attached agent. Click it to open a dropdown and switch to a different canvas agent.

  • Green/purple: agent configured
  • Orange ⚠: no agent — chart generation is disabled until you configure one

The System Prompt

The pre-filled system prompt instructs the agent to:

  • Return a valid Apache ECharts option JSON object (no markdown, no fences)
  • Select the optimal chart type for each data relationship
  • Apply dark-theme styling (purple palette, dark tooltips)
  • Respect label length rules (≤20 chars for axis labels)
  • Use value_counts and histogram_bins from the schema as chart data

You can customize the system prompt to change default chart styles, color palettes, or add domain-specific rules.

The Canvas Skill (automatic)

When you create an agent with kind: canvas, TARX automatically assigns the built-in canvas-expert skill and locks it — the skill picker is hidden for canvas agents. You don't choose it manually; every canvas agent gets the same ECharts-expert instructions merged into its prompt. (The runtime chart generation also uses TARX's built-in ECharts prompts, so JSON fidelity is consistent regardless of the model you pick.)

Why BYOK for Canvas

TARX's platform LLM is used for Bridge (orchestration chat). Canvas chart generation is deliberately separated so:

  • You choose the model (not constrained to a platform default)
  • You control costs — high-volume chart generation stays on your bill
  • You can use different models per canvas (one canvas on Claude, another on GPT-4o)