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/conversation
      • V1/service
      • V1/user
      • V1/role
      • V1/admin
      • V1/webhook_destination
      • V1/dynamic_behavior_set
      • V1/metric
      • V1/simulation
      • Models
      • V1/organization
      • V1/service
      • V1/user
      • V1/role
      • V1/conversation
      • 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
  • State Types
  • Action State Implementation Example
  • Reasoning States and Abstract Topology

Was this helpful?

Export as PDF
  1. Concepts
  2. Context Graphs

State-Based Architecture

A context graph is a structured topological field of interconnected states that guide agent behavior and decision-making. Context graphs implement a hierarchical state machine (HSM) architecture, where states are organized in a structured hierarchy that enables efficient organization of complex problem spaces.

State Types

Each state type serves a specific purpose in managing conversation flow and agent behavior.

Context Graphs orchestrate agent behavior through a structured hierarchy of states:

  • Decision States: Choose optimal actions based on real-time data and objectives, drawing on the integrated Memory-Knowledge-Reasoning (M-K-R) system.

  • Action States: Execute defined tasks with clear rules and constraints, powered by the current M-K-R context.

  • Reflection States: Allow introspection and strategic reasoning. These are critical junctures in the M-K-R cycle, where the agent might re-evaluate its understanding (Knowledge), recontextualize Memory, and refine its Reasoning pathways before proceeding.

  • Recall States: Allow explicit integration with user memory to increase personalization. These states directly tap into the Memory component of M-K-R, bringing historical context to bear on current Knowledge application and Reasoning.

  • Annotation States: Clarify and segment complex interactions.

  • Side-Effect States: Touch points for external system interaction, enabling actions.

Action State Implementation Example

Each type of state has its own unique set of structured parameters and implementation best practices. For example, see below for a more detailed summary of the Action State.

Action State

Action states create engagement fields where the agent directly interacts with clients. They require careful design with balanced constraints to create optimal movement paths.

Required Parameters

  • type: Must be "action"

  • objective: Clear statement of the state's goal

  • actions: Ordered list of client-facing interaction steps

  • intra_state_navigation_guidelines: Rules for action sequencing and exit condition selection

  • action_guidelines: Behavioral rules for the agent

  • boundary_constraints: Limitations on agent behavior

  • exit_conditions: List of conditions that trigger state transitions

Optional Parameters

  • included_contexts: Additional context information

  • message_metadata: Metadata about messages in this state

Example

{
  "engage_client_on_in_scope_topic": {
    "type": "action",
    "objective": "Engage the client on their current query or queries in order of severity, always personalizing responses to your understanding of the user, while handling any natural topic changes within the conversation",
    "actions": [
      "Address all of the user's queries. Provide upfront value quickly in your response before asking follow up questions...",
      "Ask specific, detailed follow up questions to personalize my response.",
      "Handle any topic changes within the natural flow of conversation...",
      "..."
    ],
    "intra_state_navigation_guidelines": [
      "When client introduces a new topic, handle it within this state rather than triggering a state change",
      "Track the current topic being discussed in the conversation context",
      "If client changes topic, explicitly acknowledge the change and continue engagement on new topic",
      "..."
    ],
    "action_guidelines": [
      "Personalize all responses to the client's user model and your understanding of the user...",
      "Provide upfront value quickly in your response before asking follow up questions...",
      "..."
    ],
    "boundary_constraints": [
      "Never trigger state changes for topic switches",
      "Never force the client back to a previous topic unless they request it",
      "..."
    ],
    "exit_conditions": [
      {
        "description": "The client has finished discussing the current topic and there are potentially other topics to review...",
        "next_state": "reflect_on_conversation_topics"
      },
      {
        "description": "The client strongly and explicitly requests to immediately terminate the session",
        "next_state": "end_session"
      }
    ],
    "message_metadata": [
      "coaching_session",
      "focused_engagement"
    ],
    "included_contexts": ["task"]
  }
}

Reasoning States and Abstract Topology

Reasoning states (which include Decision and Reflection states) play a critical role in the traversal of context graphs, acting as key nodes in the integrated Memory-Knowledge-Reasoning (M-K-R) process. They impact traversal by providing both a local and global view of the problem space via an abstract topology. This abstract topological view:

  1. Prevents Loops: Avoids repetitive cycles of states that don't make progress toward goals

  2. Prevents Bad Traversals: Eliminates paths that don't properly consider the more global problem space view

  3. Optimizes Transitions: Prevents both premature and late transitions to adjacent problem spaces even without perfect exit conditions

The abstract topology effectively provides a "map" of the entire problem space, allowing the agent to make informed decisions about where to go next based on both immediate context and the overall structure of the problem. This is similar to how a human expert would consider both the current details of a situation and their broader understanding of the entire domain when making decisions.

Here's a simplified example of an abstract topology for a medical check-in flow:

START(new user) -> [A] welcome_patient
START(returning user) -> [A] welcome_patient

[A] welcome_patient
  (Client ready to proceed with check-in) -> [A] medication_adherence_check

[A] medication_adherence_check
  (Medication information provided) -> [A] vasodilator_check
  (Medication concerns identified) -> [A] assess_medication_impact
  ...

[A] check_chest_pain
  (No concerning findings) -> [A] check_shortness_of_breath
  (Concerning features present) -> [R] reflect_on_session_data
  ...

[R] reflect_on_session_data -> [D] determine_exercise_clearance

[D] determine_exercise_clearance
  (All criteria met) -> [A] summarize_recommendations_approved
  (Disqualifying findings) -> [A] summarize_recommendations_disqualified
  ...

[A] patient_questions
  (No further questions) -> [A] end_session

[A] end_session -> END

This abstract topology provides a concise map of the problem space, showing key states and transitions. With this global view, the agent can make informed decisions about state traversal, ensuring that the conversation follows a coherent and purposeful path while avoiding problematic patterns like loops or premature transitions.

Implementation Considerations

  1. Context Density Calibration:

    • High-density example: "Verify all required regulatory compliance elements while maintaining strict protocol adherence"

    • Medium-density example: "Engage the client on their current query while handling natural topic changes within conversation flow"

    • Low-density example: "Create space for open exploration of possibilities without excessive structure"

  2. Action Sequencing:

    • Define action sequences that create natural progressive movement

    • Balance between prescriptive steps and open exploration

    • Example from healthcare implementation: "Address user queries → Ask personalized follow-up questions → Handle topic changes → Track conversation context"

  3. Navigation Guidelines Implementation:

    • Define intra-state movement behaviors

    • Example: "When client introduces a new topic, handle it within this state rather than triggering a state change"

    • Implementation shows how agent navigates within a single region of the field

  4. Exit Condition Design:

    • Create clear, detectable boundaries for state transitions

    • Support both simple state transitions and cross-graph navigation

    • Include safety exits for unexpected situations

PreviousContext GraphsNext[Advanced] Field Implementation Guidance

Last updated 10 days ago

Was this helpful?