Skip to main content
Mega is a repo that gives AI coding tools — Claude Code, Cursor, Codex, or any code-native environment — deep knowledge of the Brainbase platform and the ability to build, deploy, and manage conversational agents autonomously. Instead of reading docs and writing code manually, you describe what you need in plain English and your AI tool does the rest — referencing the full Based language spec, production examples, and platform APIs.

Get Mega

Clone the repo and open it in your AI tool to start building.

What can Mega do?

  • Write Based flows from business requirements, documents, or spreadsheets
  • Deploy agents across voice, chat, SMS, WhatsApp, and other channels
  • Manage deployments — inspect logs, update flows, debug issues
  • Scale — take one working flow and deploy it across dozens of instances with different parameters

Quick start

git clone https://github.com/BrainbaseHQ/mega.git
cd mega
cp .env.example .env   # Add your Brainbase API key
Open the mega/ directory in your AI tool. It auto-configures:
ToolConfig fileWhat loads
Claude CodeCLAUDE.mdFull platform context, Based reference, workflow patterns
Cursor.cursorrulesBased syntax, platform conventions
CodexAGENTS.mdAgent instructions for autonomous operation
Then just describe what you need:
"Here's our customer support playbook. Write a Based flow
 for inbound voice calls that routes to sales, service, or
 parts based on caller intent."

What’s inside

PathDescription
docs/based.mdComplete Based language reference — syntax, built-ins, patterns, limitations
docs/platform.mdPlatform data model — workers, flows, deployments, resources
docs/deployments.mdDeployment types and their configuration
examples/5 production-quality Based flows (inbound routing, appointment booking, order taking, lead qualification, outbound campaigns)
scripts/bb.shCLI wrapper for the Brainbase API — create workers, manage flows, deploy

How it works

Mega doesn’t introduce new tools or SDKs. It provides context files that AI coding tools already know how to read. When you open the mega/ directory:
  1. Your AI tool loads the context file (CLAUDE.md, .cursorrules, or AGENTS.md)
  2. The context points it to docs/based.md — the complete Based language reference
  3. It references examples/ for production-quality patterns
  4. It uses scripts/bb.sh to interact with the Brainbase API
The AI tool handles the rest — writing flows, creating workers, deploying, and testing — all from natural language instructions.

Relationship to these docs

The Based reference in Mega’s docs/based.md is the most up-to-date and complete guide to the Based language, covering v2 syntax, deployment-specific functions, limitations, and production patterns. The Language Fundamentals section on this site covers the same topics but may lag behind. If you’re building with an AI tool, use Mega. If you prefer reading docs directly, both sources cover the core language.