Tutorials
Each tutorial builds one working program, step by step, with complete code and the output it produced when it was run. The Platform track works with the platform's own capabilities: your own decision pack, outcome memory, the reasoning service and the learning loop. The example-pack tutorials after it use the built-in data-protection pack to teach the runtime's calls.
Before you start#
- Install the runtime in a virtual environment: Installation.
- Run the Quickstart once, so you know what
evaluate()returns. - Skim Core concepts for the vocabulary: pack, codon, rule, action, remedy, receipt.
- For the hosted tutorials, have your reasoning API endpoint and API key ready. See Escalating to hosted reasoning.
Platform#
These tutorials use the platform directly. The first two run offline with the runtime; the last two call the hosted reasoning API.
Write your own decision pack
Define a decision with a closed set of actions, compile it, serve it and call it from your application.
Available · Tier 0 · 20 minTrack outcomes and confidence
Record outcomes per rule and segment, and route decisions by confidence.
Preview · Hosted · 25 minAsk the reasoning service, and handle abstentions
Typed questions over evidence; act on answers, send abstentions to a person.
Preview · Hosted · 40 minClose the learning loop
Record an override, get a gated proposal, admit it as a new version and roll back.
Working with the example pack#
About the example
These tutorials use the built-in data-protection pack (compliance.regulatory_pii_guard.v1) so you can run everything without writing a pack first. The same calls work for any decision pack: eligibility, limits, routing and so on. See Core concepts.
Every Tier 0 tutorial runs offline with the built-in example pack; no account or license is needed. Tier 1 steps need your Developer license. All examples use the standard test values (123-45-6789, 4111-1111-1111-1111, example.com addresses, 555 numbers); never test with real data.
Make your first decision
Evaluate a list of inputs and branch on every action the pack can return, including dict input.
Tier 0 · Beginner · 20 minGuard a model call
Decide on each prompt and reply around a language model; log receipts, not payloads.
Tier 0 · Intermediate · 30 minDecide on a stream as it arrives
Evaluate a model's reply in flight, apply the remedy, halt on a fatal rule, and store a copy of record.
Building services on the example pack#
Serve decisions to other languages
Call the service from curl, Node and Java, and stream over WebSocket.
Tier 0 · Intermediate · 25 minRun decisions over a batch with an audit trail
Remedy or quarantine each row and write one audit line per row.
Extending and testing the example pack#
Add custom rules
Regex rules in a playbook, compiled with your license and run with the CLI.
Tier 0 / 1 · Intermediate · 30 minTesting policies
A pytest golden set, property checks and a latency budget, in CI.
Tier 0 · Advanced · 40 minGuard an existing API
ASGI middleware that decides on every request body, rejects blocked bodies with 422 and tags responses with a receipt.
Suggested paths#
| If you are building | Take, in order |
|---|---|
| Your own decisions, improved from outcomes | Your own pack, Outcome memory, Learning loop, Reasoning service |
| An assistant or chat feature on a language model | First decision, Guard a model call, Stream decisions, Testing |
| A web API or a service in another language | First decision, API middleware or Decision service, Testing |
| Data exports and batch jobs | First decision, Audit pipeline, Custom rules |
Known issues are part of the tutorials
Where runtime 0.2.1 has a defect on a tutorial's path, the tutorial says so in a "Known issue in 0.2.1" callout and shows the workaround it uses. Where the defect is fixed for the next release, the callout says so; keep the workaround while you run 0.2.1. The full list, with the status of each issue, is in Troubleshooting.