DEV Community

Cover image for I built BHive: a multi-agent framework for Gemini/OpenAI/Anthropic/Ollama. Tear it apart.
David Cooper
David Cooper

Posted on Edited on

I built BHive: a multi-agent framework for Gemini/OpenAI/Anthropic/Ollama. Tear it apart.

I've been building this for two weeks and want honest technical feedback before I invest more time.

What it does

Bhive is a multi-agent framework in TypeScript. Agents ("Bees") can delegate tasks to each other, call tools, and it works with any LLM provider — Gemini, OpenAI, Anthropic, or local Ollama — through the same code.

Architecture decisions I'm unsure about

  • Provider abstraction via an LLMAdapter interface, with a ToolCallingParser that normalizes tool-call formats across providers. Good pattern, or overengineered for what it does?
  • Tool-call validation happens in the Bee's execution loop (not inside each adapter). Right layer for that?
  • Timeout resolution has three levels (explicit arg → env var → default). Reasonable, or too much configuration surface?

What I'd love feedback on

  • The security model (ToolCallValidator: injection guards, allowlists, size limits) — anything missing?
  • Whether the delegation pattern (Bee → Bee, via createDelegationTool) makes sense as an abstraction
  • Anything that smells wrong in the repo structure

Repo: https://github.com/dcooperdev/bhive-core

Tests: 299 passing, ~98% coverage. But test coverage isn't the same as "this is well-designed" — that's what I actually want checked.

Top comments (2)

Collapse
 
raju_dandigam profile image
Raju Dandigam •

Validating tool calls in Bee rather than each provider adapter makes sense if adapters only normalize wire formats; otherwise providers can quietly diverge on security policy. The edge case I'd test is delegation: a parent Bee hands work to a child with a narrower tool allowlist. Does ToolCallValidator check the child's effective permissions at execution time, and is that decision visible in the run trace?

Collapse
 
dcooper profile image
David Cooper • • Edited

Good catch, and you're right to push on delegation. From reading the code, tool validation runs inside the Bee that executes the call, against that Bee's own allowedTools, not the parent's. An empty child allowlist means no restriction, so the parent's limits don't carry over. As far as I can see, the rejection is recorded as security:invalid_tool_call in the events and audit log, but nothing in the delegation trace shows the effective permissions. I haven't run a test for this case yet, so I'll check it and get back to you.