Project Info
Inspiration
I work as an independent contractor, so the line between personal and business spending is not always as clean as it should be. Some expenses are obvious. Others need a sentence of context that only I know. I might pay for work material on a personal card, use one software subscription across several contracts, or look at a healthy balance without remembering that rent and a stack of renewals are about to land. By the time I sit down to sort everything out, I am often trying to remember why I made a purchase weeks earlier. I had been following ChatGPT Finance and Perplexity Finance because asking a question is a much more natural way to explore money than building another spreadsheet. Many finance products and bank connections still do not support New Zealand, though. I saw an opportunity to make something useful straight away for independent contractors, sole traders and small-business owners here. Privacy mattered too. Handing years of transactions, receipts and business information to an online service is a big commitment. Folio can work with a local model through LM Studio, on the owner's computer. If the computer cannot comfortably run a capable model, the owner can explicitly choose a cloud model instead. LM Studio's Bionic also shaped the build. Its local agent experience showed how much the application around a model matters: give the model a focused set of tools, catch bad responses and help it recover. I applied those ideas to finance, then hid most of that machinery from the main screen. Folio is the product I wanted for my own work: I can explain a purchase in ordinary language, ask how the business is doing and get the relevant number, chart or document beside the conversation.
What it does
Folio opens with a conversation, not a wall of finance widgets. It imports transaction data, works out what deserves attention and asks one useful question at a time. If an answer needs a chart, transaction, table or document, Folio opens it beside the conversation. Close that view and the app returns to a simple thread. The demo follows a fictional New Zealand business through one connected piece of work: Daily Close finds a duplicate software charge, a MITRE 10 purchase with missing context and the current cash position. The owner explains that the MITRE 10 purchase was material for a client fit-out and asks Folio to treat similar purchases under $500 the same way. Folio updates the item, saves the explanation for later and offers Undo. A cash scenario compares buying a laptop now with deferring it, including the effect on the owner's reserve. A Telegram-style message — “Parking for the client meeting, $32.40. Expense it” — adds timely context for the next close. Folio prepares an owner pack from the same saved figures, with open questions and cash assumptions included. Small source links connect important figures to the bank row, owner explanation or document behind them. The default demo uses fictional data. Folio also includes optional read-only Akahu support for New Zealand accounts and settled transactions. A Plaid sandbox path demonstrates its read-only Link and transaction flow. Neither connector is attached to a real bank account in the public demo. For conversation, Folio can use a model loaded in LM Studio or an optional OpenAI model. The financial history stays intact when the owner changes models. How I built it Folio is a standalone Electron app built during OpenAI Build Week. The desktop interface uses React, TypeScript and Vite. A local FastAPI service does the finance work, and SQLite stores conversations, imported records, corrections, findings and generated documents. The language model does not calculate balances or rewrite financial records by itself. Money is stored as integer minor units, while tested Python code handles totals, duplicate detection, corrections, cash scenarios and owner-pack preparation. The model interprets the request, chooses an appropriate finance tool and explains the result. That separation also makes smaller local models more useful. Folio selects a short list of tools for each request instead of presenting the whole catalogue. Tool inputs have narrow schemas. If a response is almost valid, Folio gets one bounded repair attempt; repeated or invalid calls are stopped. Supported finance requests can then fall back to the same local operations used by the demo. Long conversations cannot fit in one prompt forever. Folio keeps the original bank rows, documents and owner messages, then links them to people, businesses, transactions, explanations and later corrections. Each new question receives the relevant part of that history. A correction supersedes the old understanding but does not erase it. The interface uses a closed set of financial views. A model can request a transaction, cash scenario, records table, work receipt or owner pack, but it cannot send arbitrary interface code to Electron. LM Studio runs over the computer's loopback connection. The optional cloud path uses the OpenAI Responses API. The owner chooses the route in Privacy & models; Folio does not switch from local to cloud in the background. I used Codex with GPT-5.6 throughout the week. It helped me investigate finance and local-model products, separate this project from my earlier Hermes Finance experiment, build the API and desktop app, write tests, recover work from failed branches and debug the LM Studio integration. I made the product calls, including a major redesign after the first interface exposed far too much activity and accounting detail. Challenges I ran into The hardest problem was getting useful work from a small local model without trusting a confident-looking answer. Models can choose the wrong tool, leave out an argument, return nearly valid JSON or repeat an action. I put validation, a small repair budget and loop detection around model calls. The finance service remains responsible for every saved amount and change. Conversation history was the second challenge. A useful answer can depend on a bank row, a receipt, something the owner said three weeks ago and a correction made yesterday. Sending the complete history on every turn becomes slow and eventually exceeds the model's context window. Folio instead retrieves a smaller current picture while keeping a route back to the original records. The design took several passes as well. An early version displayed every finding, process stage and evidence record at once. It was technically informative and exhausting to use. The current version keeps the thread calm and opens the extra finance view only when it helps answer the question. Accomplishments that I'm proud of The whole demo runs through one finance service and one saved history: import, Daily Close, duplicate handling, correction, Undo, cash scenarios and owner-pack preparation. The totals in the pack match the figures shown in the conversation. I am also proud of the continuity. The owner can give a detailed explanation, correct it later, restart the app or change models, and Folio can still use the current version without losing the earlier record. The local path fails clearly. If LM Studio is unavailable or a model response cannot be used, Folio preserves the last valid financial state. It does not quietly send the data to a cloud provider or show a made-up result. What makes the project feel finished to me is that it now serves the person I built it for. It helps a contractor deal with the small explanations, timing decisions and loose ends that sit between a bank feed and finished accounts. What I learned A local finance assistant depends as much on its surrounding application as it does on model size. A smaller model does noticeably better with a relevant summary of the business and a few precise tools. Giving it every record and every available action usually makes it worse. I also learned that financial memory needs dates and sources. “MITRE 10 is normally a business expense” is too broad to be useful. Folio needs to know which purchase the owner explained, what they actually said, how far the new rule should reach and whether they later changed their mind. The interface lesson was simpler: internal detail is useful for debugging, but owners mostly need to know what happened, why it matters and what to do next. The audit trail is still there when they want to inspect it.
What's next
My next step is to put Folio in front of independent contractors and sole traders in New Zealand. I want to run a small Akahu pilot with read-only accounts, improve receipt matching and connect Telegram so an owner can add context while a purchase is still fresh. Scheduled Daily Close summaries are also on the list, so Folio can prepare the next useful update even when the desktop window is closed. The cash view currently compares known commitments and alternative dates. Future work could improve recurring-payment detection, learn categories from owner corrections and compare more cash-flow scenarios while keeping every assumption visible. Folio is free and open source. I want contractors and small businesses to be able to inspect it, adapt it and run it on their own computers. 5.6 helped with reverse engeering tools like lm stuios bionic as well as loking at hermes fincance tool
Folio
Folio is a local-first finance operator for New Zealand sole traders and small businesses. It starts as one calm conversation, quietly maintains a source-linked picture of the business, and opens a financial canvas only when an answer needs a chart, table, transaction, evidence view or prepared document.
This repository contains a working Build Week prototype. It is not a bank, accounting ledger, payment product, tax-filing service or financial adviser.
The product loop
The sample business demonstrates one end-to-end workflow:
- Folio ingests a synthetic bank CSV and runs an idempotent Daily Close.
- Deterministic services reconcile transactions, flag a likely duplicate, surface an unsupported expense and calculate a 30-day cash scenario.
- The conversation leads with the practical meaning instead of exposing a workflow engine.
- The owner explains a MITRE 10 purchase naturally and at length.
- Folio stores the full statement, applies a narrowly scoped correction, preserves the previous understanding as superseded history and exposes Undo.
- A cash scenario or owner pack appears beside the conversation only when requested.
- Every material amount remains linked to committed source evidence.
The model plans and explains; deterministic finance code owns amounts, transaction selection, effects, forecasts, evidence and generated documents.
What is implemented
| Capability | Current proof |
|---|---|
| Chat-first Electron/React workspace | Source, TypeScript build and browser runtime |
| Dynamic finance canvas | Living brief, transaction, cash scenario, records, owner pack and receipt surfaces |
| Deterministic finance authority | Exact minor-unit arithmetic, fixture contracts and Python tests |
| Daily Close | Idempotent local API workflow over the synthetic fixture |
| Durable working understanding | Immutable owner statements, structured facts, provenance, retrieval receipts, contradiction tracking and supersession |
| Long-conversation continuity | Restart/model-switch integration test with early-turn retrieval and correction |
| Small-model harness | Closed plan schemas, bounded parsing/repair, validation, loop limits and deterministic fallback |
| Local model route | LM Studio loopback adapter and capability discovery; one Qwen 3.5 9B transport smoke recorded separately |
| Optional cloud route | Thin OpenAI Responses API adapter; no live credential is required for local or fixture operation |
| Evidence-backed artefacts | Deterministic HTML/PDF owner-pack generator and source links |
| Telegram-shaped input | Synthetic fixture adapter only; no real bot or owner account is connected |
| Akahu connector | Sealed NZ fixture by default; optional config-gated read-only live sync |
| Plaid connector | Sealed US fixture by default; optional config-gated sandbox Link / sync |
See PROTOTYPE_RECEIPT.md for current verification and explicit gaps.
Architecture
Electron + React conversation/canvas
|
loopback HTTP + SSE
|
FastAPI application service
|
bounded planner / executor / verifier
| |
deterministic finance model router
| / \
SQLite + artefacts LM Studio OpenAI
Important boundaries:
- SQLite is the durable source for conversations, finance events, findings, evidence, model receipts and working understanding.
- Source records and owner statements are immutable. Corrections append a replacement and supersession link instead of overwriting history.
- Local, Hybrid and Cloud change model routing, not finance truth or conversation identity.
- The renderer accepts a closed
FinanceSurfaceSpec@1catalogue. Models cannot emit executable UI code. - The local API binds only to loopback.
Quick start
Requirements
- Node.js 22 or newer
- pnpm 10.33.0
- Python 3.12
- uv 0.9.25 or compatible
Install
pnpm install --frozen-lockfile
uv sync --project services/api --frozen
Run the live local application
./run
This starts the FastAPI service on 127.0.0.1:8787, the Vite renderer on 127.0.0.1:4173, and the Folio Electron app. Stop it with Ctrl+C.
For separate development processes, run:
pnpm dev
pnpm dev:electron
No account or external model is needed for the example workspace. For the intended conversational experience, load a tool-capable model in LM Studio and enable its local server at 127.0.0.1:1234 before opening Folio.
Open the sealed UI fixture
For UI review without the backend:
pnpm dev:browser
Then open http://127.0.0.1:4173/?demo=1. Fixture mode never calls LM Studio or a cloud provider.
Verification
pnpm contracts:check
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm test:golden
pnpm eval:offline
Optional live local-model evaluation, only when LM Studio already has the configured synthetic-test model loaded:
FOLIO_LM_STUDIO_MODEL=folio-qwen3.5-9b pnpm eval:lmstudio:live
The offline evaluation compares raw model JSON acceptance with Folio's bounded repair and validation path. It is parser/harness evidence, not a claim that every local model performs equally well. The live runner reports model-authored plan accuracy separately from effective accuracy after deterministic fallback.
Model modes and privacy
- Local uses LM Studio on
127.0.0.1. If the server or selected model is unavailable, Folio reports that state and uses a bounded deterministic fallback; it does not silently call the cloud. - Hybrid keeps finance computation local and permits only a typed projection to the configured cloud adapter.
- Cloud may use the OpenAI Responses API for planning/explanation, but deterministic finance services still own amounts and effects.
Model selection is in the quiet Privacy & Models drawer, not in the ordinary conversation flow. No telemetry is included. Do not place credentials, real financial exports, bot updates or customer documents in this repository.
Synthetic data
All committed data under fixtures/ is fictional. The example business, its people, accounts, transactions, documents, dates and identifiers are demo material created for this project. Reset with:
pnpm demo:reset
pnpm demo:daily-close
pnpm demo:golden
Repeated ingestion and Daily Close runs use digests and idempotency keys so the same source does not silently create duplicate finance effects.
Build Week provenance
Folio is a new standalone repository created during OpenAI Build Week. The bootstrap and every implementation commit are dated after the submission period opened. It independently reimplements useful architectural principles learned from public documentation and clean-room inspection; it does not contain Hermes or Bionic branding, proprietary prompts, minified bundles or UI assets.
The key implementation commits are recorded in BUILD_WEEK.md. Clean-room and reference boundaries are in CLEAN_ROOM.md, SOURCE_REUSE_MAP.md, ATTRIBUTION.md and REFERENCE_UI_DECISION.md.
Codex with GPT-5.6 was used for research, architecture, implementation, test generation, debugging, integration and adversarial review. The application also contains an optional GPT-5.6 Responses API adapter, but a live cloud runtime result must not be claimed unless separately recorded.
Current limits
- The default data source is a synthetic fixture, local CSV, or sealed Akahu/Plaid connector feed; live bank sync is config-gated and off by default.
- Telegram support is fixture-backed. No real bot round trip is part of the proof.
- The cash forecast is a deterministic scenario over known fixture commitments, not predictive certainty.
- A local-model transport smoke is recorded; the four-case live model benchmark is optional and may not have been run on the current machine state.
- No public deployment, packaged judge build, public video or final Devpost submission is created by this repository.
- Folio is free and open-source software licensed under the Apache License 2.0. Provider credentials and third-party services remain subject to their own terms.
Repository map
apps/desktop/ Electron, React and the closed finance canvas
services/api/src/finance_agent/
agent/ bounded planning and context assembly
api/ loopback routes and working-understanding bridge
finance/ deterministic finance services
storage/ SQLite events, claims, facts and retrieval receipts
jobs/ Daily Close
models/ LM Studio, OpenAI and narrative guard
connectors/ Akahu boundary and Telegram fixture adapter
artifacts/ owner-pack HTML/PDF generation
contracts/ JSON Schema contracts and examples
fixtures/ fictional business data and UI snapshots
evals/ offline and optional live harness evaluations
scripts/ reset, contract and golden-flow commands
Licence
Folio is licensed under the Apache License 2.0.
Analysis
View
Metric
- 18
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- PythonIn code
- ReactIn code
- TypeScriptIn code
- OpenAIClaimed
6 of 7 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
1.1 MB
Source files
110
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
ImDanielGitHub/folio
187 files · 5.5 MB · @ 74e18b7
Structure
Interface
2 files · 1%Screens, components and styles rendered to the user.
API & routing
45 files · 24%Request entry points: routes, handlers and controllers.
Application logic
37 files · 20%Domain rules, services and shared utilities.
Background jobs
2 files · 1%Work run outside a request: tasks, workers and schedules.
Data & schema
20 files · 11%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python64%
- TypeScript14%
- Markdown13%
- CSS6%
- YAML3%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
apps/desktop/package.json
npm · 9- react
- react-dom
- +7 more
services/api/pyproject.toml
pypi · 7- fastapi
- httpx
- jsonschema
- pydantic
- python-multipart
- reportlab
- uvicorn
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.