Examples

Examples are complete programs that do a real job: run them as they are, then adapt them. Cookbooks are shorter, each one pattern you can copy into your own program.

Highlights

Highlights

A minimal Mistral Vibe in about 350 lines. Type a task in your repository; the agent edits files, runs read-only commands and asks before any other, and takes a line you type mid-run to change course. A browser tab shows the same session and answers its approvals too.

Mini Vibe in the browser: the agent's work streams in, and a command waits for approval with Allow and Deny buttons

Sixty agents test jq 1.6, each in its own Docker sandbox, and talk only through a message board. A second member tries to reproduce each bug a member finds, and a coordinator agent runs the rounds until every part of jq is covered. In our 60-member run, the coordinator's report lists 217 findings that a second member reproduced.

The QA swarm's board during a run: the coordinator assigns the slices, then members post findings, highlighted in orange, and reproductions, in green

A bank's monitoring flags a payment. An agent reads the alert, the account history, the KYC profile, sanctions lists and adverse media on its own, then waits for an analyst before it opens a case file. The analyst then asks follow-ups in the same session.

MONITORING PROCESSMr Le Chonk€9,800 transferto a new accounton_alert("4711")4711 again: same sessionCASE MANAGEMENT APPon_analyst_button( session_id, turn_id, callback_id, approve=True)ApproveDenyids storedSESSIONkey alert:4711TURNRunning01messagereview alert 471102tool callget_alert03tool callget_account_history04tool callget_kyc_profile05tool callscreen_sanctions06tool callsearch_adverse_media07approvalopen_case waits08approvalallowed by the analyst09tool resultCASE-471110agent messagereview done
Step 1 of 5. The monitoring process calls on_alert("4711"). It starts a session with the key alert:4711, and a review turn with the key alert:4711:review.
Output
Waiting for an analyst: Allow tools.client.open_case?
summary: EUR 9,800.00 transfer (2026-10-29) from account FR76 3000 4000 0312 3456 7890 143 (Mr Le Chonk, Lyon) to new beneficiary Northwind Trading FZE (AE07 0331 2345 6789 0123 456, UAE), reference 'INV 2210 consulting'. [...]
Review: Completed: [...]
✅ Case file opened: `CASE-4711` with the full evidence package (alert details, account history anomaly, KYC inconsistency, sanctions match, adverse media). [...]
Case files: ['CASE-4711']
Examples

Examples

ExampleWhat it does
Mini VibeA coding agent in your terminal and a browser tab, with approvals and steering
QA swarm60 agents test jq 1.6 in Docker sandboxes, try to reproduce each other's bugs on one message board, and a coordinator decides when to stop
MissionA planner and its builder subagents build jq from its manual over milestones, each scored on jq's own tests
Suspicious payment reviewAn agent reviews a monitoring alert and waits for an analyst before it opens a case file
MajordomeA personal assistant on Telegram or in your terminal that checks your mail and calendar on its own, and writes only on your tap
PR reviewer as a GitHub ActionA typed review on each pull request; the PR's tests run in a separate workflow, without secrets
Private repository cleanup agentA coding agent that works in one private GitHub repository and opens a pull request
Slack feedback triage botA Slack thread kept as one session, with Linear through its MCP server
Telegram weather botA deployed agent behind a Telegram bot
Used car finderOne call per listing, structured output, and checks in code
Cookbooks

Cookbooks

CookbookThe pattern
Validate structured outputA hook that checks the final answer and makes the agent correct it
Several clients on one sessionLive views of one session that race to answer one approval
One approval policy for every subagentA policy on the lead's session that answers for its subagents
Private data guardA stateful hook that refuses web search once the agent reads private data
Stop an agent that repeats itselfA stateful hook that blocks a tool after two calls in a turn, and ends the turn if the model keeps calling it
Live progressA hook that pushes each finished step to a progress bar in your app
One shared key for a connectorA connector that uses one API key stored for the workspace
Stop and answer a turn by idA dependency upgrade in a notebook: a stopped wait, the same turn back from a re-run cell, and the edit approved from another kernel with only its ids
Slack bot: one session per threadA bot that binds each thread's session by id and resumes from a stored cursor after a restart
Issue triage swarm300 agents, one per open issue, summarize their issues on one message board and flag the duplicates
Run an example

Run an example

Each example is a program you can run as it is. Install the SDK once, then follow the Run line at the top of each page.

You need:

  • The Agents SDK, installed as the Quickstart explains.

  • A Mistral API key in MISTRAL_API_KEY:

    export MISTRAL_API_KEY=...

A one-file example, such as the several clients cookbook, shows its whole program on its page. Put the code blocks titled with the file name the Run line gives in one file, in order, then run it:

python several_clients.py

The test on a page runs with a scripted model, so it needs no API key. Put it in a file beside the program, and run it with pytest and pytest-asyncio installed:

pytest -o asyncio_mode=auto test_several_clients.py

A project example, such as Mini Vibe or the Slack feedback triage bot, has several files and its own pyproject.toml. Its page lists the files and gives the commands to run it, from the folder its Run line names.