Skip to main content
Agents can create and run scripts to automate complex tasks efficiently.

Why Scripts?

Instead of using the LLM to process data step by step, agents can write code to process data. This has massive impact on:
BenefitDescription
SpeedCode executes instantly vs. LLM token-by-token processing
CostOne script execution vs. thousands of LLM calls
ReliabilityDeterministic code vs. probabilistic LLM outputs

How It Works

1

Agent identifies repetitive task

When an agent sees it needs to process data repeatedly, it can write a script.
2

Agent writes the code

The agent generates code to handle the task.
3

Script is saved

The script is stored and can be called whenever needed.
4

Agent executes on demand

Future runs use the saved script instead of LLM processing.

Example Use Cases

Import data from a spreadsheet and store in a database. Instead of processing each row with the LLM, a script handles the transformation.
Complex calculations (interest rates, tax computations, currency conversions) are best done by code, not LLM calls.
Convert between formats, clean data, or merge datasets efficiently.
Process hundreds or thousands of records quickly and consistently.
Scripts are particularly useful when:
  • Processing large volumes of data
  • Performing precise calculations
  • Transforming data between formats
  • Executing the same logic repeatedly

Script Management

  • Scripts are versioned alongside agent instructions
  • You can view, edit, and test scripts manually
  • Agents can update scripts as requirements change