Touba tutorials
Choose a path for your needs. Each tutorial presents the program, required integrations and expected result.
Download runnable examples
Archives include the published tutorial, its source files and a validation runner.
After extraction, read README.txt and run node validate.mjs.
Requirements: Touba, Node.js 24 and a POSIX shell. Python examples also require
Python 3.11+. The crash exercise runs on macOS/Linux.
| Example | Download |
|---|---|
| Package and consumer | Archive |
| JavaScript engine | Archive |
| Python engine | Archive |
| Role-based approval and resume | Archive |
| Lost HTTP response and process crash | Archive |
| Compensation handler contract | Archive |
Each run uses a fresh temporary directory. validation.json records the
installed Touba version/build and assertions completed; provenance.json
identifies the documentation and files. All six examples run locally.
Choose your SDK
| Path | JavaScript | Python |
|---|---|---|
| Call Touba | Engine | Engine |
| Write a handler | Handlers | Handlers |
| Connect a model | Provider | Provider |
Touba programs and contracts are shared by both SDKs. Install Touba and your chosen SDK before starting. Each walkthrough specifies its additional dependencies.
Language basics
- Typed data, constraints and defaults.
- Tutorial - Pure Business Functions.
- Immutable Values with
defineandbind. - Classify typed tickets.
- Tutorial - Strategy, agents and skills.
Agents and models
- Tutorial - Governed Agentic Decision.
- Multi-agent orchestration and bounded parallelism.
- Process a list in parallel.
- Tutorial - Use Native Calls Under Touba Authority.
- Tutorial - JavaScript SDK, engine and decision provider.
- Tutorial - Python SDK, Engine and provider.
SDKs and integrations
- SDK JavaScript: call Touba.
- SDK Python: call Touba.
- SDK JavaScript: write a handler.
- SDK Python: write a handler.
- Tutorial - A public API tool with the Touba SDK.
- Add Touba to Python orchestration.
- Tutorial: a package context and a governed tool.
- Tutorial: create a package and use it in another project.
- Tutorial - Organize a Project with Pure Imports.
- Import a tool from another local module.
Context and memory
- Retain conversation history with SQLite.
- Bound context and understand compaction.
- Tutorial - Scoped memory with an agent.
- Memory with a host backend.
- PostgreSQL memory with an agent and scopes.
- Separate external data from instructions.
Decisions and control
- Tutorial - Human interaction and approval.
- Approval roles, deadlines and escalation.
- Tutorial - Secrets with a dedicated agent.
- Tutorial - Read security refusals.
- Approval before an external effect.
- Governed Real Trigger: Morning Review.
- Tutorial - Bound a Run with Autonomy Budgets.
- Test a monetary budget without paid calls.
- Cancellation, kill switch and run timeout.