DEV Community

Cover image for LedgerMind AI: Turning a Small Business Owner's Voice Notes into Records They Can Trust
Classified
Classified

Posted on

LedgerMind AI: Turning a Small Business Owner's Voice Notes into Records They Can Trust

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

Most small business owners in Nigeria don't keep proper books. They keep notes: a message to themselves, a page in an exercise book, a voice memo. "Paid the plumber 40,000." "Client owes me 60,000." Those notes hold the real history of the business, but nobody can ask them questions like "how much did I take in this week?" or "who still owes me?"

LedgerMind AI is a configurable business-record and intelligence platform that turns those everyday notes into structured records and honest reports. An owner types or speaks a note. A hosted Gemma model reads it and proposes a draft record. The owner reviews and confirms it. The backend then calculates every figure from the saved records. Only after that does the AI write a plain-language summary of how the business is doing.

Who would pay for it: shop and restaurant owners, small contractors and farmers, who want to know where their money is going without learning accounting software or hiring a bookkeeper.

The idea in four principles

  1. Templates, not one-size-fits-all. A restaurant, a supermarket and a contractor record different things. LedgerMind uses a template-driven record engine so each business type gets its own fields, kinds of records and reports from one shared backend.
  2. The AI drafts, the human confirms. The model proposes records but never saves them, and it never confirms a payment. Nothing enters the books without the owner's approval.
  3. Numbers come from code, words come from the model. The backend computes every total from saved records. The model only writes the narrative and has no way to submit SQL or change data. If the AI is wrong or unavailable, the figures are still right.
  4. Honest about what it can't claim. Reports are calculated from saved records. Reconciliation differences are review signals, not proof of missing money or wrongdoing. This is not audited accounting.

Where Things Stand Today (October 17, 2026)

I'm submitting this unfinished, on purpose, and I want to be clear about what is and isn't done.

Working and tested by me:

  • Registration, sign-in, revocable sessions, password and profile management. Passwords are PBKDF2-HMAC-SHA256 hashes and only token hashes are stored.
  • Per-business ownership with membership checks enforced on the server.
  • Restaurants and supermarkets work end to end: record entry, reports, the AI note interpreter, and the AI Business Analyst.
  • Supplier invoices from the AI investigator are saved only after the user clicks "Confirm and save invoice", in a dedicated table separate from generic purchase records.
  • Browser voice input through the Web Speech API, with typed notes as a fallback.
  • Deployed on Render, with optional Sentry tracing.

Not finished yet:

  • Other business types such as contractors, pharmacies, farms and trucking/logistics only partly work. The record kinds, labels, totals and reports are still shaped around shops. Some records from other types are not yet counted, so their totals can show ₦0, and the Overview and Reports pages can disagree.
  • The AI extraction makes mistakes outside the shop cases I tested. For example, it can misread the direction of a payment (money received versus money paid) or save a placeholder word as a name. It does not yet ask a follow-up question when an amount is unclear.
  • The hosted Gemma service sometimes returns 429, 500 and 503 errors, and my retry logic is too weak to ride them out.
  • The Business Analyst is slow on some requests.
  • "Profit" is not calculated. I plan to answer profit questions as net cash movement (money in minus money out) with a clear note that it is not audited profit.

I have a written list of 25 specific fixes for these. I chose to publish now rather than miss the deadline, and I will keep fixing them. Any commits after the October 18 deadline are listed in the repository README.

Demo

Live app: ledgermind-web.onrender.com

The app runs on Render's free tier, so if it has been idle, the first load can take up to a minute while the server wakes up. Please give it a moment.

Screenshot of the LedgerMind AI app

Second screenshot of the LedgerMind AI app

Code

GitHub repository: IamClassified9/LedgerMind-Ai

Development began on October 13, 2026. The repository was initialized on October 16, 2026.

How I Built It

  • Backend: FastAPI, SQLAlchemy, Alembic and PostgreSQL. A shared template-driven record engine supports multiple business types.
  • Frontend: React, TypeScript and Vite.
  • AI: Gemma through hosted inference, used for three jobs: interpreting typed or spoken notes into draft records, extracting supplier invoices for review, and writing the Business Analyst narrative over a snapshot the backend computes.
  • Guardrails: The model has no database access. Its output goes through review, so a wrong answer becomes a draft a person can reject, not a wrong ledger entry.
  • Hosting and monitoring: Render, with Sentry tracing on the AI calls.

