# AgentBuff Co-Founder

> An open-source web app in Bahasa Indonesia that takes a small-business founder from a raw idea to a validation score, a business plan with a financial model, a brand kit, a proposal and a pitch deck, with every number computed by tested code.

A first-time founder usually asks a spreadsheet template or a chat assistant whether an idea can work. The template assumes they already know HPP, break-even and payback; the assistant produces margins and break-even points that look precise but are not calculated from anything. AgentBuff Co-Founder keeps the model away from the arithmetic: it proposes assumptions and writes the words, and tested code computes every number.

- Break-even, payback, ROI, NPV and IRR come from a deterministic engine with a 100% coverage gate; the model only proposes assumptions.
- Nine MCP tools give an AI agent the same engine and numbers as the web app, with read or write tokens and an audit log.
- Each user brings their own AI provider key, stored with AES-256-GCM envelope encryption and decrypted in memory only for a call.

- 9 MCP tools for AI agents
- 331 tests passing in a local run
- 100% coverage gate on the engines

- Role: Author and maintainer
- Company: AgentBuff
- Period: Jun 2026
- Stack: Next.js 16, React 19, TypeScript, PostgreSQL, Prisma, Redis, MCP, Vitest
- Source on GitHub: AgentBuff-Co-Founder (https://github.com/nugrahalabib/AgentBuff-Co-Founder)

## The problem

A first-time founder usually starts from a spreadsheet template or a chat with a general AI assistant. Templates assume the user already knows terms such as HPP (cost of goods sold), BEP (break-even point) or payback. A chat assistant will happily produce margins, break-even points and market sizes that look precise but are not calculated from anything.

For a small business a wrong number has a real cost: a price that never covers fixed costs, or capital that runs out before break-even. Market claims without a source are hard to check, and a proposal, a deck and a plan written separately rarely show the same figures.

*What changes for the founder*

| Usually | With Co-Founder |
| --- | --- |
| A chat assistant writes the margins and the break-even point | The model proposes assumptions; tested code computes every number |
| Spreadsheet templates full of jargon | Plain Bahasa Indonesia with a tap-to-open glossary for HPP, BEP, ROI, payback, NPV and TAM |
| Market claims with no source | Each research finding links its source; claims without one are labelled as estimates |
| Plan, proposal and deck drift apart | Documents bind numbers from the same engine output as the plan |
| An AI agent cannot use the tool | Nine MCP tools give an agent the same engine, with read-only or read and write tokens |

So the rule of the app is simple: **the model proposes, code computes**. The model suggests assumptions and writes the narrative, tested code computes the financials and the validation score, and the documents bind those exact numbers.

## Who it is for

Co-Founder is written in Bahasa Indonesia for solopreneurs and small businesses (UMKM) who have an idea but no business background. Jargon is underlined, and tapping a term opens a short definition with an example. The same engine also serves AI agents and developers who want to run it themselves.

*Who uses Co-Founder, and how*

| Who | What they do |
| --- | --- |
| Solopreneur or UMKM owner | Signs in with Google, gives a short profile and an idea, then validates it and builds the plan, brand and documents with their own AI key |
| Founder testing numbers | Uses the financial calculator and the validation score tool, which need no AI key, to see whether an idea can break even |
| The founder's AI agent | Connects to the MCP endpoint with a token to list projects and calculate financials and scenarios; with a write token it can create projects or generate plans |
| Self-hosting developer | Runs the app in memory on a laptop, then adds PostgreSQL, Redis, S3 storage and model overrides through environment variables |

## From idea to pitch deck

**One project in Co-Founder** (Each step inherits the one before. When the research changes, the plan is flagged as needing an update instead of being overwritten.)
1. Profile: Sector, stage, goal and budget band
2. Idea: One to three sentences become the first project
3. Validate: Grounded research, then a 0 to 100 score from code
4. Plan: Engine numbers and three scenarios, with a narrative around them
5. Brand: Names, taglines, tone and a palette computed in code
6. Documents: A4 proposal and 16:9 deck bound to the same numbers

The financial calculator and the validation score tool work without any AI key, so anyone can test whether an idea breaks even before linking a provider. Research, plan narratives, brand kits and documents need the user's own key; the app has no AI key or AI budget of its own.

## Inside the app

**About these screenshots**
Captured on a local run on 26 November 2026 with an invented account and three invented projects: a home bakery in Bandung, a laundry service near a campus in Yogyakarta and a thrift shop selling through live streams. No AI key was linked, so AI-written research, plans and documents are not shown.

**Onboarding**
A three-step wizard built for a phone: a short profile, the idea and an optional AI key. The idea becomes the first project right away, and the key step can be skipped and done later in settings. A pasted key is checked with the provider before it is stored.

*Phone screens: sign-in, profile, idea and the key step, with an invented user and idea.*

**Projects**
The dashboard starts a project from one sentence and lists every project with its status, from draft to complete. A project page holds the four steps in order, with a banner while no AI key is linked. With a key, plan numbers can be pre-filled from a price list or a receipt sent as a PDF or photo, then edited.

*Dashboard with three invented projects: a home bakery, a laundry service and a thrift shop.*

*Project workspace for the bakery, with the plan inputs filled and no key linked.*

**Calculator**
The calculator calls the same engine as the plan and the MCP tool. It shows unit economics, break-even, capital, payback and ROI, a cash-flow chart, three scenarios and the monthly projection. The engine returns plain-language warnings when an input looks wrong, and the result is labelled as an estimate from the user's own assumptions, not financial advice.

*Invented inputs for a home bakery: break-even at 682 units a month and payback in 17 months.*

*Cash-flow chart, the pessimistic, realistic and optimistic scenarios, and the monthly projection.*

*Glossary popover for BEP: every underlined term opens a short definition.*

**Validation**
The score is computed from four signals and a regulatory penalty with fixed weights: demand 35, margin 30, competition 20 and differentiation 15. A score of 70 and above is Go, 45 to 69 is Refine, and below 45 is Reconsider. In a project the signals come from grounded research with clickable sources; on this page anyone can move the sliders to see how the score reacts.

*Signals set for the invented bakery give 51 out of 100: Refine.*

**Brand and documents**
Brand Forge turns the validated plan into positioning, names, taglines, tone of voice and a palette derived in code from one proposed primary colour. Deck and Docs builds an A4 proposal or a 16:9 pitch deck from fixed templates, printed in the browser or rendered to PDF. Without a key these pages show their structure and lock the generate actions.

*Brand Forge without a key: example names, palette and type, with generation locked.*

*Deck and Docs: proposal sections and the template choice.*

## Numbers from code, words from the model

The deterministic core has no input or output of its own. The financial engine computes unit economics, break-even, monthly projections, loans, growth models, payback, ROI, NPV, IRR, runway and tax modes in plain TypeScript functions. The validation score and the brand palette are plain functions too. Language models sit behind one provider interface, and the app treats whatever they return as untrusted until it is checked.

- **Plans**: the engine computes the numbers and the three scenarios first; the model then writes the narrative with those numbers injected as fixed values.
- **Research**: source links from the model are reduced to absolute http(s) links before any page shows them, and claims without a source are labelled as estimates.
- **Documents**: the model fills JSON text slots defined by the template; the server escapes every slot and takes every number from the engine output.
- **Model output** is validated against JSON schemas before use, and grounded or imported text is wrapped as data to resist prompt injection.

In a local run on 26 November 2026, **331 tests in 43 files** passed: engines, services, MCP, OAuth, encryption and storage, plus contract tests for each AI provider adapter. Coverage on the financial and research engines is gated at 100% for lines, branches, functions and statements, and TypeScript runs in strict mode. The README also records a review of the financial engine that found and fixed an IRR bracketing bug and a numeric overflow case.

## The same engine for AI agents

*Real calls on the local run: the tool list, calculate_financials with the bakery inputs, and a write tool refused for a read-only token.*

- **Nine tools** over JSON-RPC at `/api/mcp`: create, list and get projects; calculate financials and scenarios; validate an idea; generate a brand kit, a document or a business plan.
- **Tokens** are created in settings, shown once and stored only as a SHA-256 hash with a short prefix.
- **Scopes**: each tool needs read or write, the dispatcher checks it, and every call goes to an audit log.
- **Same answers**: the tool runs on the same service as the web app, as that user, so an agent gets the numbers the calculator shows.

MCP clients can also register through the built-in OAuth 2.1 server with PKCE, so an agent the founder already uses can work on the same projects without a copied token.

*Settings with two demo agent tokens, one read-only; the new token value is masked.*

## How it is built

- One engine, several adapters: Pages, API routes and the MCP endpoint are thin adapters over the same services, so nothing is calculated twice.
- Your own key, encrypted: A fresh data key encrypts each provider key with AES-256-GCM, and a master key, which can sit in KMS, wraps the data key.
- In memory by default: It runs on a laptop with no database; PostgreSQL, Redis jobs, S3 storage and PDF rendering switch on through environment variables.
- Safe production defaults: In production the server refuses to start without a session secret and a master key, and state-changing routes reject cross-origin requests.
- Model choices in one file: AI vendors rename and retire models often, so model IDs live in one routing file and each task can be overridden by configuration.
- Data rights: In line with Indonesia's personal data law, users can download all their data as JSON or delete their account and its data.

**About the optional ChatGPT sign-in**
Besides a provider key, the app offers a sign-in with a ChatGPT account. It is optional, it does not use an official API, it may conflict with the provider's terms of service, and it only works on a local install. The app shows a risk warning next to it, and one environment setting switches it off. For anything beyond a personal local install, use your own provider key.

*Settings: linked AI keys and their health, usage, agent tokens and data rights (no key linked in this run).*

**At a glance**
- License: MIT
- Language: Bahasa Indonesia
- Built: June 2026
- For AI agents: 9 MCP tools, read or write tokens
- Tests: 331 passing in a local run, 26 Nov 2026
- Runs: Self-hosted, in memory or with PostgreSQL
- Hosted demo: None yet

**Want a tool your AI agent can use safely?** I build software where the numbers come from tested code and agents work through scoped tokens.

Source: https://nugrahalabib.com/work/agentbuff-co-founder
Author: Nugraha Labib Mujaddid (https://nugrahalabib.com)
Published: 2026-11-27. Updated: 2026-11-27.
