Kill a worker at any line. The next one replays the event log and carries on from the last finished step.
trading-agentrun_01JDX4K9TQ
1get_orderbookw-2
2run_pythonw-2
3web_fetchw-2
w-2 was killed. Lease ran out 20s later.
Resumed on w-3. 6 results reused, nothing paid twice.
4place_orderw-3
At most once for tools that touch money
Every call carries a stable idempotency key. If a worker dies mid call, keel asks the tool what happened before it does anything.
Rebalance FED-DEC toward 60/40.
6 steps · 2 workers · 1 order
place_orderexternalFilled 240 at 0.58
Idempotency-Key: tc_4be81f
Attempt 1: the worker died mid call
Asked the desk: GET /status?key=tc_4be81f
It landed. Recorded it, didn't resend.
Every step on the record
An append only log of what the model saw, what it called, and what came back. Live, then replayable.
14model.completedNo news. Buying 240 YES
15approval.requestedplace_order
16approval.grantedby Ana Ruiz
17tool.startedplace_order
18tool.completedfilled · 740ms
19model.requestedstep 5
A person in the loop when it matters
Gate any tool behind approval. The run pauses, holds no worker, pings Slack or email, and resumes the moment someone decides.
inbox-triageWaiting 0:24
send_slackexternal
#support: “Billing fix is live, your invoice will regenerate tonight.”
Approve Deny
Any model, any tool you already run
Bring Claude, your webhooks and MCP servers. Code runs in a sandbox with no network.
Connections
ClaudeAnthropic API · Bedrock
Webhook toolsHMAC signed
MCP serversListed on connect
Python and shellgVisor, no network
SecretsKMS, never logged
Fork from any step and see what changed
Rerun from step N with a new prompt or different data. The steps before it are reused, then compare the two runs side by side.
run_7Q2 forked at step 3, on agent v4
1read_book returned 0.41
2No news since 09:00
3Spread is too wide, waiting
4Asked for approval at 0.39
Steps 4 → 4Cost -38%
Runs that start themselves on a cron or a url
Schedule an agent, or give it a secret url that GitHub, a form or your own code can post to. Each due time runs exactly once.
Morning digest
0 9 * * 1-5 · next Tue 09:00 UTC
New GitHub issues
POST /hooks/trg_••••
Triage issue #42: Crash on start
Agents that delegate to other agents
Hand a task to another agent. The child runs on its own while the parent waits for free, then gets the answer back.
plannerwaiting, no worker held
handoff__researcher
researcherCompleted
Found 3 sources. Rates held at 4.25%.
answer returned as the tool result
Not another memory layer.
Memory layers decide what an agent remembers. Harnesses decide how it thinks. Neither one knows whether the order from step 4 actually went out before the box died. That is the part keel owns.
Memory layer
What does the agent know?
Facts, documents and past conversations, stored and recalled by meaning.
Agent harness
How does the agent think and act?
The prompt, the tool loop and context handling inside one process.
keel
What has the agent already done?
Every effect, in order, on a log any worker can resume from.
Memory layer
Agent harness
keel
Recalls relevant context across sessions
Some
Via a memory tool
Survives the process dying at step 40
Restarts from step 1
Never pays for a finished model call twice
Sends an order once, even across retries
Asks the tool what happened after a crash
Pauses for a person without holding a worker
Replayable record of each step and its cost
Traces, if you add them
They stack. Keep your memory layer and call it as a tool: its reads are pure, so keel reruns them freely, and its writes get the same once only treatment as any other external call. Bring the prompts and tools from your harness; keel drives the loop so a crash costs one step, not the run.
Every tool says how dangerous it is.
When a worker dies in the middle of a tool call, keel can't know whether it landed. What it does next depends on the tool's effect level, which you set once when you define it.
pure
Reads only. Fetching a page, reading an order book, searching.
If in doubt: Run it again.
sandboxed
Code and shell, in a throwaway gVisor container with no network.
If in doubt: Run it again in a fresh container.
external
Touches the real world. Orders, messages, payments, pull requests.
If in doubt: Ask the tool's reconcile hook. If there isn't one, stop and ask a person.
A run stuck in review is better than a double order. It waits on the runs page with the exact call, its input, and a button to resolve it.
tools/orders.py
@tool(effect="external", timeout_s=30, reconcile=order_status)
async defplace_order(market_id: str, side: Side, size: float, *, idempotency_key: str) -> Order:
# keel passes the same key on every retry of this logical callreturn await desk.orders.create(market_id, side, size, key=idempotency_key)
async deforder_status(idempotency_key: str) -> Order | None:
# asked after a crash: did this call land or not?return await desk.orders.find(key=idempotency_key)
The same runtime ships as a compose file: web app, API, two workers, MongoDB, Redis and Jaeger. Single org, no billing, nothing phoning home. Write tools as plain Python.
terminal
$ git clone https://github.com/Nishu0/keel && cd keel
$ docker compose -f deploy/docker-compose.yml up
✓ web http://localhost:3000✓ api http://localhost:8000✓ worker-1 leasing from queue default✓ worker-2 leasing from queue default
Every plan includes crash safe runs, at most once tools, approvals, replay, fork and compare, schedules and triggers, and MCP and webhook tools. Self hosting is free.