Instruct AI Agent
Your AI’s behavior is defined by guidance - the instructions, tools, and rules that control how it responds to users. Unlike static chatbots with fixed responses, botBrains lets you craft dynamic, context-aware behavior that adapts to different situations and user segments.Why Behavior Configuration Matters
Your AI needs clear instructions to provide valuable customer service. Proper behavior configuration enables your AI to:- Maintain brand voice - Ensure every response reflects your company’s tone and values
- Handle different scenarios - Respond appropriately whether users need sales info, technical support, or account help
- Use the right tools - Access search tables, web search, or escalation capabilities when needed
- Personalize interactions - Adapt responses based on user attributes like plan tier, location, or role
- Evolve continuously - Update behavior as your product and customer needs change
Understanding Behavior Configuration
Your AI’s behavior is defined in the Behavior section of the platform, which includes:- Guidance rules - Instructions for different scenarios
- Tool access - Which capabilities the AI can use
- LLM settings - Model selection and configuration
- Edit your current behavior configuration
- Build a new version when ready
- Deploy the version to production
- Roll back to previous versions if needed
Creating Effective Guidance
Guidance rules are the building blocks of your AI’s behavior. Each guidance defines:- Instructions - What the AI should do and how
- Audience - Which users this guidance applies to
- Tools - Which capabilities the AI can access
Anatomy of a Guidance Rule
Navigate to Behavior → Guidance to manage your guidance rules. Name- Descriptive label for organization
- Example: “Sales Inquiries”, “Technical Support”, “Premium Customer Service”
- Natural language description of desired behavior
- Rich text editor with formatting support
- Reference tools using inline code:
search_products - Be specific about tone, detail level, and response format
- Select which capabilities this guidance can use
- Tools mentioned in instructions are auto-enabled
- Examples:
search_web,search_products,offer_handoff
- Define which users this guidance applies to
- Use query builder to filter by attributes
- Leave empty for “everyone”
- Toggle guidance on/off without deleting
- Inactive guidance is skipped during conversations
Personalization with Liquid Templating
Your instructions support Liquid templating, allowing you to personalize guidance based on user attributes and conversation context. Available Variables| Variable | Description | Example |
|---|---|---|
{{user.first_name}} | User’s first name | ”Sarah” |
{{user.email}} | User’s email address | ”sarah@example.com” |
{{user.external_attributes.plan}} | Custom attribute (e.g., subscription tier) | “enterprise” |
{{conversation.channel_type}} | Current channel | ”zendesk”, “slack”, “web” |
Writing Instruction Templates
Your instructions guide the AI’s responses. Follow these principles: Be SpecificUsing XML Tags for Structure
For long or complex guidance, use XML tags to organize instructions into logical sections. This helps the AI understand different aspects of behavior and improves instruction clarity. Functional Organization Use XML tags to separate different functional requirements:- Clarity: Separate concerns into distinct sections
- Maintainability: Easy to update specific aspects without affecting others
- Readability: Clear structure for both humans and AI
- Scalability: Add new sections without restructuring entire guidance
- Guidance covers multiple distinct functional areas
- You need specific formatting or output requirements
- Instructions are longer than 10-15 lines
- Different team members manage different aspects of behavior
- Guidance is short and focused on one task
- Instructions are straightforward without special formatting
- Adding tags would make instructions harder to read
Audience Targeting
Audience targeting lets you create different behavior for different user segments.Why Use Audiences?
- Tiered Support - Premium customers get different service than free users
- Regional Adaptation - Adjust responses for language, timezone, or local regulations
- Role-Based Behavior - Treat developers differently from business users
- Channel-Specific - Behavior varies by integration (website vs. Zendesk vs. Slack)
Creating Audience Rules
Click “Add Audience Filter” in any guidance to build targeting rules: User AttributesTool Configuration
Tools extend your AI’s capabilities beyond conversation. Configure tools in the Tools tab.General Tools
Enable built-in capabilities: Web Search- Search the internet for current information
- Use when: Product launches, news, real-time data
- Example: “What are the latest features in version 2.0?”
- Retrieve specific URLs for content
- Use when: Reading documentation, release notes, blog posts
- Example: “Summarize the changelog from our blog”
- Create email escalation to support team
- User reviews and confirms before sending
- Use when: Complex issues requiring human expertise
- Immediately transfer conversation to support
- No user confirmation required
- Use when: Urgent issues, compliance concerns, high-value customers
Search Tables
Connect structured data sources for precise information retrieval:- Navigate to Tools → Search Tables
- Click Add Search Table
- Configure:
- Tool Name: How AI refers to it (e.g.,
search_products) - Description: When to use this tool
- Select Table: Choose your configured table
- Tool Name: How AI refers to it (e.g.,
- Save
MCP Servers
Connect external systems via Model Context Protocol:- Navigate to Tools → MCP Servers
- Add Server with URL and authentication
- Import Tools from the server
- Configure approval requirements for each tool
Guidance Priority and Matching
When multiple guidance rules exist, the AI uses the first matching rule based on:- Order in the list - Drag to reorder guidance rules
- Active status - Only active guidance is considered
- Audience match - User must match audience criteria
- Tool availability - Required tools must be enabled
Organizing Guidance
Specific to General Place targeted guidance first, general guidance last:Building and Deploying
After editing guidance, you must build and deploy a new version.Build Process
- Make Changes - Edit guidance, tools, or settings
- Review - Check “Unsaved Changes” indicator
- Build Version - Creates new immutable version
- Wait - System processes changes and creates deployment
- Deploy - Set new version as active in production
Build Options
Build Version, Set Active- Creates new version and deploys to production immediately
- Recommended for most updates
- Takes 30-60 seconds
- Creates version without deploying
- Use when: Testing changes before going live
- Deploy manually later from General tab
- For large deployments affecting many channels
- Receive email notification when complete
- Use when: Major behavior changes, many integrations
Deployment Status
Check deployment health in the header: Knowledge Fresh- Green indicator: AI has latest knowledge
- Orange indicator: Knowledge sources updated, rebuild needed
- Orange indicator: Edits not yet built
- Build required to save changes
- Gray indicator: No pending edits
Best Practices for Writing Guidance
Write Clear, Specific Instructions
Be explicit about what your AI should do. Instead of “be helpful with refunds,” write step-by-step instructions with specific criteria and actions. Example:Use Natural Language
Write guidance as if you’re training a new team member. You don’t need technical jargon - explain what to do and why in plain language. Example:Reference Tools Inline
Mention tools naturally in your instructions using inline code formatting: `tool_name`. This makes instructions readable and automatically configures tool access. Example:Start Narrow, Then Expand
Begin with guidance for the most common or critical scenarios. As you see how your AI performs, add more guidance to handle edge cases and new situations. Start with:Test Before Activating
Create guidance as drafts first. Use the preview panel to test how your AI responds with the new guidance before marking it as live.- Write guidance and save as draft
- Use preview panel to test responses
- Refine instructions based on test results
- Activate when satisfied
Review and Refine
Monitor conversations to see how guidance performs in practice. Update instructions based on real customer interactions to continuously improve quality. Regular review process:- Check recent conversations in Analyze
- Identify where AI responses could improve
- Update relevant guidance instructions
- Build and deploy new version
- Monitor impact of changes
Consider Audience Targeting
If different customer segments need different treatment, use audience rules rather than trying to handle all scenarios in a single guidance rule. Instead of one complex rule:Balance Guidance Quantity
Too few guidance rules may miss important scenarios. Too many overlapping rules can create confusion. Aim for clear, distinct scenarios with minimal overlap. Good structure:- 3-5 general guidance rules for common scenarios
- 2-4 audience-specific rules for key segments
- 1-2 channel-specific rules if needed
- Dozens of highly specific rules that overlap
- Single monolithic rule trying to cover everything
Managing Guidance Versions
Guidance is part of your AI’s behavior configuration, which also includes knowledge sources, available tools, and model settings. When you modify guidance:- Make your changes in the Guidance tab
- Save changes by building a new version
- Deploy the version to make it active in production
- Significant behavior changes
- New tool additions
- Audience targeting updates
- Multiple guidance updates at once
- Minor wording tweaks (batch several together)
- Experimental changes (test in preview first)
Common Patterns
Tiered Customer Support
Tiered Customer Support
Goal: Premium customers get enhanced service
Sales vs. Support
Sales vs. Support
Goal: Different behavior for prospects vs. customers
Channel-Specific Behavior
Channel-Specific Behavior
Goal: Adapt to integration context
Regional Compliance
Regional Compliance
Goal: Different responses for regulated regions
Frequently Asked Questions
AI Not Using the Right Guidance
AI Not Using the Right Guidance
Symptoms: Responses don’t match your instructionsSolutions:
- Check audience filters - user might not match criteria
- Verify guidance is active (toggle on)
- Review guidance order - a general rule might match first
- Ensure required tools are enabled
- Check instruction clarity - be more explicit
Tools Not Available
Tools Not Available
Symptoms: AI says it can’t use a tool you enabledSolutions:
- Verify tool is checked in allowed_tools for the active guidance
- Confirm tool is enabled in Tools tab
- For search tables, ensure table exists and has data
- For MCP servers, check connection status
- Rebuild to apply tool changes
Inconsistent Responses
Inconsistent Responses
Symptoms: Similar questions get different answersSolutions:
- Tighten instructions to reduce variability
- Provide specific examples of desired responses
- Use search tables instead of general knowledge for facts
- Add explicit rules for edge cases
- Review conversation history to identify patterns
Build Failures
Build Failures
Symptoms: “Build failed” error when creating versionSolutions:
- Check for TODO items in advanced configuration
- Verify all required fields are filled
- Ensure at least one guidance exists (or system prompt in advanced)
- Review error message for specific issue
- Contact support if error persists
Knowledge Out of Date
Knowledge Out of Date
Symptoms: Orange “Knowledge Stale” indicatorSolutions:
- Rebuild to use latest knowledge snapshots
- This happens when data providers sync new content
- Build process incorporates latest knowledge into deployment
Next Steps
Now that you understand how to instruct your AI:- Improve Answers - Refine responses based on real conversations
- Configure Escalations - Set up handoff workflows for human support
- Deploy Your AI - Make your configured AI available to users
- Review Conversations - Monitor how your guidance performs