Skip to content
LogoLogo

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:

KindPurpose
psychePersistent instructions that shape agent behavior
skillKnowledge and instructions the agent can load when needed
serviceExternal tools available through MCP
promptReusable 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

TaskCommandGuide
Create a local agenttoolang new aliceCreate and run agents
Chat in the terminaltoolang alice chatChat in the terminal
Try a shared agenttoolang https://toolang.ai/dev.too chatQuickstart
Invoke a script runnabletoolang helpers.too summarize -- your inputRun agentic scripts
Start an agent servertoolang start aliceCreate 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.

© 2026 Toolang