Agent definition
An agent is a JSON document: a set of named functions, each an ordered list of commands. Wherever a value has to be computed, the document uses a Python expression.
- SyntaxAgents are written in JSONC: JSON with comments. Every value keeps its JSON meaning, with one extension: a string enclosed in braces is a Python expression.
- Python expressionsAn agent is written in JSON. The string values in that JSON can be Python expressions; a key cannot. This page explains what Search2o does with an expression…
- Agent structureThe top-level object of a definition holds a set of named functions. Each function is an ordered object of commands, the units of execution. The rest of an a…
- FunctionsAn agent is a collection of functions. When a function is called, it runs its commands in order. Besides commands, a function may declare arguments, a descri…
- CommandsThere are 20 commands. Together they cover the agentic workflow: variables, flow control, progress, termination, external systems, LLMs, the user, and output.
- PromptsA prompt is what an llm command sends to a model: a system text, a user text, and the history of the exchange so far. Prompts are part of the agent meta, not…
- ConstThe const is a JSON object of fixed values for one agent: product names, tone of voice, thresholds, lists of categories, example texts, and any text that is …
- VariablesThere are three kinds of variables, with three scopes: local, agent and conversation. Two more names, result and exc, are set by the runtime. The read-only n…
- NamespacesBesides its variables, an agent reads three namespaces the runtime provides: the const, sys and the current command. They are read-only: an agent cannot assi…

