Skip to main content

Agent Creation

Mega Brain supports creating sophisticated AI agents with personality (SOUL), knowledge (MEMORY), and DNA-based expertise weighting. This guide covers the complete agent creation workflow.

Agent Architecture

Agents in Mega Brain follow a structured template system:

Agent Types

Mega Brain defines 4 agent categories:
Purpose: Functional roles like Sales, Finance, OperationsLocation: agents/cargo/Count: 29 agentsExamples:
  • AGENT-CFO - Chief Financial Officer
  • AGENT-CLOSER - Sales closer
  • AGENT-SDR - Sales Development Rep
  • AGENT-CMO - Chief Marketing Officer
Template: TEMPLATE-AGENT-MD-ULTRA-ROBUSTO-V3.md
Total Active Agents: 37 (29 cargo + 5 minds + 3 conclave + 2 system)

AGENT.md Template

The AGENT.md file is the primary prompt for the agent. Mega Brain uses TEMPLATE-AGENT-MD-ULTRA-ROBUSTO-V3.md:

Referencing System

Agents use citation references to ensure traceability:
All agent content must be 100% traceable to source files. Never make up citations.

Creating a New Agent

1

Choose Agent Category

Decide which category fits your agent:
  • CARGO - Functional role (Sales, Finance, Ops)
  • MINDS - Expert mind clone
  • CONCLAVE - Council participant
  • SYSTEM - Core orchestration
2

Create Agent Directory

3

Define Agent Identity

Edit AGENT.md and fill in:
  1. Agent name - AGENT-[NAME] (uppercase)
  2. Title - Role description
  3. Category - Sales, Finance, Operations, etc.
  4. Tagline - One-line description
4

Define DNA (Optional)

Create DNA-CONFIG.yaml with expert weights:
5

Define Personality (Optional)

Create SOUL.md with personality traits:
6

Add Knowledge (Optional)

Create MEMORY.md with knowledge base:
7

Update AGENT-INDEX.yaml

Add agent to the master index:
8

Validate Agent

Run validation checks:

DNA System

Mega Brain’s DNA system provides 5 layers of knowledge:
Core beliefs and worldviewExamples:
  • “Systems before scale” (Sam Ovens)
  • “Value arbitrage” (Alex Hormozi)
  • “Integrity closes deals” (Cole Gordon)
Format:
Thinking and decision frameworksExamples:
  • “Unit economics model” (Alex Hormozi)
  • “Value ladder” (Russell Brunson)
  • “Flywheel” (Amazon)
Format:
Practical rules and decision shortcutsExamples:
  • “LTV/CAC > 3” (SaaS rule)
  • “20% max on comp” (Sales compensation)
  • “6-month cash runway minimum” (Startups)
Format:
Structured methodologies and processesExamples:
  • “CLOSER Framework” (Cole Gordon)
  • “Value Equation” (Alex Hormozi)
  • “Consulting Process” (Sam Ovens)
Format:
Step-by-step implementationsExamples:
  • “7-step sales call” (Cole Gordon)
  • “Offer creation process” (Alex Hormozi)
  • “Client onboarding” (Sam Ovens)
Format:

Agent Lifecycle

Automatic Creation

Agents can be auto-created via hooks:

Agent Activation

Agents are activated via:
  1. Direct invocation - Mention agent by name
  2. Skill routing - Auto-activated by keywords
  3. Hook trigger - Activated by lifecycle events
  4. Slash commands - /agent-name

Agent Index

AGENT-INDEX.yaml maintains the registry:
agent_index_updater.py hook automatically updates this file when agents are created/modified.

Agent Templates

Mega Brain provides templates in agents/_templates/:
Version: 3.1Size: 78KBFeatures:
  • Full DNA integration
  • Citation system
  • Incremental sections
  • Dependencies tracking
Use for: Production cargo agents

Best Practices

Agent Design Principles

  1. Single Responsibility - One agent, one role
  2. Traceable - All content cited from sources
  3. DNA-Driven - Base on expert mental models
  4. Iterative - Start minimal, expand over time
  5. Validated - Use validation tools before deployment

Quality Checklist

1

Structure Validation

  • AGENT.md exists and follows template
  • Agent name follows AGENT-[NAME] convention
  • Category is valid (Sales, Finance, etc.)
  • Version is set to 3.0.0 or higher
2

Content Validation

  • All sections populated (WHO I AM, FORMATION, etc.)
  • All citations reference real files
  • Quotes are literal (not paraphrased)
  • DNA weights add up correctly
3

Integration Validation

  • AGENT-INDEX.yaml updated
  • Keywords defined for skill routing
  • Dependencies declared
  • Status set to “active”
4

Testing

  • Agent activates on keyword
  • Instructions are clear and actionable
  • Personality matches SOUL.md
  • Knowledge matches MEMORY.md

Troubleshooting

Problem: Agent exists but isn’t activatedSolutions:
  1. Check AGENT-INDEX.yaml includes the agent
  2. Verify file path is correct
  3. Ensure status is “active” not “draft”
  4. Run agent_index_updater.py to rebuild index
Problem: References like ^[SOUL.md:17] don’t resolveSolutions:
  1. Verify SOUL.md exists at correct path
  2. Check line number exists in file
  3. Run verify_citations.py to find all broken refs
  4. Update references to correct line numbers
Problem: Multiple experts conflict in decision-makingSolutions:
  1. Adjust expert weights in DNA-CONFIG.yaml
  2. Create resolution rules in AGENT.md
  3. Define priority order for conflicts
  4. Consider splitting into multiple agents

DNA System

Deep dive into the 5-layer DNA knowledge system

Skills Routing

Auto-activate agents with keyword routing

Hooks System

Agent lifecycle hooks and automation

Validation

Validate agent structure and content