AI Context Pack

Copy/paste this into your coding AI assistant so it understands Bothive + HiveLang.

bothive-ai-pack.txt
Bothive + HiveLang — AI Context Pack

Purpose: Give this entire page to any coding AI assistant (Cursor, ChatGPT, Claude, etc.) so it understands how to build with Bothive + HiveLang.

---

What is Bothive?
- Bothive (BotHive) is a platform for building and deploying AI bots written in HiveLang.
- HiveLang v5 is the primary language (curly-brace syntax).

Key concepts
- Bot: a deployed AI worker (written in HiveLang).
- Capabilities: tools the bot is allowed to call (integrations, internal tools, MCP tools).
- Integrations: external services (Slack, Notion, GitHub, etc.) exposed as tool calls.
- Runtime: the execution engine that runs HiveLang code (local dev and server).

---

HiveLang v5 (quick mental model)
- You define:
  - instructions { ... } : the bot’s “system prompt”
  - capabilities { toolA toolB } : what tools it can call
  - event hooks like on user.message { ... }

Example

bot SupportAgent {
  description: "Support bot that can search docs and send Slack alerts"

  capabilities {
    knowledge.search
    slack.send
  }

  instructions {
    You are a support agent. Use knowledge.search before answering.
    Escalate urgent issues to Slack.
  }

  on user.message {
    call knowledge.search with { query: input } as docs
    if (input contains "urgent") {
      call slack.send with { channel: "#support", message: input } as sent
    }
    respond
  }
}

---

SDK: calling bots from your own app

Use the SDK when you have:
- a frontend (web/mobile) + backend, and you want your Bothive bot to be the AI layer
- you want to call a deployed bot with a prompt and receive a response

Install
- npm install @bothive/sdk

Typical usage (TypeScript)

import { BothiveClient } from "@bothive/sdk";

const client = new BothiveClient({
  apiKey: process.env.BOTHIVE_API_KEY,
  baseUrl: "https://bothive.cloud"
});

const res = await client.runBot({
  botId: "your-bot-id-or-slug",
  prompt: "Book me a 30-min meeting next Tuesday afternoon",
  context: { userId: "u_123" }
});

console.log(res.response);

---

CLI: building + deploying bots

Use the CLI when you want to:
- scaffold a bot project
- run a bot locally for testing
- deploy a bot to Bothive Cloud

Install (CLI)
- npm install -g bothive

Common flow
1) bothive login
2) bothive init my-bot
3) bothive dev
4) bothive push

---

HTTP API (server-to-server)

This repo includes bot execution routes under /api/bot/*.
The exact production API may differ, but the core idea is:
- send { botId, prompt/input } to an endpoint
- receive { response/output, toolCalls, metadata }

---

Builder Prompt Mode (in-dashboard)
- Prompt Mode asks for a bot description and generates HiveLang v5 code.
- It can ask a small number of follow-up questions only when needed.
- It produces code that should parse under the HiveLang v5 parser.

---

If you’re building an app (ex: scheduling platform)
- Your product frontend/backend handles accounts, billing, schedules, database.
- Your Bothive bot handles intent → actions:
  - interpret the user request
  - call calendar / email / CRM tools
  - write updates / send notifications
  - follow enterprise rules if required (approvals, redaction, audits)

End.

Was this page helpful?

Confused? Ask HiveMind.

Our autonomous AI assistant can explain any concept, write code snippets, or guide you through the SDK.