cos-kit is a minimalist HPMA (highly persistent, multiple agent) toolkit.

Zero runtime dependencies. Pure Python 3.11+ standard library, SQLite FTS5, plain Markdown, and your existing agent CLIs (claude, codex, antigravity).

Models are getting a lot more capable. I’m learning to stay out of the models' way as much as I can. They will write the code they need, and often, they don't need much code at all.

That said, I have a few priors, which this toolkit embodies:

  • Plain files and SQLite. Easy to inspect, easy to port.
  • Learn every bitter lesson. I just learned one aboutmemory , and this toolkit is a thin wrapper on top of it.
  • Be stateless when you can. Our memory, conveniently, allows stateless runs, which makes agent decisions more reproducible (and avoids all manner of compaction amnesia, markdown editing drift, etc).
Human  <--->  Inbox UI / CLI  <--->  cos (Chief of Staff)  --->  subagents (recursive)
                  (or BYO)               |      ^                   (claude/codex/agy)
                                         v      |
                            L2: state.db  (lossless SQLite + FTS5 event log — source of truth)
                            L0/L1 (optional): AGENTS.md, goals.md, projects/*.md (disposable caches)
  • A persistent "chief of staff" (cos) - Delegates to an arbitrary number of subagents, recursively (org.json ,cos dispatch ... --async ), with least-privilege zone boundaries (zone.json ).
  • Minimal SQLite Kanban (cos task /cos board ) — or bring your own.
  • Model- and harness-agnostic: swap any agent between claude ,codex , andagy on the fly (cos org set-model ), with automatic fallback on headless wakes (cos-wake ).
  • Delegates to an arbitrary number of subagents, recursively (
  • Communicate via an inbox UI (or bring your own) - Built-in single-file stdlib web briefing UI (Needs you decision cards with inline reply and file uploads,Goals & Projects rendered fromgoals.md , live worker activity) plus CLI (cos inbox ,laptop/inbox ).
  • Built-in single-file stdlib web briefing UI (
  • Run on exe.dev (or bring your own) - Runs on an always-on Linux VM (cos systemd generates ready-to-enable units), locally on macOS/Linux (cos-services ), or across SSH workers.
  • Runs on an always-on Linux VM (
  • CoS uses L2 memory (or bring your own) - L2 (state.db, source of truth): append-only SQLite + FTS5 events table storing interactive chats (claude /codex /agy ), inbox replies, task updates, worker runs, wakes, and optional meeting transcripts verbatim.
  • Optional L0/L1 caches (AGENTS.md, goals.md, projects/*.md): small, disposable files for quick orientation and letting you steer priorities directly. Everything detailed stays in L2 and gets searched on demand withcos mem .
  • Background wakes (cos-wake ) start fresh each turn and query L2 when they need older context.

cos-kit is designed to run inside an isolated VM or sandbox (such as an exe.dev VM), not bare on a laptop holding unrelated production credentials:

  • cos web binds to127.0.0.1:8000 by default and hasno built-in authentication . When running on a VM, bind behindexe.dev , Tailscale, or an authenticating reverse proxy.
  • Headless workers invoke the native CLIs in unattended mode (--dangerously-skip-permissions /--dangerously-bypass-approvals-and-sandbox ), scoped by your VM andzone.json guardrails.
  • cos mem sql always opens SQLite read-only (mode=ro +PRAGMA query_only = ON ).
git clone https://github.com/elsehow/cos-kit.git && cd cos-kit
pip install -e .              # or: uv tool install .
cos init ~/my-cos
cd ~/my-cos
cos digest
cos web                       # http://127.0.0.1:8000
git clone https://github.com/elsehow/cos-kit.git && cd cos-kit
./bin/cos init ~/my-cos
cd ~/my-cos
../cos-kit/bin/cos digest
../cos-kit/bin/cos web

Open an interactive chat in ~/my-cos with whichever CLI you want (claude, codex, or agy). It loads AGENTS.md / CLAUDE.md, runs cos digest, and shares the same L2 event log with every other CLI and background worker.

# Briefing & L2 memory (shared across claude / codex / agy)
cos digest
cos mem describe
cos mem search "query" [--source chat_turn|inbox|worker_run|cos_wake|granola] [--project slug]
cos mem read <event_id> [--window 3] [--same-channel]
cos mem channel <channel>
cos mem sql "SELECT id, ts, source, title FROM events ORDER BY id DESC LIMIT 10"
cos mem ingest                # pull latest interactive claude/codex/agy turns into L2
cos mem backfill              # idempotently backfill existing tasks/inbox/runs into L2

# Human inbox & Kanban
cos inbox list --for human
cos inbox send --to human --kind decision --subject "Short title" --body "..."
cos inbox ack 14
cos board
cos task add "Implement feature X" --project app --owner engineer

# Org chart, workers & live status
cos org show
cos org set-model engineer --harness codex --model default
cos dispatch engineer --task 5 --prompt "Review PR #42 and run tests" --async
cos top
cos web --host 127.0.0.1 --port 8000

On a Linux VM (e.g. exe.dev), generate systemd units tailored to your user and workspace:

cos systemd --out-dir ./systemd-units --host 127.0.0.1 --port 8000
sudo cp ./systemd-units/* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now cos-web.service cos-wake.service cos-log-ingest.timer cos-daily-review.timer

On macOS or local dev machines, use the built-in PID manager:

cos-services start web
cos-services start cos-wake
cos-services start log-ingest
cos-services status

Everything outside core cos is opt-in and replaceable:

  • bin/pr-watcher: zero-token GitHub PR poller ( gh ) that only wakes a worker when a PR's head SHA, draft status, or review state changes.
  • bin/granola-watcher: polls a single opt-in Granola folder (--folder-id orgranola.folder_id inzone.json ), archives full raw transcripts to L2, and forwards relevant meetings tocos .
  • bin/staleness-check: zero-token weekday check that sends a single Status check: card for anygoals.md workstream orideas.md item untouched for ≥14 days.
  • laptop/cos & laptop/inbox: aggregate human inboxes and attach to persistent tmux chats across multiple isolated zones via~/.config/cos/zones.json .
coslib/
  db.py          # SQLite Kanban, inbox, runs, and immutable L2 events + FTS5
  cli.py         # `cos` CLI (init, systemd, digest, mem, inbox, board, task, org, dispatch, web)
  ingest.py      # Incremental claude / codex / antigravity chat transcript ingestor
  dispatch.py    # Sync & async multi-harness worker dispatch
  web.py         # Single-file stdlib HTTP briefing UI + uploads
  org.py         # Declarative org chart & model/harness switching
  policy.py      # Zone isolation & least-privilege grant checks
  activity.py    # Live coordinator + parallel worker inspector (`cos top`)
  scaffold.py    # `cos init` workspace generator & `cos systemd` renderer
bin/             # Standalone executables & optional watchers
laptop/          # Optional remote SSH wrappers (`cos`, `inbox`)
templates/       # Reference `zone.json` and `org.json`
tests/           # Stdlib unittest suite
python3 -m unittest discover -s tests -v

MIT

原文来源:github.com