The AI agent Blue Onion customers use to ask about their own accounting data in plain English, and get answers, charts and tables they can trust in seconds.
Where
Blue Onion
Status
Shipped
Year
2026
My part
Conceived it, chose the stack, wrote nearly all of it and set the patterns the team now extends
The problem
Blue Onion closes the books for e-commerce brands. It reconciles their orders, payments, refunds and fees, and turns them into the journal entries they file into NetSuite or QuickBooks. One customer can have millions of orders, and every number has to tie out.
Customers had questions about their own data that only support could answer, and an investigation could take days. An answer that is almost right is worse than none when it lands in a CFO’s close.1So Console answers only from reconciled, auditable data. That constraint is what let sales take it to CFOs. The agent had to be trusted before it could be useful.
What a customer can do with it
Ask about orders, payments, refunds, journal entries, receivables or unit economics, and get the answer as text, a table or a chart, with links to the pages that hold the numbers.
Attach a report from another system, such as a Shopify export, and see where it matches Blue Onion’s data and where it doesn’t, row by row, with an export of the differences.
Ask how the product works, answered from the help center.
Ask for a report export or a support ticket. Console prepares the action, and the user confirms it.
Support uses it too. An investigation that took up to days now takes minutes, and the customer gets the full answer on first contact.
How it answers
I designed the tool framework and built almost every tool. A tool reads through the app’s own GraphQL API, with the same permission rules as the page it mirrors, so Console shows the numbers the customer would see on that page. No tool takes a company as an argument. Each one is built for the signed-in user’s company, and a tool built without one refuses to run. Every tool is read-only: Console writes nothing to the books.
Console · an illustrative run● done
askHow do Shopify refunds in October compare with payouts?
thinkPlan: two queries, then comparegemini-3.8-flash610ms
checkScoped to the user's companyset when the tool was built4ms
answerStreamed a table and a chart, with links to both pages1.9s
2 tool calls · 3.0s
A budget of tool calls per question makes Console stop searching and answer from what it already has. Other engineers now add tools on the patterns I set.
Built to always answer
The web request never waits on the model. A background job runs each question and streams the answer to the browser as it is written. A watchdog makes sure every question ends with an answer or a clear “no answer”, never an endless spinner. A user can stop an answer, and an answer survives a closed tab.
Each answer starts on Gemini 3.8 Flash. When Vertex AI rejects a request, runs out of capacity, fails or returns nothing, Console retries, then falls back to Gemini 3.7 Flash and then 3.6 Flash, each with its own pool of capacity. If the whole chain fails, the job tries it again after a pause.2Operators can switch the model without a deploy, and customers keep getting answers through provider outages.
The fallback chain (simplified)RUBY
1classAgent::Client2CHAIN=%w[gemini-3.8-flash gemini-3.7-flash gemini-3.6-flash].freeze34defanswer(turn)5CHAIN.eachdo|model|6 reply =ask(model, turn)7return reply if reply.present?# a blank answer counts as a failure8rescueVertex::Rejected,Vertex::NoCapacity,Timeout::Error9next# each model draws on its own capacity pool10end11raiseChainExhausted# the job runs the chain again after a pause12end13end
Safe by design
Read-only tools, each scoped to one company.
Fixed refusals for questions outside its job and for manipulative requests.
A guardrail checks every answer after it is sent: data from one company only, nothing of the system prompt leaked, tool calls within their limit.
Telemetry never records what a tool returned, because that is customer data.
Exports go only through an allowlist of reports.
Evals, so the team can change it with confidence
I built the eval framework the team uses to measure Console. Each case is a question with checks: which tools Console must call and must not call, what it retrieves, whether it refuses, whether data stays inside one company, and whether a number is within a tolerance. An LLM judge scores the quality of the answer. More than a third of the cases are attacks: cross-company access, prompt extraction, instruction overrides, injected text, encoded tricks and write attempts. A real chat becomes a new case with one command.
So the team can change a prompt or move to a new Gemini model and see whether the answers got better or worse before a customer does.
Cost and visibility
Every answer is traced with OpenTelemetry and records its tokens, tool calls, time and cost. Dashboards in Grafana and Cloud Monitoring show the cost of every answer, and alerts fire on model errors, unanswered questions and hourly spend. Leadership knows what the AI costs, and the team sees a problem as it happens. The dashboards and alerts are Terraform, like the rest of the AI stack. Help-center search runs on its own PgVector database, apart from the main one.
What it changed
Console changed what Blue Onion sells. Leadership rebuilt the value proposition around it, made it a core product module, and is renaming the company because of it. With Console in the pitch, sales moved to a higher price point and average deal size nearly doubled.
Average deal size
~2×
Nearly doubled once Console was in the sales pitch.
A support investigation
Minutes
It used to take up to days.
Writes to the books
0
Every tool is read-only. Actions wait for the user to confirm them.