memkeeper
HarnessOrchestration

A task ledger for agent workforces

Goals in, evidence out, with a lease, an audit trail, and a deterministic ledger in between.

One agent on one task is a solved problem: you hand it a prompt and read the result. The moment you want several agents working a larger goal, the hard part is not the intelligence, it is the bookkeeping. What tasks exist. Which are unblocked. Who is holding which one right now, and whether that one is still alive or wedged. What each agent actually produced, and whether the result is even the right shape. Get that wrong and the classic failure follows: two agents redo the same task, a dependent starts before its blocker finishes, a crashed worker leaves its task claimed forever.

Harness is the part of the Memkeeper family that keeps that book. It is a local-first task ledger, dispatcher, and runner for coordinating AI agents: it tracks goals, tasks, and dependencies; hands work out under leases; records evidence and an append-only audit trail; and accepts or rejects each result against a declared shape. The design choice underneath all of it is that the control path is deterministic. No LLM decides who works on what, or whether a lease has expired. Models do the work inside a task; they never run the ledger.

How it works

A ladder, not a monolith

Coordinating agents is not one feature you either have or lack. It is a ladder, and most useful work lives on the lower rungs. Harness is built so you can stop wherever the value stops for you.

LevelWhat it means
0 · Shared memoryAgents independently read and write durable context through memkeeper.
1 · Shared contextAgents draw from the same indexed repos, docs, and files via ingest and memkeeper.
2 · Policy-gated solo agentOne agent works a goal while Warden denies undeclared capabilities and requires validation gates.
3 · Cooperative task ledgerGoals become tasks with status, dependencies, owners, leases, evidence, and handoffs. The first real harness layer.
4 · Orchestrated workforceA coordinator decomposes goals, assigns roles, monitors leases, resolves conflicts, and synthesizes the final output.
5 · Autonomous operating loopRecurring goals with triggers, schedules, budgets, explicit grants, escalation policy, and rollback paths.

The v0.1 release lands the machinery for rung three and reaches toward four: the durable ledger, TTL leases, role dispatch, output-envelope acceptance, and an optional planner that turns a single goal into a validated task graph (no cycles, no dangling or self-dependencies) and commits it atomically.

Why deterministic control

It would be easy to let a model run the whole thing: read the goal, decide the tasks, pick who does them, judge whether they are done. That is exactly the design we avoided. A ledger that an LLM narrates is a ledger you cannot reason about: the same state can produce different bookkeeping twice, and a bad turn can silently mark a broken task complete. Keeping goals, tasks, leases, dependencies, and acceptance in deterministic code means the coordination layer is inspectable and reproducible, and the model's judgment is confined to the one place it belongs, doing the task, where its output is checked on the way back in.

Run it

The harness binary is a thin command surface over the ledger, planner, dispatcher, and runner. Queries print JSON; mutations print a one-line acknowledgement. The store defaults to $HOME/.harness/ledger.sqlite, and --now <unix> overrides the clock for deterministic scripting.

git clone https://github.com/teflon07/memkeeper-harness
cd memkeeper-harness
cargo build --release
cargo test --workspace

H=./target/release/harness

# A goal, decomposed into a validated task graph automatically.
$H goal create "Ship the auth refactor" --constraints "no breaking changes"
$H plan 1 --claude --role research --role implement --role review

# Or build the graph by hand: task 2 waits on task 1.
$H task add 1 implementer "Apply review feedback"
$H task dep 2 1

# Claim under a 300s lease, heartbeat it, attach evidence, complete it.
$H task claim 1 agent-a --ttl 300
$H task evidence 1 note "looks good, two nits" --agent agent-a
$H task complete 1 agent-a

# Reclaim tasks whose leases expired; dispatch the rest by role.
$H sweep
$H dispatch 1 --slot agent-a:reviewer --slot agent-b:implementer --ttl 300

# Run a claimed task end-to-end with a headless claude agent.
$H run 1 agent-a --claude --model sonnet

Honest edges

This is the newest and least battle-tested piece of the family, and it is worth saying so plainly.

Compose, do not collapse. Harness owns the execution contract: what tasks exist and who holds them. Warden owns the permission contract: what an action is allowed to do. Librarian owns the context contract: what an agent gets to see. Keeping those separate is the whole point, and it is why each ships as its own tool rather than one agent blob.

Memory gives an agent something to stand on. A gate keeps it in its lane. The harness is what lets more than one of them pull on the same goal without pulling it apart.