Development·5 min read

Writing HiveLang in the Hive IDE

Prefer code? The Hive IDE lets you write, run, and iterate on HiveLang bots directly, with the full language at your fingertips.

Writing HiveLang in the Hive IDE

The visual builders are great, but sometimes you want to write the bot yourself. The Hive IDE (under Developer) is a code-first editor for HiveLang.

Why use it

  • Full control over a bot's instructions, capabilities, and logic.
  • Use language features the form builders don't surface — parallel, retry/fallback, remember/recall, delegate.
  • Copy/paste and version your bot definitions as plain text.

A complete bot

hivelang
bot SupportTriage { instructions { Triage incoming support messages. Classify urgency and draft a reply. } capabilities { ai.generate knowledge.search } on user.message { call knowledge.search with { query: input } as context call ai.generate with { prompt: "Using this context: " + context + "\nDraft a helpful reply to: " + input } as reply respond with reply } }

Handy patterns

  • Resilience: wrap a flaky call in retry … with backoff exponential max attempts 3 fallback { … }.
  • Speed: run independent calls inside parallel { … }.
  • State: remember "key" as value and recall "key" as v default fallback to persist across turns.

Run & iterate

Run the bot right in the IDE, read the output, and refine. When it's right, save — it joins your bot list like any other, ready to deploy or drop into a workflow.

Learn the language

See Understanding HiveLang and the HiveLang docs for the full reference.

Quick tip

Use the test pane to iterate quickly. Every change you make is live — no need to save first.

Important

API keys are shown only once. Store them securely and never commit them to version control.

Best practice

Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.

Pro tip

Chain multiple specialized bots in a workflow for better results than one general-purpose bot.

Writing HiveLang in the Hive IDE