CIRI · Continuous Improvement & Risk Intelligence

Chargeback agent
the full circuit

Explicit orchestration in n8n. 36 steps that always run in the same order, plus 4 error exits — 40 executable nodes, 46 counting the canvas notes. There is no agent node deciding which tool to call: that is why every investigation is reproducible and auditable. Tap any node to see what it does and how it connects.

API callFetches data from SQLite or runs a business rule.Semantic searchQueries the Qdrant vector store.Model callGoes through the API, which is what talks to Claude.BranchesPicks which way the case goes.Canvas logicAssembles, merges or reshapes data. No business rules.Waits for a personStops until an analyst decides.Entry and exitWhere the case comes in and where the report goes out.Error exitAborts the run and reports it.

API routes are shown without the /api prefix they share; /health and the webhook hang off the root. The full detail of every node is one click away.

Demo mode does not change this circuit. The same 36 steps, in the same order: the only thing that changes is which model answers Synthesize Resolution and Quality Judge — a free-tier one instead of Claude. Only if no free tier is configured do those two steps serve the already-computed analysis instead of running.

01–04Entry and validationTakes the case in and checks the identifier format before spending a single token.
05–17Cache and contextShort-circuits if the case was already investigated. Otherwise the transaction first, then six queries in parallel.
18–25AI analysisEvaluates the policies, synthesizes the resolution, applies guardrails and grades itself.
26–36RoutingClassifies and routes. Cases that call for an analyst stop and wait for a person; the rest resolve on their own.
ends here
01–04

The API URL is resolved once, in “Validate TXN Format”, and the fifteen HTTP nodes read it from there: webhook body, n8n variable, or the public API by default. That is why the workflow imports and runs without configuring anything.

05–17

A cache hit returns the already-generated report and skips everything else: two seconds instead of a hundred and thirteen. When there is investigating to do, this is where RAG and the database meet: Qdrant supplies which policies apply and what was done in similar cases, SQLite supplies the exact facts. No business threshold lives in the canvas — SLA windows, the chargeback ratio and the repeat-offender rules are asked of the API, which reads them from domain/constants.py.

18–25

Code decides, the LLM explains: nine of the resolution's thirteen fields are computed by Python and always overwrite what the model returns. Then a second model scores that resolution against five criteria with rubrics.

26–36

If the Judge scored 8.0 or higher, the case is reindexed as a precedent in Qdrant. Every investigation that goes well improves the next one.