Inspiration

Small business owners juggle disconnected tools—Excel for inventory, QuickBooks for invoices, manual cash flow tracking. When profit drops, they spend hours playing detective. I wanted to build one intelligent workspace where AI connects the dots automatically: tracing margin declines to supplier price increases or linking cash crunches to specific overdue invoices.

What it does

BizPilot unifies sales, inventory, purchasing, invoicing, payments, expenses, and financial analytics with an AI layer that reasons across all your data.

Core Features:

  • Real-time inventory with weighted-average costing and reorder alerts
  • Purchase orders with partial receiving and supplier performance tracking
  • Invoicing with sequential numbering, partial payments, PDF generation
  • Financial analytics: P&L, margin analysis, AR/AP aging, cash flow projections
  • Task management with kanban boards and role-based access control

AI Intelligence:

  • Copilot Chat: Natural language queries powered by Gemini API ("Who owes me money?", "Why did my margin drop?")
  • Proactive Insights: Deterministic engine flagging stockouts, overdue invoices, cash warnings, margin declines, inactive customers—with one-click actions

Instead of "Revenue down 15%", BizPilot says: "Hardware margin declined 8% because Harbor Industrial raised prices 12% while you only increased retail 3%."

How we built it

Stack: Next.js 14, TypeScript, MongoDB, Google Gemini API, Tailwind CSS, Zod validation, Recharts, pdfkit

Architecture:

  • Server-first with MongoDB aggregation pipelines ensuring data consistency everywhere
  • Tool-calling AI with 8 read-only data tools (inventory, invoices, cash flow, customers, expenses, suppliers)
  • Hybrid approach: deterministic code generates all numbers, LLM only composes explanations
  • Auto-seeding system generating 12 months of coherent demo data with embedded stories (late suppliers, quiet customers, margin declines)
  • Graceful degradation: without API key, chat falls back to keyword-routed tool calling

Challenges we ran into

Data Consistency: Sales confirm → inventory decrements → cancelled → stock restores → but what if partially invoiced and paid? Built explicit state machines with reversal logic at every step.

AI Trust for Financial Data: LLMs hallucinate numbers. Solution: insights are 100% deterministic code, only phrasing is LLM-generated. Every number links to source data.

MongoDB Complexity: Building P&L with category rollups and weighted cash projections required mastering aggregation pipelines—very different from SQL.

Graceful Degradation: Most AI demos break without API keys. Built keyword fallback calling same data tools directly—structured data instead of prose.

Accomplishments that we're proud of

  • Real business logic: Weighted-average costing, sequential invoice numbering, partial payment allocation—nothing mocked
  • Perfect reconciliation: Same invoice total appears identically across detail page, payments table, aging report, P&L, and dashboard
  • Intelligent demo data: Includes discoverable stories—late supplier, quiet customer, margin compression—so AI has real findings on first load
  • Connected intelligence: AI traces causes across modules ("margin dropped because supplier X raised prices while you didn't adjust retail")

What we learned

LLMs need guardrails: Tool-calling with read-only functions is the right pattern for business software—AI adds intelligence without accuracy risk.

MongoDB aggregations are powerful: Complex financial reports compile to single queries with 50-100ms response times.

Graceful degradation is a feature: Building keyword fallback forced cleaner architecture and made testing easier.

Small businesses need connected data more than more features: One system that connects dots beats ten disconnected tools.

What's next for BizPilot

Immediate: Email integration, mobile app with receipt OCR, automated testing, Stripe payment processing

AI Enhancements: Auto-generate POs from stock alerts, ML-powered demand forecasting, dynamic pricing suggestions, customer churn prediction

Platform: Multi-tenant SaaS, advanced reporting, API for integrations, multi-currency support

Vision: Transform from management tool to autonomous operator—AI that doesn't just report problems but proactively solves them.

Built With

Share this project:

Updates

Submission history