xFlow
  • Overview
    • Introduction
    • Core Features
    • Architecture
      • High Level Architecture
      • Tech Stack
      • Deployment Flexibility
      • Performance and Scalability
      • Security Compliance
  • Getting Started
    • Installation
    • Quick Start
    • Configuration
  • Core Concepts
    • Serverless Workflow Specification
    • Workflow data handling
    • Workflow Expressions
    • Error handling
    • Input and Output schema definition
    • User Task
    • User Forms
      • Lowcode Form
      • Advanced User Form
    • AI Agents in Enterprise Business Processes
    • Comparisons
      • BPMN2
  • Developer Guide
    • Architecture
    • API Reference
    • Workflow States Reference
      • Event State
      • Operation State
      • Switch State
      • Parallel State
      • Inject State
      • ForEach State
      • Callback State
      • UserTask State
      • AIAgent State
      • AIAgentProxy State
      • UserProxyAgent State
      • AI Outbound Agent State
    • Workflow Functions
      • REST
      • GraphQL
      • Custom
        • Built-in Functions
        • Lowcoder Query Function
      • Function Auth
    • Workflow Secrets
    • Integrations
    • Workflow Modeler
    • Frontend Development
      • Forms
        • Lowcode Form
        • Advanced User Form
    • Serverless Workflow Development
      • Operation State
      • Switch State
      • Parallel State
      • ForEach State
      • Callback State
      • User Task State
    • AI Agent Development
      • AI Agent
        • Predefined LLM
        • LLM Configuration
        • Multi LLM Configuration
        • Chat Memory
        • Tools
        • Data Output
        • Agent Outcomes
      • AI Agent Proxy
        • AI Agents Integration
      • User Proxy Agent
      • xChatBot Integration
  • Examples
    • Basic Examples
    • Advanced Examples
      • Loan Approval Workflow
      • QMS AP Workflow
  • Administration
    • Monitoring and Logging
    • Security
    • Performance Tuning
  • Extensions and Customizations
    • Plugins and Add-ons
  • Troubleshooting
    • Common Issues
    • FAQs
  • Release Notes
    • Version History
    • Upcoming Features
  • Support
    • Contact Information
    • Community
Powered by GitBook
On this page
  • Purpose of AI Agent Proxy State
  • Supported AI Agent Frameworks
  • Properties of AI Agent Proxy State
  • How to Implement AI Agent Proxy State
  1. Developer Guide
  2. AI Agent Development

AI Agent Proxy

PreviousAgent OutcomesNextAI Agents Integration

Last updated 11 months ago

The AI Agent Proxy State in xFlow is designed to facilitate the integration of AI agents developed using any framework or programming language into xFlow workflows. This state acts as an intermediary, allowing for seamless communication and execution of AI agents regardless of their underlying technology stack. This documentation explains the purpose of the AI Agent Proxy State, how it supports integration with various AI agent frameworks, and provides guidance on implementing this state in xFlow workflows. For detailed information on integrating AI agents using the AI Agent Proxy State, refer to the .

Purpose of AI Agent Proxy State

The AI Agent Proxy State serves as a bridge between xFlow workflows and AI agents developed externally. Its primary purposes include:

  1. Interoperability: Enables AI agents built with different frameworks and languages to be integrated into xFlow workflows, promoting interoperability and flexibility.

  2. Abstraction: Provides an abstraction layer that simplifies the interaction between the workflow and the AI agent, hiding the complexities of the underlying AI agent implementation.

  3. Scalability: Supports distributed execution and scaling of AI agent tasks, leveraging xFlow’s workflow engine capabilities.

  4. Standardization: Ensures that AI agent interactions follow a standardized protocol, making it easier to manage and maintain integrations.

Supported AI Agent Frameworks

The AI Agent Proxy State can integrate AI agents developed using various frameworks and languages, including but not limited to:

  • Langchain: A popular framework for building language models and conversational AI applications.

  • Spring AI: An extension of the Spring framework tailored for developing AI applications in Java.

  • LlamaIndex: A framework for building and deploying large language models.

  • Custom Implementations: Any AI agent developed using custom code in languages such as Python, JavaScript, Java, etc.

Properties of AI Agent Proxy State

Agent Name

  • Name: agentName

  • Type: string

  • Description: The name of the AI agent to be invoked. This is used to identify the specific AI agent within the workflow.

  • Example:

    agentName: "MyCustomAgent"

System Message

  • Name: systemMessage

  • Type: string

  • Description: The system message that provides context or instructions to the AI agent. This message is typically used to prime the AI agent with necessary background information.

  • Example:

    systemMessage: "You are an AI assistant designed to provide technical support."

User Message

  • Name: userMessage

  • Type: string

  • Description: The message from the user that the AI agent will process. This is dynamically populated based on the workflow’s data.

  • Example:

    userMessage: '${ "User: " + .request.question }'

Execution

  • Name: execution

  • Type: object

  • Description: Defines how the AI agent’s actions are to be executed, including the function reference and any necessary arguments.

  • Example:

    execution:
      functionRef:
        refName: "ExecuteCustomAgent"
        arguments:
          input: "${ .request.data }"

Output

  • Name: output

  • Type: object

  • Description: The expected output schema from the AI agent, defining how the AI agent’s response should be structured.

  • Example:

    output: 
      schema: 
        type: "object"
        properties: 
          response: 
            type: "string"
            description: "The AI agent's response to the user query"
        required: ["response"]

How to Implement AI Agent Proxy State

To integrate an AI agent using the AI Agent Proxy State, follow these steps:

  1. Define the AI Agent Proxy State: In your workflow definition, add an AI Agent Proxy State with the necessary properties such as agentName, systemMessage, userMessage, execution, and output.

  2. Configure the Execution: Specify the functionRef to define how the AI agent should be invoked. This includes the reference name and any arguments that need to be passed to the AI agent.

  3. Handle the Output: Define the output schema to specify the expected structure of the AI agent’s response. This ensures that the workflow can correctly process and utilize the data returned by the AI agent.

Example Workflow Configuration

- name: CustomAIProxyState
  type: aiagentproxy
  agentName: "MyCustomAgent"
  systemMessage: "You are an AI assistant designed to provide technical support."
  userMessage: '${ "User: " + .request.question }'
  execution:
    functionRef:
      refName: "ExecuteCustomAgent"
      arguments:
        input: "${ .request.data }"
  output: 
    schema: 
      type: "object"
      properties: 
        response: 
          type: "string"
          description: "The AI agent's response to the user query"
      required: ["response"]
  transition: 
    nextState: "HandleResponseState"

For more detailed information and advanced configurations, refer to the and the .

AI Agent Proxy Integration Guide
AI Agent Proxy State Documentation
AI Agent Proxy Integration Guide