Keep the reasoning on the LLM. Move the routine work to the CPU.
Hive is an orchestration layer for AI agents: route mechanical tool calls locally, trim repetitive context, and recall prior fixes. Add it to your agent loop without replacing your model.
Quickstart · Benchmark results · Integrate your agent
Your agent shouldn't need a paid reasoning call just to re-run tests after a patch. Hive can handle observable workflow transitions on the CPU and escalate decisions that need the model. Context compression and causal memory help reduce the material your agent sends and the work it repeats.
In the published hard-tier benchmark, Hive used fewer LLM calls and less estimated API spend than an agent that asked the LLM to choose every action. Real tool execution, six tasks, hidden grading tests, and repeated runs with DeepSeek-V4.1-Flash:
| baseline (LLM-everything) | context (escalate-only) | hive (rule-routed) | |
|---|---|---|---|
| Resolve rate | 77/90 (86%) | 74/90 (82%) | 74/90 (82%) |
| Mean LLM calls | 7.31 | 7.20 | 3.04 |
| Total cost (est.) | $0.368 | $0.394 | $0.214 |
| McNemar vs baseline | — | not_separable (p=1.0) | not_separable (p=1.0) |
Costs are token-price estimates computed from API usage counts at the run's list prices ($0.22/$0.66 per 1M tokens), not billed amounts.
The opportunity is lower orchestration cost—not a claim of higher intelligence. This table measures the rule-based routing path; the trained CPU router has a separate evaluation. Resolve counts were lower than baseline, and “not separable” does not prove equal quality. These small, project-authored benchmarks support a pilot, not a guarantee for your workload.
Explore the results and reproduce the runs · Audit the provenance and retractions
Three capabilities you can wire into your existing agent:
- Spend model calls on reasoning. Route supported mechanical steps from observable state; escalate when the policy cannot make an accepted, executable decision.
- Keep useful context, trim repetition. Compress tool output and logs before they enter the next model call.
- Reuse what worked. Recall prior fixes through causal memory instead of starting every repeat from scratch.
agent request → HiveStack → { route, compress, remember } → LLM (only when needed)
Best fit: developers who own an agent's tool loop and want to measure its routing and context costs. Start with a controlled pilot against your existing harness, keep your task-quality checks, and compare total cost per successful task. Hosted semantic routing is optional and is not the source of the headline result.
Not yet on PyPI — install from source.
pip install hive-agent-memoryis planned but the name does not resolve on PyPI yet.
git clone https://github.com/DJLougen/hive && cd hive
pip install -e . # base: rule_fast + rust_brainfrom hive import HiveStack
stack = HiveStack()
result = stack.step(
{"goal": "Fix auth bug", "step": 1},
[("user", "login is failing"), ("assistant", "checking logs...")],
)
result["decision"] # RouteDecision — CPU-routed or escalated
result["compressed"] # CompressedTurn — what the LLM actually seesReproduce the benchmark:
python scripts/hive_bench.py --backend openai \
--endpoint <openai-compatible-url> --api-key-env <KEY> --model <model> \
--suite benchmarks/tasks/suite.hard.json --arm all --repeat 15| I want to… | Read |
|---|---|
| Understand the benchmark numbers | benchmarks/README.md |
| Evaluate on your own untouched tasks | docs/EXTERNAL_EVALUATION.md |
See the full API (route, compress, remember, recall, step) |
docs/USAGE.md |
| Wire it into an agent harness | docs/HARNESS_SETUP.md |
| Use it from Cursor / Claude Desktop / Codex | docs/MCP_SETUP.md |
| Understand the architecture & modules | docs/architecture.md |
| Deploy the single-replica HTTP service | deploy/README.md |
| Contribute or report a security issue | .github/CONTRIBUTING.md · .github/SECURITY.md |
v0.7.0 (Beta, unreleased — last release v0.6.1; see docs/CHANGELOG.md and docs/RELEASE_NOTES.md). Routing-accuracy numbers are in-distribution — see the OOD caveat in docs/architecture.md. PFN / busyBee-cpu training-mode integration is in progress (busyBee-cpu).
- Core orchestration (routing, compression, causal memory)
- Enterprise modules (auth, encryption, audit, rate limiting, multi-tenancy)
- Native Rust backend (hive-cpp) with multi-platform wheels
- Real-workload held-out A/B evaluation (three tiers, honest provenance)
- MCP + FastAPI agent extras (
[agents],[server],[mcp]) - PFN-based busyBee training mode (inference + campaign retrain from
FeedbackBuffer) - Durable distributed memory backend (gossip replication in place; durability pending)
- Kubernetes operator for autoscaling
- Broader out-of-distribution routing coverage
MIT — see LICENSE. Cite via .github/citation.cff:
@software{hive2026,
title = {Hive: orchestration layer for AI agents},
author = {Lougen, Daniel J.},
year = {2026},
url = {https://github.com/DJLougen/hive}
}Issues: https://github.com/DJLougen/hive/issues · Discussions: https://github.com/DJLougen/hive/discussions