Examples
Runnable, end-to-end agents. Each lives under examples/ in the repo with a README and an end-to-end test that runs it against recorded GitHub, Sentry, PagerDuty and Slack servers and a fixture model (make test-e2e-examples), so you can try it with no SaaS account and no model key.
Support desk
A webchat agent that answers from your docs (with the source shown), and hands the conversation to a human when it cannot answer, pinging Slack. Path: examples/support-desk/. See Knowledge base & human handoff for the APIs.
make dev-infra && make run-api # terminal 1
python3 examples/support-desk/setup.py # creates the agent, uploads the docs
# create an API key with scope runs:execute, then open examples/support-desk/demo.htmlTry it: ask How do I reset my password? (a cited answer), then I want a refund (the widget shows "Connecting you to a human"). An operator replies with POST /v1/sessions/{id}/operator-messages and the reply appears in the widget.
setup.py deploys over REST because it also uploads the documents and mints the widget key; lantern deploy from the example directory deploys the agent on its own.
PR triage to a Slack thread
What: every opened GitHub pull request is read, triaged by a model in one line, commented on the PR, and announced in Slack with the verdict in the thread. Why: a reviewer sees risk before opening the diff. Uses: a webhook trigger, the GitHub get_pr and comment_pr actions, Slack post_message and reply_thread, in a workflow.json graph.
cd examples/pr-triage-webhook
curl -X POST $API/v1/agents -H "Authorization: Bearer $TOKEN" -d '{"name":"pr-triage-webhook","description":"PR triage","systemPrompt":"Workflow agent: see workflow.json"}'
curl -X PUT $API/v1/agents/pr-triage-webhook/workflow -H "Authorization: Bearer $TOKEN" -d @workflow.json
curl -X POST $API/v1/agents/pr-triage-webhook/triggers -H "Authorization: Bearer $TOKEN" -d @trigger.json
# -> {"id": "<trigger-id>", "secret": "<shown once>"}
./send-fixture.sh $API/v1/hooks/<trigger-id> <secret> # signed pull_request.openedFor real GitHub, install the github and slack connectors, then add a repository webhook with payload URL $API/v1/hooks/<trigger-id>, content type JSON, the trigger secret, and the Pull requests event. Re-sending the same delivery returns 200 duplicate and starts no second run; a bad signature is 401; an agent over its budget gets 402.
Incident responder with an approval
What: a Sentry alert (or PagerDuty incident) is summarized with the Sentry issue and the PagerDuty incident in hand, a runbook step is posted to Slack, and the run parks at an approval node. Approving posts a note on the PagerDuty incident; denying fails the step and posts nothing. Uses: two triggers (sentry, pagerduty), Sentry get_issue, PagerDuty get_incident and add_note, and the approval node.
cd examples/incident-responder
# create the agent and PUT workflow.json as above, then create both triggers
curl -X POST $API/v1/agents/incident-responder/triggers -d @trigger-sentry.json # and trigger-pagerduty.json
./send-fixture.sh sentry $API/v1/hooks/<sentry-trigger-id> <secret>
# the run parks; approve or deny it:
curl -X POST $API/v1/runs/<run-id>/takeover/<takeover-id>/grant -d '{"notes":"go"}'
curl -X POST $API/v1/runs/<run-id>/takeover/<takeover-id>/deny -d '{"notes":"not now"}'Limits
- A model reply is dropped into JSON-free connector parameters, so the prompts ask for one plain line. Keep that if you edit them.
- The incident trigger templates pin the Sentry organization and the PagerDuty incident or issue id to the fixture values; edit
trigger-*.jsonfor your account. - PR comments use the PR conversation (
comment_pr); inline review comments on a diff line are not wired.