Zotra, workflow studio for banks

From a credit policy PDF to a tested approval app.
The AI drafts and tests. Humans decide.

CI Latest release License: Apache 2.0 Meta Global AI Developer Hackathon 2026

See it

Watch the Zotra demo video on YouTube

Try it in 2 minutes

You need Docker with Compose v2.

git clone https://github.com/donovan-ratefison/Zotra.git && cd Zotra
docker compose up -d

Open http://127.0.0.1:8080. At the first start, Zotra adds 60 sample cases over 30 days, so the inbox, the triage and the supervision have data. No AI key is needed for the demo: the app replays recorded AI answers for the sample policies. A thin line at the top of the studio says so.

Tour in 5 minutes

These steps work with no AI key.

  1. Import a policy. On the library page, under Start here, click Import a sample policy. Click Home loan (EN), then Analyze policy. Each step of the draft cites its paragraph. Click Accept.
  2. Change the process with the AI. Open the library again and open Home loan. Click New draft, give a label, then Create draft. Send these two messages, in this order. For each one, click Yes, make the change, then Accept:
    • Give the step Loan offer a deadline of 12 h.
    • Add a step Property valuation before Credit analysis, done by a new role Property expert, with a deadline of 72 h and the required document Valuation report.

Then open the Documentation menu and click Update the policy.

  1. Test it. Click Test, then Create a test case. Fill the client fields, then click Create and start. Click Take the step a few times. Click an earlier event in the timeline: the diagram shows the case at that event.
  2. Work the cases. Open the bank app (/app). In Demo profile, pick Demo Analyst, then click Triage. Press D to see the documents, Escape to close them, V to verify the hash chain of the case, and F to give a favorable decision.
  3. Supervise and audit. Pick Demo Director. Click Supervision to see where cases wait and why. Click Audit log, then Verify chain.

The other features (other PDFs, other messages, scans read by SAM, generated test cases) need a key. See examples/ai-replay.

To call the live Meta models with your own key, see Use the live AI with your own Meta key.

The problem

A bank writes its credit procedures in PDF policies. To turn one policy into a workflow, business and IT teams meet for weeks. After that, nobody can easily say which step comes from which rule of the text.

How it works

1. Read the policy

Drop a PDF. The AI drafts the steps, roles, deadlines, documents and rules. A scanned PDF has no text layer: Muse Spark reads its page images first. Each step cites its paragraph. The draft stays in dashed violet until you accept it. You can also start from scratch and draw the process by hand.

The AI turns a loan policy into a process draft

2. Shape the process

Add, link and delete steps on the diagram, or ask the AI assistant in plain words. When a request is not clear, the assistant asks you to pick from the roles and documents of the process. You see each change before it is saved.

The AI assistant proposes a new step

3. Test it

Play a case as any role. The diagram shows the path, and the timeline replays it from any step. When a check fails, ask the AI why. It can also write the test cases that cover the paths you missed.

A test case runs on the diagram

4. Ship it

Freeze and publish. Each role gets an app in the bank colors. The triage deck shows the most urgent case first, with its figures, rules, documents and the hash chain of its events.

The triage deck of a credit analyst

The supervision shows where cases wait, which ones are late, and who decided what today.

The live supervision of the process

5. Keep the policy up to date

The documentation of each version is written as a policy, in the logo and colors of the bank. After a change, the AI rewrites the policy paragraphs that the change touches, for the bank to review.

Built for review, not blind trust

  • Every AI answer passes the JSON Schema, the CEL type check and the citation check before you see it.
  • A click on a citation opens its paragraph in the PDF.
  • Nothing from the AI is saved until a person accepts it.

The AI never decides

On a live case, only CEL rules and people decide. The AI helps to design and to test the process. Without an AI key, you can still design the process by hand.

Meta models

Model Used for
Muse Spark 1.3 Policy to process, scanned policies, process changes, rules, test cases, explanations, policy update
SAM 3.1 Signature, stamp and ID areas on scanned documents

Zotra calls both models through the Meta Model API (https://api.meta.ai/v1): Muse Spark on /chat/completions, SAM 3.1 on /responses.

Install

Docker (recommended)

See Try it in 2 minutes. To use another port: ZOTRA_PORT=9090 docker compose up -d.

Release binary

  1. Download the archive for your system from the releases page and extract it.
  2. Start PostgreSQL 16.
  3. Set ZOTRA_DATABASE_URL, for example postgres://zotra:[email protected]:5432/zotra?sslmode=disable.
  4. Run ./zotra, then open http://127.0.0.1:8080.

From the sources

You need Go, Node 22, pnpm 10 and Docker.

make setup   # dependencies and .env
make db      # PostgreSQL in Docker
make run     # build and start

Run make to see all the targets. make demo fills the database with a demo history. To use the live AI, set ZOTRA_AI_API_KEY in .env.

Use the live AI with your own Meta key

The demo replays recorded AI answers. A new request, for example another PDF or a scan, needs the live AI and a Meta API key.

With Docker

  1. In the folder of the repository, create the file .env with these two lines:
   ZOTRA_AI_API_KEY=<your Meta API key>
   ZOTRA_AI_MODE=live
  1. Run docker compose up -d. If the app runs already, run docker compose down first. Your data stays.

From the sources

  1. Run make setup. It creates .env from .env.example.
  2. In .env, set ZOTRA_AI_API_KEY. The mode cache of .env.example calls the live AI and keeps each answer.
  3. Run make run.

AI modes

ZOTRA_AI_MODE sets the mode.

Mode Behavior
live Each request calls the Meta API. A key is necessary. Use this mode with Docker.
cache A stored answer is used when it exists. Else the app calls the Meta API and stores the answer in ZOTRA_AI_CACHE_DIR. A key and a writable cache folder are necessary. Default from the sources.
replay Only the recorded answers are used. The app never calls the API. A new request gives the message "This request is not in the recorded demo answers." Default with Docker.
off No AI call. Each AI action gives the message "The AI layer is off."

The app stops the AI calls for the day when their cost reaches ZOTRA_AI_BUDGET_USD (default 2 USD). It keeps the daily cost in ZOTRA_AI_STATE_DIR (default: the cache folder; with Docker: a volume).

Stack

One Go binary: net/http, cel-go and PostgreSQL. The web app uses React, Vite, React Flow, Tailwind CSS and shadcn/ui.

License

Apache License 2.0. See LICENSE.

Built With

Share this project:

Updates