AI Context Pack

A single block of text that teaches any coding AI — Cursor, Claude, ChatGPT, Copilot — how to build on Bothive and write correct HiveLang. Paste it once and your assistant stops guessing.

Why use it

AI assistants don't know HiveLang's syntax or Bothive's APIs out of the box, so they hallucinate plausible-but-wrong code. This pack gives them the mental model, real syntax, the SDK/CLI/HTTP entry points, and a working example — so the code they generate actually runs.

How to use it

  • Click the copy button on the block below.
  • Paste it at the start of a chat with your AI assistant (or into your editor's rules/system file — e.g. Cursor Rules, a CLAUDE.md).
  • Then ask it to build — "write me a HiveLang bot that…" — and it'll use the correct syntax and APIs.
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 the **"Supabase for AI Agents."**
- It provides the backend infrastructure (**Auth, Managed Database, Memory, and Execution**) needed to build production-ready agents.
- HiveLang v5 is the primary language (curly-brace syntax).

Managed Backend Services
- **Database (State)**: Use `remember` and `recall` to store user state in our managed key-value store.
- **Integrations**: 100+ pre-built OAuth integrations (Slack, Notion, etc.).
- **Execution**: Scalable agent runtime with Gemini 2.0 / Groq.
- **Auth**: API Key management for your external applications.

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 (The "Universal AI Backend")

Use this to integrate your Bothive bots into any external application (Mobile, Web, IoT).
Endpoint: POST /api/v1/execute
Auth: Bearer {BOTHIVE_API_KEY}

Request Body:
{
  "botId": "uuid-of-your-bot",
  "input": "User prompt or structured data object",
  "sessionId": "optional-for-persistent-memory"
}

Response:
{
  "success": true,
  "output": "The bot's final response",
  "transcript": [...],
  "runId": "uuid",
  "sessionId": "..."
}

---

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.

How helpful was this page?

Not helpfulExcellent