Annals for AI agents: publish markdown, html, images, video, audio, PDFs and folders to a private page the owner reads on the phone, and get back a link.
pip install annals==0.0.6 Copy PIP instructions
Annals for AI agents. An agent publishes a document (markdown, html, an image, a video, a PDF, or a whole folder of renders) with one command and gets back a link; the owner opens their annals on a phone and finds everything their agents left for them, newest first, searchable, with a recycle bin.
pip install annals annals publish report.md --session my-agent # https://apps.example.com/annals/d/20261003-203301-quarterly-report-3f9a Beside what agents publish, the page can list other folders read in place, such as the sessions' ledgers (~/.local/share/crowsnest/ledger): one search over every word of every item, filters by source, kind, session, date and tag, and tags you add from the page, kept apart from the files.
Documents are plain files in a directory. The directory can be on this machine or on another one over ssh, and the page that serves it reads it directly, so publishing never redeploys anything. No database, no build step, no API token.
Load the shipped skill, annals-publish, and you have the whole protocol: one command, one link, put the link in your reply.
annals publish report.md # one document, prints its link annals publish a.md b.md c.html --group "Review" # one link for a set (the group link prints first) annals publish d.md --add-to # add to that set later (same link) annals publish ./renders # a folder: a gallery with inline images, video, audio annals publish ./site_dir # an html page with its assets, as one document annals publish clip.mp4 # media plays inline (streamed, seekable) some-command | annals publish - --title "Log" # from stdin annals ls "search words" # what is there, newest first annals trash / annals restore # the recycle bin What each kind looks like on the page:
A folder skips hidden files and caches (.*, __pycache__, *.pyc); --all-files keeps them.
With pip install 'annals[mcp]', the same operations are an MCP server: python -m annals.mcp.
annals configure --target tw:/root/.local/share/annals --base-url https://apps.example.com/annals That writes ~/.config/annals/config.toml. target is a directory, or host:/path for a directory on another machine reached by ssh host (keys, no prompt; host can be an alias from ~/.ssh/config). ANNALS_TARGET and ANNALS_BASE_URL override it per shell. With no configuration, documents go to ~/.local/share/annals and the link points at a local annals serve.
A config file can name more places: annals configure --to team --target host:/path --base-url https://team.example.com/annals saves a [targets.team] table and leaves the default alone. Then annals publish r.md --to team (also ls, show, trash, restore, group, groups) works on that place only, and annals copy --to team [--source other] copies documents or whole groups there, keeping their ids. Nothing about the place is in the code: a name, a target and a base url.
Inside an app platform (the usual case). Mount the API under the platform's prefix and let the platform's login gate it:
# server.py of the host app; the platform serves frontend/ at /annals/ and this at /api/annals from annals.api import mk_api app = mk_api(data_dir="/root/.local/share/annals") and write the page shell once as the app's frontend:
annals page-shell --api /api/annals --base /annals > frontend/index.html The shell only names those two paths; the page's script and style load from the API, so upgrading the package upgrades the page. Gallery thumbnails are made with Pillow when it is installed (cached under the data root's cache/), and fall back to the original image when it is not.
pip install 'annals[server]' ANNALS_DATA_DIR=~/.local/share/annals annals serve --host 127.0.0.1 --port 8765 The page is at http://127.0.0.1:8765/annals/, its API under /annals/api/. Auth is chosen by environment variables:
Name extra folders when you mount the API, and they appear beside the published documents, each in its own section (/annals/s/ ) and in /annals/all:
app = mk_api(data_dir="~/.local/share/annals", sources={"ledgers": "~/.local/share/crowsnest/ledger"}) or, with no code, ANNALS_SOURCES="ledgers=~/.local/share/crowsnest/ledger" (several: comma-separated). A folder is read in place and never written: its files are listed newest first with their age, markdown renders, html is framed, the rest shows by its kind, and a sub-folder's files count as written by the sub-folder's name. Hidden files and caches are skipped.
The API behind it: GET /items?q=&source=&trash= → {data, total}, GET /items/ : , PATCH /items/ : with {"tags": [...]}, GET /tags, GET /sources, and GET /files/ / for a folder's raw files. The page reaches items through @zodal/store-http's provider (vendored; rebuild with misc/vendor/build.sh).
from annals import DocStore, publish meta = DocStore("~/.local/share/annals").publish("report.md", tags=["q3"]) publish(["report.md"], tags="q3")["url"] # same, through the configured target annals.api.mk_api(...) is the mountable API; annals.api.mk_app(data_dir=..., authorizer=...) the standalone app. Both take sources= (name → folder path, or any annals.sources.Source) and tags= (any MutableMapping from item key to tag list; default JsonTagStore). annals.catalog.Catalog is the facade they stand on: every source's rows as one list, searched, with the owner's tags.
Flat store with tags and groups, not a hierarchy: agents from many projects do not share one, and every placement decision costs tokens. A document is docs/ /meta.json plus its files; the bin is trash/ /; a group is groups/ .json. Ids are YYYYMMDD-HHMMSS- - , so a listing is already in time order and a URL says what it points to. The transport is a seam (annals.target): local directory, ssh, and later an http ingest endpoint. More in misc/docs/design.md.
gh skill install thorwhalen/annals annals-publish The skill also ships inside the package at annals/data/skills/annals-publish/.
agents claude-code html in-tray markdown media page private publish
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




