Set up Beancount bookkeeping with your AI agent
A guided, no-terminal setup for a plain-text ledger your AI agent runs for you — the app UI plus an MCP-connected Agent Zero that ingests your first export and hands back a report. Practice on published example ledgers before touching your own finances. Experimental. Owning your own AI Workshop.
playbook how-to bookkeeping agent-zero local-first mcp
Set up Beancount bookkeeping with your AI agent
Experimental. This is one of the first workflows we're publishing while still proving it out — expect rough edges, and tell us what broke. The goal of this page is narrow: get you from nothing to a ledger that exists, real data in it, and a report you can read, with your agent doing the typing.
This page does two jobs:
- For the owner — follow five short steps. You answer questions and approve choices; you never open a terminal or install anything yourself.
- For the owner's AI agent (Agent Zero or similar) — paste this page's URL into the chat and follow Part B. It contains every command you'll run on the owner's behalf.
Why Beancount? Your books are a plain-text file. That means your agent can read it, change it as a reviewable diff, and undo any change — no database you can't audit, no vendor holding your financial history.
What you end up with
| Piece | What it is | You use it to |
|---|---|---|
| The books app (UI) | Beancount.io running on your own machine — journal, income statement, balance sheet, mobile-app sync | Look at your numbers, add an entry by hand, review anything the agent changed |
| Your agent (chat) | Agent Zero connected to that app over MCP | "Categorize last month's transactions", "what did I spend on software?", "import this bank export", "close October" |
Both talk to the same .bean files, so nothing is locked inside either interface.
Part A — For the owner (five steps)
Step 1 — Have Agent Zero running
You need Agent Zero running in Docker Desktop. If it isn't up yet, that's the one prerequisite: see Choosing a container runtime for Docker Desktop vs Podman. Nothing else to install — your agent installs the rest.
Learning on someone else's numbers? The steps are identical either way — the only difference is which file you hand over in Step 4. A public example ledger (see Practice ledgers) is realistic but not yours, so nothing bad can happen while you learn the flow.
Step 2 — Hand the job to your agent
Paste this into your Agent Zero chat:
Read https://ownersclub.ai/knowledge/playbooks/install-beancount-for-agents/
and follow Part B to set up my Beancount bookkeeping stack.
First run: use one of the example ledgers from the page so I can see a
report working. Then we repeat the same steps with my own export.
Connect to the books over MCP so I can also use the app UI.
Ask me before installing anything, and tell me what you're doing as you go.
Step 3 — Answer three questions
Your agent will ask roughly these. Any answer works; it adapts.
| It asks | You say |
|---|---|
| Which file should we start with? | An example ledger, or a bank export of yours — same steps either way |
| What currency / who's this for? | e.g. "USD, my solo consulting business" |
| May I install it now? | "Yes" — it installs the ledger app and its bookkeeping skills, then shows you the URL of your own books UI |
Step 4 — Hand over one file (agent drives)
One step, same shape whichever file you pick:
- An example ledger from Practice ledgers — paste the link or drop the file in chat. The agent loads it and categorizes what's uncategorized.
- Your own CSV/OFX export from your bank or card — that download is the only manual errand in this whole guide. Drop it in chat; the agent works out the columns, shows a preview, imports after you say okay.
Either way: preview → approve → entries land in the ledger.
Step 5 — Get your first report
Ask: "Show me my income statement and top five expense categories." You'll get numbers in chat and the same reports in the app UI. From here it's a habit, not a project:
- Drop next month's export in chat → agent imports, categorizes, flags anything odd.
- Ask questions in plain English instead of building spreadsheets.
- Open the app whenever you'd rather click than type.
Ready for real data? Keep it where PII belongs — see Set up a second, confidential Agent Zero instance for running bookkeeping on local models only. The day-to-day workflow is in Bookkeeping with your agent team.
Practice ledgers
Nothing here is generated for you — these are real, published example files that have been used to teach Beancount for years. Pick one, hand it to your agent, and follow the same steps you'd use on your own data.
| Source | What's in it |
|---|---|
| Beancount.io — ledger examples | Copyable example ledgers to start from: everyday finances, investments with cost basis, real estate, crypto, invoices and quarterly taxes, plus import and reporting templates |
beancount/beancount/examples |
The upstream examples: simple/ (starter.beancount, basic.beancount), the tutorial ledger (a few years of a fictional person's finances), vesting/, and ingest/ with sample bank exports |
Want to practice the import step specifically? The upstream ingest/ folder ships sample CSV/OFX files, and the Beancount.io first-month walkthrough uses a one-month example export.
Part B — For the AI agent
You are doing this for the owner. Run every command yourself; never send them a terminal instruction. Narrate briefly as you go, and ask before installing.
One rule worth stating plainly
Amounts move file → code → ledger. You may read data to decide (a category, an account mapping, "these two rows are the same transfer"), but never transcribe a number into a message or a ledger line. Use the app's tools and CLI arguments to carry values; you supply only categorical choices. This is what makes autonomous bookkeeping trustworthy — see Agent containment and the Bookkeeper agent team topology.
B1. Install the ledger stack
# Ledger app CLI — provisions its own Beancount engine on first use
uv tool install beancount-io # or: brew install bex-co/tap/bea
bea --version
For the full app UI + MCP endpoint (recommended — it's what gives the owner a clickable interface), stand up the stack in their Docker Desktop and report the local URL back:
git clone https://github.com/bex-co/beancount-io.git
cd beancount-io/deploy/docker && cp .env.example .env # fill generated secrets yourself
docker compose up -d --build
Prefer a hosted-style control plane instead of Compose? The same stack deploys from a blueprint on Bex (bex.yaml in the repo root); note Bex is pre-production, so mention that once and move on.
B2. Get a ledger file in place and prove the loop
Same steps for both kinds of starting point — only the first command differs.
# Practicing on an example? Fetch one published file (do not invent entries):
curl -LO https://raw.githubusercontent.com/beancount/beancount/master/examples/simple/starter.beancount
# Starting their real books?
bea --no-input init books --currency USD --date 2026-11-01 \
--opening-balance "Assets:Checking 1000"
git init -q && git add -A && git commit -qm "ledger: initial state"
bea check && bea report balance-sheet
bea check must exit 0 before anything else touches the files. Keep committing after each accepted batch of changes — small, reviewable commits are your undo button.
B3. Connect yourself over MCP
Add the books as an MCP server so both interfaces share one source of truth. In this project that's .a0proj/mcp_servers.json (or A0's Settings → MCP):
{
"mcpServers": {
"beancount": {
"type": "http",
"url": "http://localhost:3000/api-gateway/mcp",
"headers": { "Authorization": "Bearer [REDACTED]" }
}
}
}
Create the API key in the app with minimum scopes and store it as a project sensitive variable, never in chat. Then call tools/list and work from what's actually there — expect BQL queries, file read/edit, entry and receipt insertion, bank import, account renames. Writes preview with dry_run; use the preview, show the owner the diff, then commit.
Inside a container, localhost is the container itself — use the app container's name on the shared Docker network or its host-mapped address.
B4. Install the bookkeeping skills
Sixteen tested beancount-* workflows (add, import, reconcile, close, migrate, ask, invoices, business-metrics, …) from the official skill installer:
SKILLS_SRC="${XDG_DATA_HOME:-$HOME/.local/share}/beancount-io"
git clone --depth 1 --filter=blob:none --sparse https://github.com/bex-co/beancount-io.git "$SKILLS_SRC"
git -C "$SKILLS_SRC" sparse-checkout set skills scripts/skills docs/skills
python3 "$SKILLS_SRC/scripts/skills/beancount-skills.py" install ~/.claude/skills ~/.agents/skills
python3 "$SKILLS_SRC/scripts/skills/beancount-skills.py" verify ~/.claude/skills ~/.agents/skills
For Agent Zero, link the suite into a skills directory your harness loads and start a fresh session so it's picked up. Which profile should own bookkeeping work: Configure profiles for roles and tasks.
B5. Onboard the first file
One flow regardless of source: inspect → map → preview → owner approves → apply.
bea import FILE --csv date=Date,amount=Amount,payee=Payee \
--account Assets:Checking # preview first; --apply only after the owner approves
- Practice file: use an example from Practice ledgers — e.g. a sample export from
examples/ingest/. Adjust the column mapping to whatever that file actually has; never rewrite its numbers. - Owner's export: same command, real file. After import, categorize with rule/history matches first and your judgment only for the ambiguous remainder — categorical decisions, per the rule above.
B6. Report and hand over
bea checkexits 0; income statement and balance sheet render.- Spot-check two totals against the imported rows yourself, then say so.
- Confirm MCP works end-to-end:
tools/list, onedry_runentry insert, show the preview diff, cancel it. - Tell the owner, in plain language: the app URL, where the
.beanfiles live, that they can also use the mobile app, and how to undo (git revert, ordocker compose down/uv tool uninstall beancount-ioto remove).
Not covered here (yet)
- Live bank feeds. Import is export-file-based for now; connecting a bank directly is its own decision.
- Tax preparation. The ledger is the foundation — taxes come later, per the Bookkeeper agent team build order.
Related
- Bookkeeping with your agent team — the ongoing workflow this enables
- Set up a second, confidential Agent Zero instance — where real financial data should live
- Agent Zero and Choosing a container runtime — the prerequisite environment
- Agent containment — why the one rule above exists