LogoLogo
Go to website
  • Welcome
  • Getting Started
    • Amigo Overview
      • System Components
      • Overcoming LLM Limitations
      • [Advanced] Future-Ready Architecture
      • [Advanced] The Accelerating AI Landscape
    • The Journey with Amigo
      • Partnership Model
  • Concepts
    • Agent Core
      • Core Persona
      • Global Directives
    • Context Graphs
      • State-Based Architecture
      • [Advanced] Field Implementation Guidance
    • Functional Memory
      • Layered Architecture
      • User Model
      • [Advanced] Recall Mechanisms
      • [Advanced] Analytical Capabilities
    • Dynamic Behaviors
      • Side-Effect Architecture
      • Knowledge
      • [Advanced] Behavior Chaining
    • Evaluations
      • [Advanced] Arena Implementation Guide
    • [Advanced] Reinforcement Learning
    • Safety
  • Glossary
  • Advanced Topics
    • Transition to Neuralese Systems
    • Agent V2 Architecture
  • Agent Building Best Practices
    • [Advanced] Dynamic Behaviors Guide
  • Developer Guide
    • Enterprise Integration Guide
      • Authentication
      • User Creation + Management
      • Service Discovery + Management
      • Conversation Creation + Management
      • Data Retrieval + User Model Management
      • Webhook Management
    • API Reference
      • V1/organization
      • V1/service
      • V1/conversation
      • V1/user
      • V1/role
      • V1/admin
      • V1/webhook_destination
      • V1/dynamic_behavior_set
      • V1/metric
      • V1/simulation
      • Models
      • V1/organization
      • V1/service
      • V1/conversation
      • V1/user
      • V1/role
      • V1/admin
      • V1/webhook_destination
      • V1/dynamic_behavior_set
      • V1/metric
      • V1/simulation
      • Models
Powered by GitBook
LogoLogo

Resources

  • Pricing
  • About Us

Company

  • Careers

Policies

  • Terms of Service

Amigo Inc. ©2025 All Rights Reserved.


On this page
  • Feature: Override Flag Mechanism
  • Implementation Best Practices
  • Design Along the Instruction Flexibility Spectrum
  • Separate Redlining from Product Experience
  • Using the Override Flag Strategically
  • Dynamic Behavior Spectrum and Practical Binning
  • Decision Framework for Practical Implementation
  • Measurement Approaches
  • Example Implementation
  • Agent Autonomy Spectrum
  • Common Pitfalls

Was this helpful?

Export as PDF
  1. Agent Building Best Practices

[Advanced] Dynamic Behaviors Guide

Feature: Override Flag Mechanism

  • Each dynamic behavior can have an optional override flag that determines how it integrates with existing context

  • When the override flag is ON:

    • All other context (guidelines, boundary constraints, etc.) are removed from the context

    • Only the agent identity, background, and global guidelines remain active

    • The agent's behavior scope is reduced strictly to that defined by the selected dynamic behavior

    • This is problem space displacement - completely replacing the existing problem topology rather than merging with it

    • Used primarily for safety-critical or compliance-mandated behaviors where merging could create conflicts

  • When the override flag is OFF (default):

    • The dynamic behavior gets merged into the existing problem topology

    • This creates a combined problem space that incorporates both the original context and the dynamic behavior

    • Behavior strength can vary from mandatory integration to optional recommendations

    • This approach preserves conversation continuity while enriching the agent's capabilities

Implementation Best Practices

Design Along the Instruction Flexibility Spectrum

Instructions can range widely in their prescriptiveness:

Open-Ended Guidance

  • Allows significant agent discretion

  • Provides general direction without strict requirements

  • Creates a knowledge-enriched environment for the agent

  • Best for creative, exploratory, or coaching conversations

  • Example: "You have access to these nutrition resources. Consider their relevance to the user's goals."

Structured Protocols

  • Provides clear, specific guidelines

  • Balances direction with some contextual adaptation

  • Ensures consistency while allowing natural conversation

  • Example: "When discussing exercise plans, ask about previous injury history before making recommendations."

Strict Instructions

  • Enforces precise behavior patterns

  • Minimizes agent discretion for safety-critical scenarios

  • Essential for regulatory compliance or high-risk situations

  • Example: "If the user mentions suicidal thoughts, immediately provide crisis resources and follow safety protocol X."

Separate Redlining from Product Experience

Split your dynamic behaviors into two categories:

Redlining (Safety/Compliance)

  • Purpose: Protect against medical emergencies, legal issues, or user harm

  • Trigger Design: Exact patterns that must be detected

  • Instructions: Can be more directive and specific

  • Testing: Subject to unit tests that must pass for every release

  • Example: Suicide prevention protocol, legal disclaimers

Product Experience

  • Purpose: Enhance user experience, provide relevant content

  • Trigger Design: Broader thematic matches (e.g., "exercise", "protein", "recipes")

  • Instructions: Provide options rather than mandates (e.g., "You have access to these resources, surface them if relevant")

  • Testing: Measured via metrics and user experience evaluation

  • Example: Suggesting relevant meal plans when user discusses nutrition

