A page you can see.
Data an agent can read.
Some things want to be a picture on a screen and a fact sheet for an agent at the same time. The app.html pattern packs both into one file: a single self-contained HTML page that renders in Chrome and carries its own data — optionally a real SQLite database — as plain text underneath.
One file, no server, two readers.
An app.html is an ordinary HTML file with two lives. To a human it is a page — a table, a dashboard, a screenshot — opened straight in Chrome with a file:// path. To an agent it is text: the data is embedded in a <script type="application/json"> block, or a whole SQLite database encoded as base64 and mounted in-page with sql.js, so it can be parsed, diffed and queried without any backend.
Nothing to host, nothing to keep in sync. Copy the file anywhere and both readers still work.
A visual on Chrome
A real page a person can look at — same language as the rest of the projects.
Valuable information for agents
The same file is a document an agent reads from disk: grep, parse, or run SQL over it.
Portable and durable
One artifact survives email, git, a USB stick and a decade of tooling changes.
The options, honestly
One file is the point; a live API is the other extreme. Pick by whether data changes and who writes it.
| Option | Files | Image | Agent read | Agent write | Query API | Human view | Offline |
|---|---|---|---|---|---|---|---|
| B. app.html — single file + base64 SQLite (sql.js) | 1 | yes | parse + decode | rewrite whole file | in-page SQL | yes | yes |
| A. SQLite file + HTML viewer | 2 | BLOB / link | fast | fast | SQL only | yes | yes |
| C. Zipped bundle, EPUB-style | 1 | yes | fast | rezip | none | yes | yes |
| D. HTML + live backend over a DB | 3+ | served | fast | fast | HTTP / REST | yes | server |
| E. SQLite + MCP server | 2 | BLOB | fast | fast | MCP tools | agent-first | yes |
Choose B for one portable artifact with the data baked in. Choose A or E when agents must read and write often. Choose D when it must be live and multi-user. There is no official format name for B — it is just a self-contained HTML file, conventionally app.html or index.html.
What is inside an app.html
Rendered HTML
The markup and CSS a person sees in Chrome — table, chart, screenshot, dashboard.
A JSON block
<script type="application/json" id="data">…</script> — plain text an agent greps and parses directly.
Optional base64 SQLite
A .sqlite file encoded to a string, decoded in-page and queried with sql.js — a real schema, real SQL.
This page is itself an example: the same options above are embedded as JSON at the bottom of the file, so an agent reading app-bundle.html gets the data, not just the prose.
Building and using one
# 1. Build the database (indexes and FTS5 live inside the file — build them before embedding)
sqlite3 data.sqlite "CREATE TABLE item(name TEXT, note TEXT);
CREATE INDEX idx_item_name ON item(name);
INSERT INTO item VALUES ('windows-pil','read-only dashboards');
CREATE VIRTUAL TABLE search USING fts5(name, note);"
# 2. Inline it into the page as base64
python3 - <<'PY'
import base64, pathlib
b64 = base64.b64encode(pathlib.Path('data.sqlite').read_bytes()).decode()
pathlib.Path('app.html').write_text(
pathlib.Path('app.template.html').read_text().replace('__SQLITE_B64__', b64))
PY
# 3. Look at it, and read it
open app.html # human: Chrome renders it
grep -o '<script id="data"[^<]*' app.html # agent: pull the JSON block
- Reading is fast. An agent reads the JSON block in one parse, or greps it; a base64 SQLite is a single decode plus SQL.
- Writing means rewriting the file. Fine up to a few megabytes; beyond that a real database and an API is the faster path for frequent writes.
- Indexing is built in.
CREATE INDEXand FTS5 full-text are stored in the.sqlite, so sql.js gets them the moment it loads — but they must exist before you base64-embed the file. - Size: base64 adds about a third. Comfortable to about 5 MB inline; a side-car SQLite can go to tens of megabytes, at which point loading into memory gets sluggish.