Skip to main content

Platform Architecture

Think of Bothive as an agent operating system — five clean layers from authoring to observability.

The five layers

1. Authoring Layer

Where agents are defined. HiveLang v5, the visual Builder, and HiveMind (plain-English AI assistant) all produce a structured agent definition that feeds into the runtime.

2. Runtime Layer

The execution engine. Routes to the right model, injects memory, selects tools, generates responses, and handles retries — all in a sandboxed, tenant-isolated environment.

3. Integration Layer

How agents touch external systems. 25+ native integrations with managed OAuth, plus custom HiveLang integrations for any REST or GraphQL API.

4. Delivery Layer

How agents reach users. One agent definition deploys to Web, Telegram, Slack, WhatsApp, or API — normalized through the channel binding system.

5. Observability Layer

The operational surface. Every run produces a structured trace: user input, context loaded, model selected, tools called, latency, errors, and output. No black boxes.

Request flow

Here’s what happens when a user sends a message to your agent:
1

Message received

The channel adapter (Web, Telegram, Slack, or API) receives the raw message and normalizes it into Bothive’s internal message format.
2

Session & memory resolved

The runtime looks up the session ID, loads conversation history, injects any persistent memory for this user, and builds the context window.
3

Model routing

Based on agent config (or dynamic routing rules in HiveLang), the runtime picks the right model — gpt-4o, claude-3.5-sonnet, gemini-1.5-pro, or a custom endpoint.
4

Tool selection & execution

If the model decides to use a tool, the runtime validates the capability, executes it against the integration layer, handles auth refresh if needed, and returns structured output.
5

Response generated

The model generates its reply using the message, context, and tool results. The runtime streams or returns the response to the channel.
6

Trace written

A complete trace is written: timestamps, latency per step, tool arguments, errors, cost, and output. Available immediately in the Observability dashboard.

Infrastructure components

HiveLang v5 and the runtime

When you write a HiveLang file, it compiles to a structured AST that the runtime executes:
The bot, capabilities, instructions, and on blocks are parsed by the v5 parser into typed AST nodes and executed by the Bothive runtime.

Multi-agent swarm architecture

For complex workflows, the swarm layer coordinates multiple agents:
Each agent in a swarm runs in its own execution context but shares memory through the swarm’s memory namespace.

Tenant isolation

Every end-user session runs in an isolated context:
  • Memory is scoped per (bot_id, user_id) — one user’s memory never leaks to another
  • Tool executions are sandboxed per session
  • Observability is filterable per user or tenant
  • Rate limits apply per user, not per bot

Next reads

Memory System

Integrations

Observability