Using the Override Flag Strategically

The override flag creates a distinct separation between "hardline" and "softline" behaviors:

Hardline Behaviors (Override Flag ON)

  • Used for critical situations where safety, legal compliance, or harm prevention takes absolute priority

  • Completely replaces normal agent behavior with a highly restricted protocol

  • Prevents potential conflicts between existing context and critical response requirements

  • Ensures consistent, unambiguous handling of high-risk scenarios

  • Examples of implementation bins:

    • Harmful Content Prevention: For requests to build weapons, create harmful content, etc. - implement legal disclaimers and use predetermined, repetitive language to refuse engagement (robotic, clear warnings)

    • Crisis Intervention: For suicide tendencies or self-harm - focus exclusively on mental health support, refuse to engage on other topics, provide crisis resources with specific emergency numbers

    • Legal Compliance: For regulated topics requiring specific disclaimers - deliver mandatory language verbatim without modification or contextual adaptation

    • Security Violations: For attempts to bypass security measures - implement strict refusal protocols with minimal variation

Softline Behaviors (Override Flag OFF)

  • Used for context enrichment, recommendations, or enhancing user experience

  • Merges with existing problem topology for seamless conversation integration

  • Can vary in implementation strength based on conversational relevance

  • Preserves natural conversation flow while adding value

  • Examples of implementation bins:

    • Knowledge Enhancement: For specific topics (e.g., discussions about a particular drug) - must integrate relevant information naturally but intelligently within the existing conversation

    • Resource Recommendation: For general topics (e.g., workouts, nutrition) - optionally integrate curated high-quality resources when contextually appropriate

    • Experience Improvement: For general user experience - provide additional capabilities or insights that enhance the conversation without disrupting its flow

    • Contextual Guidance: For specialized domains - offer domain-specific frameworks that guide reasoning without restricting conversational scope

Dynamic Behavior Spectrum and Practical Binning

When building agents, determining which type of dynamic behavior to implement requires careful consideration. The following spectrum provides a practical framework for categorizing behaviors:

HARDLINE (Override ON)                                           SOFTLINE (Override OFF)
|-------------------|-------------------|-------------------|-------------------|
Verbatim            Restricted          Strong              Moderate           Optional
Refusal             Scope               Integration         Integration         Enhancement
|-------------------|-------------------|-------------------|-------------------|
Highest Control     High Control        Medium Control      Low Control        Minimal Control

Binning Criteria for Practical Agent Building

When determining which bin a dynamic behavior belongs in, evaluate against these practical criteria:

1. Risk Assessment

  • High Risk (Hardline - Verbatim/Restricted): Potential for harm, legal liability, or serious negative outcomes

    • Example: Suicidal ideation, requests for dangerous content, regulatory violations

  • Medium Risk (Strong Integration): Sensitive topics requiring careful handling but not immediate danger

    • Example: Health advice, financial guidance, personal data discussions

  • Low Risk (Moderate/Optional): General informational or enhancement topics

    • Example: Workout recommendations, recipe suggestions, productivity tips

2. Content Determinism

  • High Determinism Required (Hardline): Legal text, disclaimers, specific crisis resources that must be delivered exactly as written

  • Medium Determinism (Strong Integration): Factual information that must be included but can be contextualized

  • Low Determinism (Optional): Suggestions, recommendations, or optional content

3. Context Compatibility

  • Incompatible (Hardline): Topics that fundamentally conflict with existing conversation context

    • Example: Crisis intervention during a product support conversation

  • Partially Compatible (Strong/Moderate): Topics that can be integrated but require significant adaptation

    • Example: Drug information during a fitness conversation

  • Highly Compatible (Optional): Topics that naturally complement existing context

    • Example: Recipe suggestions during a nutrition conversation

4. Response Urgency

  • Immediate Action Required (Hardline): Crisis situations requiring instant protocol activation

    • Example: Self-harm indications requiring immediate resource provision

  • Timely Response (Strong Integration): Important but not urgent information

    • Example: Medication side effects that should be mentioned promptly

  • Non-time-sensitive (Optional): Helpful but not urgent information

    • Example: General health tips that could be mentioned when contextually relevant

Decision Framework for Practical Implementation

When implementing dynamic behaviors in agent systems, use this decision tree:

  1. Is this a safety or legal compliance issue?

    • Yes → Likely requires Hardline (Override ON) approach

    • No → Continue evaluation

  2. Would mixing this behavior with existing context create confusion or dilute critical information?

    • Yes → Consider Hardline approach

    • No → Continue evaluation

  3. How critical is the exact delivery of specific information or language?

    • Critical (verbatim required) → Hardline - Verbatim Refusal

    • Important but adaptable → Hardline - Restricted Scope or Strong Integration

    • Flexible → Moderate or Optional Integration

  4. What is the primary goal of this behavior?

    • Protect users/prevent harm → Hardline

    • Deliver critical information → Strong Integration

    • Enhance conversation quality → Moderate or Optional Integration

