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
  • Agent Data Output Properties
  • Purpose of Data Output Schema
  • Usage Example
  1. Developer Guide
  2. AI Agent Development
  3. AI Agent

Data Output

A crucial aspect of this integration is the Agent Data Output, which defines how the data generated by the AI agent is structured and utilized within the workflow. This documentation explains the purpose and details of the data output schema for the AI agent.

Agent Data Output Properties

The Agent Data Output schema is essential for defining the structure of the data that the AI agent produces. This schema ensures that the output is well-structured, consistent, and can be easily consumed by other parts of the workflow or external systems. Below are the key properties of the Agent Data Output schema, along with examples for each.

Schema

  • Name: schema

  • Type: string

  • Description: This property specifies the URI or the definition of the JSON Schema used to describe the agent data output. The JSON Schema provides a blueprint for the structure and format of the data, ensuring that the output adheres to a predefined format.

  • Example:

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

Purpose of Data Output Schema

The data output schema serves several important purposes in the context of AI agents within xFlow:

  1. Standardization: By defining a clear schema, the output data from the AI agent is standardized. This ensures that all data produced follows a consistent format, making it easier to process and interpret.

  2. Validation: The schema provides a means to validate the output data. By adhering to the schema, the workflow engine can ensure that the data produced by the AI agent is correct and complete, reducing the likelihood of errors.

  3. Interoperability: A well-defined schema facilitates interoperability between different components of the workflow. Other parts of the system, such as subsequent workflow states or external applications, can easily consume the output data if they know its structure in advance.

  4. Documentation: The schema acts as documentation for the output data. Developers and system integrators can refer to the schema to understand what data is produced by the AI agent and how it can be used.

Usage Example

Here is an example of how to configure the Agent Data Output in an AI Agent State within a xFlow workflow:

- name: ExampleAIState
  type: aiagent
  agentName: ExampleAgent
  aiModel: gpt-4o
  systemMessage: "You are an assistant designed to provide accurate answers."
  userMessage: '${ "User: " + .request.question }'
  output: 
    schema: 
      type: "object"
      properties: 
        response: 
          type: "string"
          description: "The AI's response to the user question"
      required: ["response"]
  maxToolExecutions: 5
  memory: 
    memoryId: "session123"
    memoryType: "message_window"
    maxMessages: 10
  tools:
    - name: SEARCH_DOCUMENTS
      description: "Search for relevant documents based on the user's query."
      parameters: 
        schema: 
          type: "object"
          properties: 
            query: 
              type: "string"
              description: "The search query"
          required: ["query"]
      output: 
        schema: 
          type: "object"
          properties: 
            documents: 
              type: "array"
              items: 
                type: "string"
                format: "uri"
          required: ["documents"]
      execution:
        actionMode: "sequential"
        actions:
          - name: "FetchDocuments"
            functionRef:
              refName: "FetchDocumentsFunction"
              arguments:
                query: "${ .request.query }"
  agentOutcomes:
    - condition: '${ $agentOutcome.returnValues.response != null }'
      transition: SuccessState
    - condition: '${ $agentOutcome.returnValues.response == null }'
      transition: ErrorState
PreviousToolsNextAgent Outcomes

Last updated 11 months ago

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

AI Agent State spec