Example: a claims desk

An insurance claims app with two agents and two policies: small claims merge on their own, large ones wait for a person.

An insurance claims app on Forkbase, where AI agents decide claims and a merge policy decides what reaches the data.

  • A customer files a claim. The app hands it to an agent job.
  • Claims under $1,000 go to settle-small, run by the agent claims_bot under policy small_claims: one claim per run, only the claims table. Its decisions land on their own.
  • Larger claims go to review-large, run by claims_senior under large_claims: every decision is held until an adjuster approves or rejects it on the desk.
  • Both run the same function in their own fork of the data: plain rules decide (covered causes, exclusions, a $250 deductible). With ANTHROPIC_API_KEY set, Claude writes the note the customer reads.
  • Every run's ledger is a click away: the SQL the agent ran, its proposal, the hold, who approved it.

Run it

shell
docker compose up

Then open http://127.0.0.1:3000 and file a claim. Forkbase's dashboard is at http://127.0.0.1:8000 (its service key: docker compose exec forkbase forkbase keys).

shell
ANTHROPIC_API_KEY=sk-ant-... docker compose up      # Claude writes each decision's note
FORKBASE_IMAGE=forkbase:dev docker compose up       # an image you built yourself

Without a published image to pull, Compose builds one from this checkout (deploy/Dockerfile).

Check it

With the desk running:

shell
node test.mjs

It files a $400 burst-pipe claim (approved and merged on its own), an $8,200 kitchen fire (held, approved by the test, then merged), and a mold claim (denied), and reads a run's ledger.

Without Docker

With a Forkbase server running (forkbase start, Node 22 on the machine for jobs):

shell
export FORKBASE_SERVICE_KEY=$(forkbase keys | node -pe 'JSON.parse(require("fs").readFileSync(0)).service_role')
FORKBASE_URL=http://127.0.0.1:8000 node app/server.mjs

On a server in postgres mode, agents' worlds start from the engine's copy of your tables, refreshed every agents.refresh_every_s (60 s). Set CLAIMS_DELAY_S to at least that, so a job starts once its claim is in the copy.

What's where

File
app/server.mjsthe desk: sets Forkbase up, files claims, routes them to a job, approves and rejects
functions/triage.mjsthe agents' function, deployed twice
policies/the two merge policies
compose.ymlForkbase (Chronos engine inside) and the desk
test.mjsthe end-to-end check

Something wrong or missing? Edit this page on GitHub or open an issue.

Example: a claims desk · Forkbase