Delivered remotely for a business based in Singapore, Singapore. Names withheld by agreement.
Project Overview
A credible business plan is equal parts strategic narrative and reconciled financial math. Commercial banks, institutional seed funds, and enterprise grant committees immediately dismiss proposals where the executive summary promises profitability in year two while the hiring table implies negative cash flow six months earlier. Yet asking founders to build linked three-statement models in raw spreadsheets before writing a cohesive strategy memo leaves most early teams stuck for weeks.
Built for founders and advisory firms operating out of Singapore, we engineered an AI business plan generator powered by Python, Next.js, and external LLM APIs. The system flips the typical AI wrapper pattern on its head: deterministic Python calculation kernels compute every revenue driver, tax schedule, and cash-runway curve first, and structured LLM workflows then synthesize cohesive, boardroom-ready prose strictly anchored to those verified figures.
Planning & Modeling Gaps
Advisory teams and early-stage operators repeatedly hit four breaking points with off-the-shelf planning tools and general chat models:
- Arithmetic hallucinations: Unconstrained language models routinely miscalculate gross margins, invent TAM/SAM ratios, and contradict financial tables written two pages later.
- Narrative-to-model drift: Changing a hiring start date or unit price in a separate spreadsheet immediately invalidated exported Word documents, forcing manual line-by-line rewrites.
- One-size-fits-all templates: Rigid static outlines forced B2B software startups, F&B concepts, and logistics ventures through irrelevant accounting prompts.
- Unusable export formatting: Browser printouts broke charts across page boundaries and lacked native spreadsheet backups required by loan underwriters.
Architectural Strategy
Our core design rule was math first, prose second, dependency-tracked always. Instead of prompting LLM APIs to write a whole business plan in one monolithic pass, the Python backend breaks planning into a directed graph of typed inputs, deterministic accounting computations, and section-scoped synthesis tasks.
Users configure business drivers—pricing tiers, customer acquisition channels, COGS, payroll schedules, and capital raises—inside a responsive Next.js workspace. Python calculates monthly projections using exact Decimal arithmetic, persists the resulting financial snapshot in PostgreSQL, and passes frozen metric summaries into constrained LLM API prompts. Every generated section stores a hash of the assumptions it depended on, making staleness detection automatic whenever numbers shift.
Core Capabilities
- Industry-Adaptive Assumption Intake: Dynamic Next.js wizards adapt driver inputs to SaaS, marketplace, retail, services, or hardware operating models.
- Deterministic Three-Statement Engine: Python computes linked monthly and annual P&L, cash-flow, and balance-sheet projections with burn-rate and break-even outputs.
- Grounded Narrative Synthesis: LLM APIs draft Executive Summary, Market Positioning, Go-to-Market, Operations, and Risk sections strictly referencing verified model metrics.
- Scenario Comparison & Stale-Section Alerts: Founders clone baseline plans into optimistic or conservative cases and refresh only the prose paragraphs affected by assumption tweaks.
- Investor-Grade Multi-Format Exports: Generates styled PDF pitch documents, editable DOCX drafts, and formula-preserving Excel workbooks from a single source of truth.
Technical Architecture
The application separates interactive scenario modeling in Next.js from computation and model orchestration in Python. Next.js handles authenticated workspaces, server-rendered sharing portals, and live Recharts/Tailwind assumption editing. API mutations forward structured driver payloads to FastAPI, which executes the projection kernel, commits versioned scenario JSONB trees to PostgreSQL, and dispatches section drafting tasks across Redis-backed workers calling LLM APIs.
Flow: Next.js Scenario Editor → FastAPI Input Validator (Pydantic) → Deterministic Python Financial Kernel → PostgreSQL Scenario Snapshot → Redis Section DAG → LLM APIs (Grounded Metric Prompts + Consistency Check) → Next.js Review Studio & PDF/XLSX Export
Storing input drivers separately from computed monthly outputs and generated text blocks lets the UI render instant sensitivity recalculations without waiting on LLM round-trips. When an advisor adjusts a churn assumption, FastAPI recomputes the cash curve in milliseconds, updates PostgreSQL, and flags only the affected narrative blocks for optional AI refresh.
Technology Stack
| Category | Technology detail |
|---|---|
| Web Application | Next.js App Router with React Server Components and TypeScript scenario views |
| Financial & AI Backend | Python FastAPI running deterministic projection engines and LLM API orchestration |
| Model Orchestration | Multi-stage LLM APIs with structured JSON outputs and numeric grounding checks |
| Persistence Layer | PostgreSQL storing plan revisions, assumption tables, and multi-scenario snapshots |
| Async Processing | Redis task queues coordinating multi-section generation and PDF/DOCX rendering |
| UI & Charts | Tailwind CSS design system with interactive cash-runway and sensitivity charts |
| Export Pipeline | Headless Chromium and templating workers producing investor PDFs and spreadsheets |
| Validation Layer | Pydantic numeric constraint schemas preventing unit or currency mismatches |
| Citation & Traceability | Cross-reference IDs binding narrative assertions to model output cells |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| LLM APIs fabricate numbers or misstate YoY growth when given raw assumptions | Executed all arithmetic inside deterministic Python Decimal routines and fed pre-computed summary tables to LLM APIs with post-generation numeric checks; increases backend orchestration while eliminating math errors. |
| Single monolithic prompts lose structural coherence across 20-page plans | Decomposed generation into an ordered section DAG sharing a concise strategic thesis summary, trading slightly higher total token calls for consistent tone and zero section repetition. |
| Regenerating an entire plan erases careful founder edits in other chapters | Tracked section dependency hashes in PostgreSQL so assumption edits flag and refresh only stale narrative blocks while locking user-edited sections. |
| Client-side JS floating-point math causes rounding discrepancies against server exports | Centralized authoritative financial calculations in Python and synced serialized totals to Next.js, avoiding browser-vs-Excel penny drift at the cost of a lightweight recalculation API call. |
Security & Tenant Isolation
Business plans contain pre-launch IP, cap-table plans, salary bands, and banking projections. Every plan workspace in PostgreSQL enforces strict tenant and collaborator role checks (owner, advisor, viewer), ensuring external reviewers accessing shared Next.js links see only read-only snapshots with optional password or expiration gates.
Prompt payloads sent to external LLM APIs omit personally identifiable founder details, tax identifiers, and bank account numbers, transmitting only anonymized operational drivers and computed ratios. Generated export artifacts reside in encrypted object storage behind short-lived signed URLs rather than persistent public links.
Generation Performance & Export Scale
Generating a complete multi-chapter business plan involves multiple sequential and parallel LLM API calls alongside chart rasterization. Rather than blocking an HTTP request until all chapters finish, FastAPI launches a Redis-orchestrated task graph: foundational sections (Executive Thesis, Customer Persona) resolve first, unlocking parallel generation of Go-to-Market, Operations, and Financial Commentary while streaming live progress events to Next.js.
Heavy PDF rendering runs inside isolated headless browser worker pools separated from API containers. Caching unchanged chart renders per scenario revision keeps repeated downloads snappy even when advisors iterate rapidly ahead of investor meetings.
Operational Outcomes
Bridging deterministic financial engineering with structured LLM orchestration gave founders and advisory practices a dependable alternative to disconnected spreadsheets and generic chat prompts:
- Reconciled strategy and math: Every revenue milestone, hiring ramp, and runway figure cited in narrative prose aligns strictly with the underlying financial tables.
- Rapid scenario iteration: Founders test pricing shifts, hiring delays, or funding tranches in real time and refresh only the affected commentary without starting over.
- Bank- and investor-ready deliverables: Paired PDF narratives and formula-backed Excel workbooks satisfy both strategic readers and analytical underwriters.
- Confident advisory collaboration: Fractional CFOs and startup mentors review transparent calculation drivers alongside clean, editable prose inside one unified workspace.