Acting Assistant (Finance)

An AI-powered platform that automates financial workflows for accounts and finance professionals. The system provides intelligent document processing, automated journal entries, and real-time financial analysis powered by large language models.

Features

  • Conversational AI assistant for querying financial data using natural language
  • Local documents parsing & data extraction from financial records, receipts etc.
  • Automated discrepancy detection with email escalation
  • Interactive financial dashboards
  • Audit trail, history & performance statistics
  • Role-based access control for teams
  • Stripe subscription tiers, billing with usage-based pricing tiers
  • Offline-first with local PgLite database and optional cloud sync
  • Reasoning, steps and cost displayed for each message cycle
  • Automatic/manual model selection based on query complexity & cost constraints

Tech Stack

ReactNestJSTypeScriptVercel AI SDKOpenAIPgLiteZustandTailwindShadcn UIVitestVitePostgreSQLStripeShadcn UIZodServer-Sent EventsPgDumpDockerGitlab CI/CD

Key Insights

  • Using PgLite for a client-side relational database enabled data-privacy
  • Streaming responses via the Vercel AI SDK created a conversational and responsive user experience
  • Structured output from OpenAI with Zod validation ensured quality of responses
  • Automatic model upgrade based on response discrepancy & task complexity optimized for both performance and cost

Development Process

The idea behind Acting Assistant started from watching finance teams spend hours on repetitive calculations and insights gathering that followed predictable patterns — exactly the kind of work that modern AI paired with the power of SQL can handle reliably.

Using a dataset of anonymized financial records, I created the initial experiment on OpenAI's platform, using function calling to let the model interact with the data and produce formatted outputs. The results were promising but not scalable because of latency and token limitations. RAG architecture was not suitable due to aggregation and reasoning needs across multiple documents which would require all documents to be in context at once.

I then built the POC with a local PgLite database running directly in the browser (WASM rocks!), giving users a full relational database locally.

The key problem to solve was how to feed the data to the model in a way that allowed it to reason across the entire dataset without hitting token limits or incurring high latency from multiple API calls.

The solution was to implement a custom retrieval engine that could fetch relevant data from PgLite based on the user's query and provide it to the model in a structured format.

I then built a playground around this architecture to test 200+ scenarios, retrieval strategies and function calling patterns to optimize for accuracy, latency and cost.

The next steps were to build out the rest of the platform around this core AI functionality, including email escalations, database dumps with recovery, offline sync engine and much more.

Payments & Billing

Subscription is managed through Stripe with three pricing tiers and usage-based billing. Usage-based billing tracks the number of AI-powered actions per month, and webhooks keep the local entitlement state synchronized with Stripe's records.