toolang
Toolang is a language and runtime for agents and humans. A .too file describes
reusable agent loops, workflows, and the capabilities they use.
Start with the Quickstart to create an agent and chat in your
terminal. You can use Toolang before writing any .too code.
Language
Agics
An agic is Toolang's counterpart to a function in traditional programming. It describes an agent loop with inputs, an output, context, instructions, and permitted resources.
instruct summary:
Write a concise summary in three bullets.
agic summarize(_) -> Text:
instruct = summary
user: {{_}}Here, _ is the primary input and Text is the output type. The runtime renders
the instructions and messages, then runs the model and its tool calls until the
agic finishes. Resource directives such as tools = fs/read can restrict which
tools the agic may use.
Flows
A flow organizes agics into an executable method. Each operation receives the current value; its result becomes the value for the next operation.
flow brief(_) -> Text:
scatter -> Text[]:
Extract the key findings from {{_}} as a list.
map using -> Text:
Explain this finding in one sentence: {{_}}
gather using -> Text:
Combine these findings into a short brief: {{_}}Flows support named agics and flows as well as inline agics. They can map, filter, sort, combine results, and repeat work. The runtime executes the operations; each agic supplies the judgment required by its part of the work.
Caps
Caps are composable agent primitives:
| Kind | Purpose |
|---|---|
psyche | Persistent instructions that shape agent behavior |
skill | Knowledge and instructions the agent can load when needed |
service | External tools available through MCP |
prompt | Reusable prompt templates |
A cap can be defined inline or referenced from a remote source with with:
with skill briceyan/review
psyche concise:
Prefer direct answers and practical examples.
agic:
user: {{_}}See the grammar reference for the language and
coding conventions for guidance on writing
.too files.
Runtime
| Task | Command | Guide |
|---|---|---|
| Create a local agent | toolang new alice | Create and run agents |
| Chat in the terminal | toolang alice chat | Chat in the terminal |
| Try a shared agent | toolang https://toolang.ai/dev.too chat | Quickstart |
| Invoke a script runnable | toolang helpers.too summarize -- your input | Run agentic scripts |
| Start an agent server | toolang start alice | Create and run agents |
The runtime resolves the agent source and caps, loads models and tools, and
records execution history. agic and flow declarations are both runnables:
they can be selected in Chat or invoked through a script's generated CLI.
Use toolang --help to explore the commands.