What Sentry Showed Me

Sentry issues list showing Gemma provider 503, 429, timeout and output token limit errors on the interpret-record and analysis endpoints

Sentry grouped the failures on my AI endpoints into separate issues. In the 14-day view, with everything first seen in the last day or so:

  • Gemma provider returned HTTP 503 on /api/v1/ai/interpret-record: 7 events, the most recent about three hours before my screenshot.
  • Gemma provider returned HTTP 429 on the same endpoint: 3 events.
  • Gemma hit its output token limit while writing the analysis on /api/v1/ai/businesses/{business_id}/analysis: 1 event.
  • Gemma inference timed out on interpret-record: 1 event.

That list taught me four things about my own code:

  1. Most failures are the provider being busy, and they land on the path people use most. Note interpretation is the first thing a user does, and it is where the 503s and 429s hit. My retries waited only 1 and then 2 seconds, and in my logs all three attempts failed within 3 seconds of each other.
  2. The Business Analyst's output limit was too low. One analysis was cut off at the model's output token limit, which I had set to 2,500. I'm raising it to 5,000.
  3. One analyst request took about 45 seconds. My logs showed it, and that is far too long for an owner waiting on a phone.
  4. The issue titles tell me the status code but not the reason. Even when the logs showed Google's reason, it was a generic "Internal error." I need to record the attempt number, model and latency on each failure so it explains itself.

Next, I'll add exponential backoff with jitter, honor Retry-After, make each attempt its own span, and send the model a smaller snapshot.

Why Does Open Innovation Matter?

I used Gemma through hosted inference, and I want to be upfront that this is a trade-off. Nobody has to own a GPU to use the app, but a customer's note does leave the app to reach the provider. LedgerMind AI does not claim that data stays on infrastructure I control when hosted inference is used.

What the open-weight choice gives me is a way out. When the hosted endpoint returned errors that survived my retries, the fix I can reach for is to configure another provider, or self-host once a business can afford it, rather than wait for one vendor. I can also keep the model on a short leash, since it never writes SQL or saves records and the backend computes every figure. If a better or cheaper model appears, I can replace the narrator without touching the numbers.

The next step where open weights matter most is fine-tuning for how these owners actually write: informal notes, currency amounts, and phrases like "client owes me" where the direction of money changes everything. A general-purpose API handles that poorly, and my own extraction mistakes show it.

How I Used Render

Render hosts the deployed LedgerMind AI application, so a business owner can use it from a browser without installing the backend or running a model on their own computer.

The deployment connects the React, TypeScript and Vite frontend to the FastAPI backend. When a user submits a business note, the backend handles the request and calls the hosted Gemma inference service. The model proposes a structured draft, which the user reviews before confirming it. The backend then saves the approved record and calculates the figures used in reports.

Deployment architecture

Render makes the application accessible, while the external inference service supplies the model capabilities. I do not claim that Gemma itself runs on Render.

Evidence from the deployed application

Screenshot of the Render dashboard showing the LedgerMind AI services (1 of 3)

Screenshot of the Render dashboard showing the LedgerMind AI services (2 of 3)

Screenshot of the Render dashboard showing the LedgerMind AI services (3 of 3)

What I learned from Sentry

Deploying the app exposed a real operational issue: the hosted Gemma service sometimes returns errors or takes too long to respond, and on Render's free tier the server itself can be asleep when the first request arrives. Sentry helped me investigate the Gemma failures. My next improvements are stronger retry handling, clearer error reporting, better response times, and a friendlier "server is waking up" message.

This deployment shows how a small-business AI application can be made available without requiring its users to operate their own model-serving infrastructure.

Prize Categories

  • Best Use of Gemma: Hosted Gemma interprets notes, extracts invoices and writes the Business Analyst narrative.
  • Best Use of Render: The frontend and backend are deployed on Render, connected to a hosted Gemma service. See "How I Used Render" above.
  • Best Use of Sentry Agent Tracing: Sentry traces the Gemma calls, which showed me my weak retries, a 45-second analyst request and vague error reporting.

Top comments (0)