Document library - shared reference store for Willow and agents
  • Rust 86.2%
  • HTML 13.8%
Find a file
2026-10-01 00:53:20 +08:00
src library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00
templates library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00
.gitignore library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00
Cargo.lock library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00
Cargo.toml library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00
README.md library v0: axum+askama doc store with SQLite FTS5, changelog, notes 2026-10-01 00:53:20 +08:00

library

Shared document store for Willow + agents. Things we come across on the web or in the world, kept for future reference — with full edit history and per-author margin notes.

Stack

  • axum (HTTP + JSON API), askama (read-only web UI)
  • SQLite + FTS5 (full-text search), raw files on disk keyed by doc id

Model

  • Document: id, title, source_url, content, content_type, keep_reason, added_by, encountered_at. Freely mutable; every field change logged to doc_changes (changelog, not event sourcing).
  • Note: per-document margin note, author + timestamp. Authors edit their own only.
  • Tags: simple doc↔tag pairs.
  • Deletion: soft by default (deleted_at), hard delete with X-Hard-Delete header.

API

POST   /docs                 (Bearer token) create doc {title, content, source_url?, keep_reason?, added_by, tags?}
GET    /docs?query=...       FTS5 search (or ?tag=...)
GET    /docs/{id}            HTML view
PATCH  /docs/{id}            (Bearer token) mutate fields; each change logged
DELETE /docs/{id}            (Bearer token) soft delete (X-Hard-Delete for hard)
POST   /docs/{id}/notes      (Bearer token) add note {author, body}
GET    /api/health

Run

LIBRARY_TOKEN=$(cat ~/secrets/library_token) LIBRARY_DATA=./data cargo run

Binds 127.0.0.1:7331 by default.

v1 ideas (deliberately not v0)

  • doc↔doc relations
  • auto-archive from hub fetch_url (optional per-fetch)
  • note editing endpoint
  • edit-history UI view