agent-fleet-manager README

The project's README from github.com/dreamers-laboratory/agent-fleet-manager. As one markdown file: README.md.

agent-fleet-manager

A general-purpose engine for large-scale, repeated information gathering by a fleet of workers — plain fetchers, scrapers, or LLM agents. You register things to check and how often; the engine schedules what is due, leases work out in isolated batches, records what came back, detects change by content hash, backs off on failures, and keeps an auditable ledger of every write. One SQLite file is the entire system. Python standard library only.

It came out of a production system where a mixed fleet of LLM agents and plain fetchers tracks a few thousand sources on daily and weekly cadences. This is a clean rewrite of the part that generalizes: the bookkeeping. The engine never interprets what a source is — the route field means nothing to it and everything to your worker — which is why the same engine can run very different fleets.

What people use this shape of system for

In every case the engine's contribution is the same: which of your thousands of sources are due right now, what actually changed, what is failing and backing off, and proof of all of it.

The model

Five tables (see agentfleet/schema.sql):

Three rules carry the design. Workers never write canonical state; they drop result files in their write scope and the parent folds them in during reconcile, so a crashed or misbehaving worker can corrupt at most its own scratch directory. Change detection is a content hash, so any run can be repeated safely. Every canonical write is attributed, which matters once several agents share one database.

Scheduling: success sets next_due_at = now + cadence; failure sets next_due_at = now + cadence × min(2^streak, 16) and requeues up to 3 attempts.

Quickstart

python -m agentfleet.cli add-source --db fleet.db acme-careers https://example.com/careers --cadence 3600
python -m agentfleet.cli sweep --db fleet.db
python -m agentfleet.cli status --db fleet.db
python -m agentfleet.cli stats --db fleet.db

sweep queues due sources, leases batches, fetches each route over HTTP, and reconciles. stats prints per-source change rate, error rate, median and p95 latency, and fleet totals. python examples/demo.py runs the whole loop on local files with no network. Tests: python tests/test_engine.py.

Bring your own workers

The built-in executor is a function route -> (status, content_bytes). For an external fleet (LLM agents, containers, other machines), call lease() to get a manifest, hand each batch to a worker, and have the worker write {action_id}.json result files into its write_scope:

{"action_id": 7, "source_id": 3, "status": "ok", "sha256": "…", "bytes": 4096,
 "started_at": "2026-08-31T19:50:21Z", "finished_at": "2026-08-31T19:50:22Z", "elapsed_ms": 812.4}

Then reconcile(conn, batch_id). The engine treats a missing result file as a failure, so dead workers resolve themselves. An LLM agent makes a good worker precisely because the contract is this narrow: read the manifest, do the check however you judge best, write result files, touch nothing else. SKILL.md teaches a coding agent to operate the whole loop.

Watch it in Grafana

The tables are span-shaped by construction, so telemetry is an export:

python -m agentfleet.cli export-otel --db fleet.db --endpoint http://localhost:4318

maps run → trace, batch → parent span, action → child span (with source name, hash, bytes, attempt, and changed-flag attributes) and posts OTLP/HTTP JSON to any collector, including a Grafana Cloud OTLP gateway. Omit --endpoint to inspect the JSON on stdout.

Apache-2.0. Built by Dreamers Inc.

agent-fleet-manager (dreamers-laboratory/agent-fleet-manager)

Searching Database…

这是什么?它是一个引擎,负责调度、发放租约并跟踪一组 worker(普通抓取器、爬虫或 LLM 代理)对信息源(网页、feed、列表页)进行的大规模重复检查,通过内容哈希检测变化,并为每一次写入保留可审计的台账。
这是供我在其上构建的框架,还是现成的爬虫?它是一个围绕五张 SQLite 表(source、action、batch、observation、changelog)构建的框架/库;它从不解释一个源到底是什么,抓取逻辑完全交给你接入的 worker。
怎么试用?运行 `python examples/demo.py`,就能在无网络的本地文件上看到完整的 sweep-lease-reconcile 循环;`sweep` 命令把到期的源排入队列并发放批次租约,`stats` 则打印每个源的变更/错误率和延迟。
需要安装额外的库或搭建数据库服务器吗?不需要——它只用 Python 标准库,整个系统就是一个 SQLite 文件。
引擎知道我的源实际上是什么吗?不知道。它把 route 字段当作无意义的记账数据——抓什么、怎么抓,所有解释完全留给你的 worker 代码。
SKILL.md 是做什么用的?它教会编码代理如何操作完整的 sweep-lease-reconcile 循环,让 LLM 能自主运行整个 worker 集群。
如果 worker 在批次中途崩溃会怎样?worker 只会把结果文件写进自己的写入范围目录,之后由父进程对账;缺失的结果文件就直接视为失败,因此崩溃或行为异常的 worker 无法破坏权威状态。
能在 Grafana 里观察它的运行吗?可以。由于这些表能直接映射到 span(run 对应 trace,batch 对应父 span,action 对应子 span),引擎可以把 OTLP/HTTP JSON 遥测发送到任何收集器(包括 Grafana Cloud 的 OTLP 网关),或者直接打印到 stdout。
人们实际用它追踪些什么?例如在招聘页面上挖掘销售线索、盯竞品的价格和功能、监控监管/合规页面、保持研究语料持续更新,以及电商市场或商品列表监测。
Size
<0.1 MB
Stars
147
Age
1mo
Commits · 90 Days