By systematically evaluating each behavior against these criteria, agent builders can implement a balanced system that appropriately handles both critical safety requirements and general user experience enhancements.

Measurement Approaches

For Redlining

  • Implement unit tests

  • Every critical safety case must be tested and pass before release

  • 100% compliance expected

For Product Experience

  • Develop metrics that focus on:

    • Is content being served appropriately?

    • Is content relevant to the conversation?

    • Is content repetitive?

    • Overall user experience quality

  • Monitor trends over time (e.g., 30-day metrics)

  • Audit samples where expected behaviors didn't trigger

  • Focus on anomaly detection rather than expecting 100% triggering

Example Implementation

Poor Implementation (Too Rigid)

Trigger: "protein"
Instruction: "You MUST suggest the following three protein shakes EVERY time a user mentions protein..."

Better Implementation (Natural)

Trigger: ["protein", "nutrition", "workout", "exercise", "diet"]
Instruction: "You are an in-app assistant with access to 10 high-protein recipe deep links. Each has a brief description. You may surface these when relevant to the conversation about nutrition or fitness. Use your judgment on how many to suggest (max 3) and integrate naturally into your response. Don't repeat recommendations."

Hardline Implementation (Override Flag ON)

Trigger: ["suicide", "kill myself", "end my life", "want to die"]
Override: true
Instruction: "IMPORTANT: This is a mental health emergency. Focus ONLY on providing mental health support. Do not engage with any other topics. Provide the National Suicide Prevention Lifeline (988) immediately. Ask if the user is in immediate danger and recommend calling emergency services (911) if there is immediate risk. Use calm, supportive language and avoid judgmental terms. Continue to focus exclusively on safety until the situation is resolved."

Softline Implementation (Override Flag OFF)

Trigger: ["aspirin", "medication", "drug interactions", "over the counter"]
Override: false
Instruction: "When discussing medications, integrate relevant drug safety information. For aspirin specifically, mention: 1) Potential interactions with blood thinners, 2) Risks for people with ulcers or bleeding disorders, 3) Recommendation to consult with healthcare provider before regular use. Present this information conversationally within the existing discussion context."

Agent Autonomy Spectrum

The design of triggers and instructions directly impacts agent autonomy:

High Autonomy Configuration

  • Uses vaguer triggers combined with open context

  • Grants the agent greater freedom to determine behavior based on user model and interaction context

  • Functions like an associative knowledge cluster available to the agent

  • Agent can selectively draw from this knowledge as the conversation evolves

  • Best for creative coaching, exploratory discussions, and personalized experiences

Limited Autonomy Configuration

  • Uses stricter triggers paired with precise instructions

  • Effectively simulates protocol overrides in critical situations

  • Limits agent discretion and enforces specific response patterns

  • Necessary for regulated industries, safety-critical information, and compliance requirements

Strategic Implementation with Override Flag

  • The override flag provides a powerful tool for creating strategic transitions across the autonomy spectrum

  • Hardline behaviors (override ON) represent the most restricted autonomy state

    • Create complete context replacement for safety-critical scenarios

    • Force the agent into highly constrained response patterns

    • Ensure compliance with regulatory requirements or safety protocols

  • Softline behaviors (override OFF) allow for graduated autonomy restrictions

    • Maintain conversation continuity while introducing guidance or enrichment

    • Preserve agent identity and natural conversational abilities

    • Allow for contextual adaptation while adding value

  • Most effective systems implement a hierarchy of behaviors:

    • Critical safety issues use hardline behaviors with override ON

    • Domain-specific guidance uses softline behaviors with strong integration requirements

    • General experience enhancement uses softline behaviors with optional integration

Common Pitfalls

  1. Over-engineering: Creating overly specific triggers that rarely match

  2. Robotic responses: Making behaviors too directive, leading to unnatural interactions

  3. Expecting 100% triggering: Product enhancements should be contextual, not forced

  4. Mixed responsibilities: Having the same team design both safety and product behaviors

  5. Inconsistent testing: Using the wrong evaluation approach for different behavior types

  6. Misunderstanding behavior integration: Expecting behaviors to be rigidly enacted rather than merged with the context graph state

  7. Ignoring the selection process: Not accounting for the three options (re-select previous behavior, select new behavior, select nothing) and the persistence mechanism in behavior design

  8. Overusing the override flag: Applying hardline behaviors with the override flag ON for non-critical situations, disrupting conversation flow unnecessarily

  9. Conflicting behavior priorities: Failing to establish clear precedence rules when multiple behaviors could trigger simultaneously

  10. Context whiplash: Frequently switching between hardline (override ON) and softline behaviors, creating a disjointed user experience

  11. Neglecting flag state persistence: Not considering how override state affects behavior re-sampling and persistence across conversation turns

PreviousAgent V2 ArchitectureNextEnterprise Integration Guide

Last updated 5 days ago

Was this helpful?