# Development Guide

# 1. Development of Instruction-based Agents

# 1.1 Function Overview

An instruction-based agent can be quickly generated with a one-sentence description or prompt configuration. It is suitable for simple conversation scenarios such as "copywriting generation, story creation, translation, AI painting", and supports "calling knowledge bases, publishing H5 pages, publishing APIs", etc. After creation, users can publicly release it to the iFLYTEK Starry Sky Agent Development Platform, or share it with other users for their own use.

# 1.2 Agent Creation

After entering the homepage of iFLYTEK Starry Sky Agent Development Platform (opens new window), click Create Application on the left side. Select "Create with Prompt" in the pop-up dialog box, then enter a sentence in the pop-up dialog box, click "Quick Create", and enter the instruction-based agent setting page. Developers can perform detailed agent settings on this interface. The following describes how to set up an instruction-based agent on the agent setting page.

# 1.2.1 Basic Information Filling

The basic information for creating an instruction-based agent includes four required fields: "Agent Name, Agent Category, Agent Introduction, Agent Avatar". To provide clear guidance for users to use the agent, it is recommended to supplement the agent with complete information as much as possible.

a. Agent Name

Design an easily recognizable name for your instruction-based agent, such as "Weekly Report Assistant", "PPT Outline Agent", etc., with a maximum of 20 characters. The agent name should reflect the core functions, allowing more users to quickly understand the agent's functions and retrieve your agent based on the functions.

For example, for the "Short Video Script Agent", users can find the agent you created and put on the shelf in the agent market by searching for keywords such as "short video", "script", "short video script".

b. Agent Category

Select the agent type for your instruction-based agent. Currently, the agent center includes 7 categories: Workplace, Creation, Learning, Programming, Life, Health, and Others. After selecting a category, when your agent's shelf application is approved, it will be displayed in this category in the agent market.

Warm reminder: Correctly selecting the category will help users find your agent in the market.

c. Agent Introduction

Fill in a concise and clear introduction to the functions of the instruction-based agent, and clearly inform users how to use the agent, with a limit of 100 characters here.

For example, the function description in the "Interviewer Simulator" agent is: I can help you with mock interview training. Enter the job title, and I will give you 5 common interview questions for that position.

# 1.2.2 Prompt Editing

The content in the dialog box will be used as the input instruction for the large model, and the settings of these instructions will directly affect the usage effect of the agent. Prompt editing mainly includes four key fields: Role, Task, and Response Requirements.

The specific descriptions are as follows:

Field Description
Role Set a role for the agent, such as the "Interviewer Simulator" assistant, and the filled role setting can be "You are an experienced interviewer"
Task Fill in the task that the agent needs to complete. For example, for the "Interviewer Simulator" assistant, the target task is "You need to list common interview questions for the position I mention".
Response Requirements Fill in other instructions or requirements for the agent. For example, for the "Interviewer Simulator" assistant, the requirement description is "Need to give me 5 questions, displayed in separate items".

# 1.2.3 Advanced Configuration

Advanced configuration sets the functions of the agent other than role dialogue, including Capabilities, Knowledge Base, Conversation Enhancement, which you can configure here to improve the user experience and dialogue effect of the agent.

The specific descriptions are as follows:

  • Knowledge Base: Binding the corresponding knowledge base to the agent during agent creation means that the agent will retrieve answers from your knowledge base to reply to users during interaction. Click the "Add Knowledge Base" button on the right, select the knowledge base to be bound in the pop-up page, and click "Add" on the right to complete the binding. Warm reminder: If the uploaded and used knowledge base contains private data of you or your enterprise, please carefully choose whether to put the agent on the agent square. After selecting to put it on the shelf, other users will also access the information in your knowledge base when using the agent.
  • Conversation Enhancement:
    • Opening Remarks: Opening remarks are the first dialog box that automatically appears when a user enters the agent, used to introduce the agent. You can configure the agent's opening remarks to help chat users quickly understand your agent.
    • Role Voice: The agent supports setting a speaker. When users choose to broadcast the agent-generated content by voice, it can be played by different speakers. Currently, the role voices on the platform are divided into two categories: official premium voices and basic timbres. Official premium voices can filter male and female voices according to gender. Basic timbres support 9 types of Chinese pronunciation, 2 types of English pronunciation, and 3 types of small language pronunciations. If you want to freely configure the speaker, you can also configure the pronunciation through "My Speakers", and support adjusting the speaker's speech rate.
    • Multi-turn Conversation: Multi-turn conversation means that you can choose to set whether the agent needs to have context memory during the conversation. If you select "Turn off multi-turn conversation", the agent will not remember the previous content during the conversation, and each round of conversation is a new round. If enabled, the agent will carry the previous content during the conversation.
    • Background Image: Users can upload an image as the background image during the conversation; if disabled, this function is not supported.

# 1.3 Debugging and Preview

The platform supports debugging the agent while creating it. On the agent setting page, developers can write the agent's prompt and debug the effect at the same time to verify the effect of the prompt until they are satisfied.

# 1.4 Listing and Sharing

# 1.4.1 Listing

After creating the agent, developers can publish the created agent:

  • Publish as iframe format

Developers can find the agent to be published from the menu bar in the release management and click "Publish".

In the pop-up interface, select the platform to be published to complete the release.

# 1.4.2 Sharing

The iFLYTEK Starry Sky Agent Development Platform supports sharing instruction-based agents as independent Web applications. Users can copy the agent access address with one click and share the link with more users to use the agent you created.

You can view the created agents on the "My Agents" page. When the mouse hovers over the share option below the agent you want to share, two sharing methods will appear; select one to share the agent.

# 2. Development of Workflow-based Agents

# 2.1 Function Overview

A workflow-based agent arranges multiple task nodes into a coherent process to realize automated processing of various business scenarios. Nodes cover links such as data input, processing, and output, together building an efficient and flexible workflow.

Typical scenarios include:

  1. Office Efficiency Improvement: In scenarios such as office, medical care, and innovative applications, use the iFLYTEK Starry Sky Agent Development Platform to quickly build processes and applications, such as knowledge-based intelligent customer service systems, knowledge and tool-based technical support agents, campus student agents, hospital guidance and consultation agents, etc.

  2. Creative Realization: In light office, life, and entertainment scenarios, develop Spark workflow agents to realize inspirations and put them on the shelf for sharing, such as industry news morning report agents, picture book creation agents, various casual game agents, etc.

# 2.2 Agent Creation

After entering the homepage of iFLYTEK Starry Sky Agent Development Platform (opens new window), click the "Create" button on the left side. Select "Create with Workflow" in the pop-up dialog box.

Workflow creation is divided into two methods: custom creation and template creation, specifically as follows:

  1. Custom Creation: Provides a blank canvas, and users can create a new workflow-based agent according to their own needs.
  2. Template Creation: The platform provides rich templates, and similar functions can be reproduced with one click through templates. Developers with zero programming foundation can also quickly complete workflow orchestration for complex tasks.

Now, take custom creation as an example to introduce how to complete the creation of a complete workflow-based agent. Select "Custom Creation" in the pop-up page to create a custom workflow-based agent.

# 2.2.1 Basic Information Filling

After selecting "Custom Creation" to enter the blank canvas, click the ✏ icon in the upper left corner to set the basic information of the workflow-based agent. The basic information for creating a workflow-based agent includes two required fields: "Workflow Name, Workflow Description". One optional field: "Workflow Category". To provide clear guidance for users to use the agent, it is recommended to supplement the agent with complete information as much as possible.

a. Workflow Name

Design an easily recognizable name for your instruction-based agent, such as "Weekly Report Assistant", "PPT Outline Agent", etc. The agent name should reflect the core functions, allowing more users to quickly understand the agent's functions and retrieve your agent based on the functions.

b. Workflow Description

Fill in a concise and clear introduction to the functions of the instruction-based agent, and clearly inform users how to use the agent.

For example, the function description in the "Interviewer Simulator" agent is: I can help you with mock interview training. Enter the job title, and I will give you 5 common interview questions for that position.

c. Workflow Category

Select the agent type for your instruction-based agent. Currently, the agent center includes 7 categories: Workplace, Creation, Learning, Programming, Life, Health, and Others.

# 2.2.2 Advanced Configuration

Advanced configuration sets the functions of the agent other than role dialogue, including conversation opening remarks, next question suggestions, speech-to-text, like/dislike, and role voice. You can configure these here to improve the user experience and dialogue effect of the agent.

The specific descriptions are as follows:

a. Conversation Opening Remarks: Opening remarks are the first dialog box that automatically appears when a user enters the agent, used to introduce the agent. You can configure the agent's opening remarks to help chat users quickly understand your agent, and the conversation opening remarks support AI generation. Users can also set reserved questions for the opening remarks, with a maximum of three questions. These questions will be displayed in the agent's dialog box for users to refer to how to talk to the agent and guide the direction of the conversation.

b. Next Question Suggestions: After enabling, guiding conversations can be generated after the end of the conversation, which promotes further interaction while exploring users' potential needs, better meets users' diverse needs, and improves user experience.

c. Speech-to-Text: Enables the agent to support voice input, enriches users' conversation options, improves users' conversation efficiency, and enhances the interactivity of the agent.

d. Like/Dislike: Supports users to like or dislike the answers generated by AI, which helps optimize the agent and enhances users' sense of participation. By analyzing users' like/dislike records, the agent can understand users' preferences and needs, provide more personalized services and recommendations for users, and thus make the application better serve users.

e. Role Voice: The agent supports setting a speaker. When users choose to broadcast the agent-generated content by voice, it can be played by different speakers. Users can select the required role voice according to their own needs, enhance users' immersion, and meet users' needs for voice interaction in different application scenarios.

# 2.2.3 Workflow Orchestration

The system will automatically create a start node and an end node. Developers only need to modify the relevant code or node logic according to their own needs to establish a complete workflow. The platform currently provides rich nodes such as large models, code, decision-making, and knowledge bases. For specific node introductions, refer to the "Development Guide - Workflow-based Agent Development - Node Introduction" chapter. For the orchestration process, refer to the workflow-based agent in the Quick Start.

# 2.2.4 Historical Versions

Click the "Historical Versions" button in the workflow canvas, and you can view historical versions in the pop-up page. Users can switch to historical versions according to their own needs.

# 2.2.5 Comparative Testing

Before comparative testing, you need to bind the prompt group to the workflow first. For the specific process, refer to the "Prompt Development - Centralized Prompt Writing and Tuning - Prompt Group Creation" chapter. Click the "Test Comparison" button in the workflow canvas, and perform comparative testing in the pop-up page. For the specific process, refer to the "Prompt Development - Centralized Prompt Writing and Tuning - Prompt Group Writing, Debugging and Saving" chapter.

# 2.2.6 Export and Import of Workflows

To facilitate the sharing and circulation of workflow-based agents, the platform provides convenient export and import functions. It should be specially noted that: When the workflow contains custom tools, knowledge bases, or self-built models, these components cannot be used directly after import. Users need to re-create the corresponding custom tools, or rebuild the knowledge bases and self-built models to ensure the normal operation of the workflow. Next, we will introduce the operation steps of exporting and importing workflow-based agents in detail.

a. Export of Workflows

Click the "Export" button in the upper right corner of the page on the workflow orchestration page to complete the import of the workflow. The exported workflow is in yml format. The specific operation process is as follows.

b. Import of Workflows

Click the "Import Workflow" button on the workflow page, upload the workflow file in the pop-up page. The workflow file format is yml, and the file size is limited to 20M. Click the "Save" button to complete the import of the workflow.

# 2.2.7 Partial Copy and Single Node Copy

To facilitate developers to quickly generate the same nodes, the platform provides convenient copy and paste functions. The start node and end node cannot be copied.

  1. Partial Canvas Copy

Hold down the Shift key and then press and hold the left mouse button to select a part of the canvas. The pop-up window above shows that N nodes have been selected, and click the [Copy] button on the right.

Use Ctrl+V to paste the N nodes just copied onto the canvas.

  1. Single Node Copy

Click a single node and use Ctrl+C to copy, and the pop-up window above shows [Copy Successful].

Use Ctrl+V to paste onto the canvas.

# 2.3 Node Introduction

Nodes are the basic elements that constitute a workflow. By correctly connecting each node, a workflow for a specific business process is formed, achieving the goal of efficient, flexible, and scalable AI application development. Workflow-based agents can orchestrate five types of nodes:

  • Basic Nodes: Nodes that complete basic tasks in the workflow, including: Start Node, End Node, Large Model Node, Code Node, Knowledge Base Node.
  • Tool Nodes: Nodes that integrate general and complex tools to expand the capabilities of the agent, including: Tool Node.
  • Logic Nodes: Nodes that control the workflow to achieve a specific direction according to certain logic, including: Decision Node, Brancher Node, Iteration Node.
  • Transformation Nodes: Nodes that store, transform, splice variables in the workflow, including: Variable Storage, Variable Extractor, Text Splicing Node.
  • Others: Mainly includes Message Nodes that control the output of relevant information during the operation of the workflow.

In addition to the two displayed functions, the toolbar in the upper right corner of each node also hides some functions:

  • Add Comment: This function allows developers to add text descriptions (such as design intent, node functions, etc.) to any node in the workflow, which is equivalent to endowing workflow orchestration with the ability of "code comments". When multiple people collaborate to maintain complex workflows, by viewing node comments, developers can quickly understand the design background, functional purpose and other basic information of the node.
  • Create Copy: Create a node that is exactly the same as the original node except for the node name, which is convenient for developers to create a batch of nodes with similar functions.

To facilitate developers to handle abnormal situations such as errors and timeouts, some nodes have added exception handling functions, including Large Model Node, Code Node, Knowledge Base Node, Knowledge Base Pro Node, Database Node, Workflow Node, Tool Node, Decision Node, Agent Intelligent Decision Node, Variable Extractor Node. You can set the timeout period, number of retries, and exception handling method. Enable it with the button on the right side of exception handling.

Timeout Period: The unit is seconds. If the server does not respond beyond the specified time, it will be judged as an exception.

Number of Retries: After a timeout, developers can select the number of retries for the node, which can be selected in the drop-down menu on the right.

Exception Handling Method: Including Interrupt Process, Return Set Content, and Execute Exception Process, which can be selected in the drop-down menu on the right.

Return Set Content can set the fallback answer content when an exception occurs.

Execute Exception Process can connect to other nodes, and the connected nodes will be executed when an exception occurs.

# 2.3.1 Start Node

  1. Node Introduction

The start node is the first node in the workflow, marking the start of the entire workflow. This node is usually responsible for receiving user input or trigger conditions, and using it as the basis for subsequent nodes to process tasks.

  1. Parameter Description
Parameter Description
Input In the start node of the workflow, a default input parameter - AGENT_USER_INPUT is set, which is specially used to receive and store the original content input by the user in the current conversation round. In addition, the start node also supports other parameter inputs. Developers can click the "Add" button to configure the input parameters that need to be set according to requirements.

The steps for adding other types of input parameters are as follows:

  1. File Input Usage Example

Next, take inputting a PDF file and using the OCR tool node to read the content of the PDF file as an example to explain the file input example.

a. Single File Input Example

b. Multiple File Input Example

# 2.3.2 End Node

  1. Node Introduction

As the final link of the workflow, the end node plays a vital role. It is responsible for feeding back the results after the workflow is executed.

  1. Parameter Description
Parameter Description
Answer Mode The mode in which the end node displays results.
Return Parameters, Generated by Workflow: This method allows the end node to return the variable values processed during the execution of the workflow.
Return Answers Configured with Set Format: Usually used to allow users to customize the format and content of the returned results to meet specific needs in different application scenarios.
Output Configure the parameters used by the end node to display results. Multiple output parameters can be added through the "Add" button.
Thinking Content This column is used to display the thinking content of the large model, and supports referencing output parameters in the form of {{Variable Name}}. The output result of this column will be rendered as thinking content and displayed on the conversation page.
Answer Content This column is used to display the final operation result of the workflow, and supports referencing output parameters in the form of {{Variable Name}}. The output result of this column will be rendered as the final result and displayed on the conversation page.
Streaming Output Switch Control the output mode of the final result:
Streaming: The workflow will output and display the intermediate frames of the result together.
Non-streaming: Do not display the intermediate frame results, only display the final result.
  1. Usage Example

# 2.3.3 Large Model Node

  1. Node Introduction

The large model node can call a large language model to generate replies according to input parameters and prompts, and is usually used to perform text generation tasks, such as copywriting production, text summarization, article expansion, etc.

The large model node relies on the language understanding and generation capabilities of large language models. You can select different models according to the needs of business scenarios, and configure prompts to define the model's persona and reply style. To control the results generated by the model more accurately, you can also set the model's parameters in the large model node, thereby affecting the text length, content diversity, etc. of the model's replies.

  1. Parameter Description
Parameter Description
Answer Mode Select a suitable large language model from the available model library to call. Different large models have different output content quality. It is recommended to choose according to specific needs and scenarios.
Maximum Reply Length This parameter can be selected in the model parameter configuration. Function: Control the upper limit of the Tokens length output by the model. Different models have different token limits, with a default of 2048 tokens. Reasonably setting this parameter can prevent output truncation due to too long output. Usually 100 Tokens are approximately equal to 150 Chinese characters.
Nucleus Sampling Threshold This parameter can be selected in the model parameter configuration. Function: Used to determine the randomness of results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question. Value range (0, 1].
Generation Diversity This parameter can be selected in the model parameter configuration. Function: Increasing it will make the model's output more diverse and innovative; on the contrary, decreasing it will make the output content more in line with the instruction requirements but reduce diversity. Minimum value is 1, maximum value is 6.
Web Search Switch This parameter can be selected in the model parameter configuration. Function: Whether to enable the web search capability. Currently, some large models (DeepSeek-V3, DeepSeek-R1, Spark 128k, etc.) support web search, and users can choose to enable or disable it. After enabling, the model can obtain online information and refer to it when generating answers. The default is off.
Input Dynamic content that needs to be added to the prompt. System prompts and user prompts support referencing input parameters to achieve dynamic adjustment effects. When adding input parameters, you need to set the parameter name and variable value, where the variable value can be set as a fixed value or reference the output parameters of upstream nodes.
Conversation History In multi-turn conversation scenarios, after checking the conversation history, the agent will pass the user's recent multiple conversation records and prompts to the large model together, so that the large model can refer to the context and generate replies that conform to the current conversation scenario.
System Prompt Instructions preset by developers or administrators to define the model's role, behavior rules, and output style.
User Prompt Questions, tasks, or instructions directly input by users to express specific needs.
Prompt Library You can select preset prompts in the pop-up prompt library window to import with one click. For the creation and use of the prompt library, please refer to the "Precise Prompt Engineering Tuning" chapter.
Output Specify the output parameters of the large model, and the large model outputs the operation results through the set output parameters.
Output Format Specify the output format of the large model, currently supporting text and json formats.
  1. Usage Example

# 2.3.4 Code Node

  1. Node Introduction

The code node supports users to process data or business logic by developing Python code blocks. Users can use Integrated Development Environment (IDE) tools to write code to process input parameters and output corresponding results. The tool supports AI-generated code and AI correction of wrong code.

  1. Parameter Description
Parameter Configuration Description
Input Set the input parameters of the code node, which can reference the output of other nodes or user input. The input parameters need to be consistent with the formal parameters of the main function in the code.
Code Write custom code logic in the code editor, or automatically generate code through AI to realize specific functions or processing flows. The code editor also provides trial operation; you can automatically generate or manually input tests.
Output Set the output format and type of the code node. The output parameters must be consistent with the code return output parameters so that subsequent nodes can receive and process them correctly.
  1. Notes
  • If your code node reports an error with the word "Non-UTF-8", please add a line of "# -- coding: utf-8 --" at the beginning of the code node. An example is as follows:

  • In the process of writing code, it is forbidden to use the print function. Using the print function will cause errors in the returned results.

  • The final execution result of the code main method must be returned in JSON format, and the field names and types in the JSON must be consistent with the variables defined in the code node, otherwise the code node will report an error. A specific example is as follows:

  • The code node supports writing multiple functions, but the node will only execute the code in the main function. Therefore, if you want to execute other functions, you need to call this function in the main function.

  1. Usage Example

The following uses a specific use case to illustrate the usage of the code node.

Scenario: Parse a name list through code to obtain the name and age of "Li Si" and output them. The input parameter values of the code node are as follows:

[
        {
                "name":"Zhang San",
                "age":24
        },
        {
                "name":"Li Si",
                "age":35
        },
        {
                "name":"Wang Wu",
                "age":15
        }

]

The specific writing logic of the code node is as follows:

# -*- coding: utf-8 -*-
import json
import re
def main(input):
    name = ""
    age = -1
    # Use regular expressions to remove line breaks and indentation spaces, but keep spaces inside objects
    compressed_json_str = re.sub(r'\s+(?=[{,\]}])|\s+', '', input)
    # Convert the input data string to a dictionary
    input_data = json.loads(compressed_json_str)
    for item in input_data :#Traverse the name list
        if "Li Si" in item["name"]:#Find the person named Li Si
            name = item["name"]#Get Li Si's name
            age = item["age"]#Get Li Si's age
    ret = {
        "name": name ,
        "age": age 
    }
    return ret

# 2.3.5 Knowledge Base Node

  1. Node Introduction

The knowledge base node can quickly retrieve relevant knowledge blocks in the specified knowledge base according to the query conditions (query) input by the user, and then efficiently feed back this information to the user. It is mainly applied to scenarios such as "information storage and retrieval, response efficiency improvement, workflow optimization, and model performance enhancement".

  1. Parameter Description
Parameter Configuration Description
Input Fixed as Query, indicating the key information related to the Query that the user wants to retrieve in the knowledge base.
Add Knowledge Base Click + in the upper right corner of the knowledge base area to add a knowledge base, select the knowledge base to be added in the pop-up page and click "Add" to add the knowledge base to the node. The knowledge base node supports adding multiple knowledge bases. If you click "Create New Knowledge Base" in the pop-up page, you will be redirected to the knowledge base creation page. For the introduction of knowledge base creation, please refer to the "Development Guide - Resource Management - Knowledge Base Management" chapter.
Parameter Settings You can set relevant parameters for knowledge base retrieval. Developers can jointly filter out the desired knowledge base results through topK and Score threshold. The specific meanings of the parameters are as follows:
Top K parameter: Used to filter the K text fragments with the highest matching degree to the user's question. The larger the value, the more entries returned. The default is to recall 3 retrieval results.
Score threshold: Used to set the threshold of matching degree. The system selects paragraphs not lower than the set threshold and returns them to the large model. Matching degree: A knowledge base consists of several knowledge fragments. The matching degree of a knowledge fragment refers to the relevance between the user's question and the text fragment.
Output Fixed output result (Array<Object>), which contains multiple recall results.
  1. Usage Example

  2. Node Introduction

As an advanced version of the knowledge base node, the Knowledge Base Pro node can more efficiently handle information retrieval needs in complex scenarios through innovative dual technical strategies of Agentic RAG and Long RAG. Compared with the standard knowledge base node, the Pro version shows significant advantages in open and complex tasks such as multi-intent understanding and cross-knowledge point association. Its retrieval accuracy and answer quality have been comprehensively improved, providing users with a more intelligent and accurate knowledge service experience.

  1. Parameter Description
Parameter Configuration Description
Answer Mode Select the large model used to decompose the question and summarize the recall results.
Strategy Selection Agentic RAG: This strategy will split complex questions into sub-questions, retrieve each sub-question one by one, and then send all retrieval results to the large model for reply. Long RAG: This strategy is mainly used for long text understanding. That is, when a question is asked, all documents will be retrieved first, relevant documents will be found, all slices in the relevant documents will be extracted, and sent to the large model for reply.
Input Fixed as Query, indicating the key information related to the Query that the user wants to retrieve in the knowledge base.
Add Knowledge Base Click + in the upper right corner of the knowledge base area to add a knowledge base, select the knowledge base to be added in the pop-up page and click "Add" to add the knowledge base to the node. The knowledge base node supports adding multiple knowledge bases. If you click "Create New Knowledge Base" in the pop-up page, you will be redirected to the knowledge base creation page. For the introduction of knowledge base creation, please refer to the "Development Guide - Resource Management - Knowledge Base Management" chapter.
Parameter Settings You can set relevant parameters for knowledge base retrieval. Developers can jointly filter out the desired knowledge base results through topK and Score threshold. The specific meanings of the parameters are as follows:
Top K parameter: Used to filter the K text fragments with the highest matching degree to the user's question. The larger the value, the more entries returned. The default is to recall 3 retrieval results.
Score threshold: Used to set the threshold of matching degree. The system selects paragraphs not lower than the set threshold and returns them to the large model. Matching degree: A knowledge base consists of several knowledge fragments. The matching degree of a knowledge fragment refers to the relevance between the user's question and the text fragment.
Answer Rules Optional. If there are output requirement restrictions or explanations for special cases, they can be supplemented here. For example: Answer the question, and if no answer is found, directly inform "I don't know".
Output Fixed output of the large model output result Output, and result (Array<Object>), which contains multiple recall results.
  1. Usage Example

# 2.3.6 Q&A Node

  1. Node Introduction

Some nodes in the workflow require users to provide necessary information or clarify their intentions to continue execution. For this reason, the platform has designed a dedicated Q&A node, which accurately collects key information that users need to provide in the form of natural language questions or multiple-choice options, thereby ensuring the smoothness of conversational interaction. When the agent recognizes a workflow containing a Q&A node during the conversation, it will automatically present the preset question content to the user, and pause the current process to wait for the user to complete the information input before continuing with subsequent operations.

  1. Parameter Description
Parameter Configuration Description
Answer Mode Set the large model used to extract fields from user replies
Input Set the parameters to be added to the question, and the parameter values can reference the output parameters of preceding nodes or be set as fixed text content.
Question Content Set the question to be asked to the user, and you can reference input parameters in the form of {{Variable Name}}
Answer Mode The user's answer mode, supporting two answer modes: Direct Reply and Option Reply.
Output Result output of the Q&A node. The output content of different modes is different: In addition to the fixed parameters query (question content) and content (user reply content) in the direct reply mode, if "Extract Fields" is checked, the defined field values will also be returned. The option mode returns three field values: query (question content), id (option replied by the user), and content (option content replied by the user)

The Q&A node supports two answer modes, Direct Reply and Option Reply, to collect users' information or intentions. The usage methods of these two answer modes are introduced below.

  • Direct Reply

Specify an open-ended question in the question content column, and users directly reply to the question in natural language. The agent will extract the user's entire reply or key fields from the reply. If the user's response does not match the information that the agent expects to extract (for example, missing required fields or inconsistent field data types), the agent will take the initiative to ask again until the key fields are obtained or the set maximum number of answers is exceeded (default is two times).

Click the button on the right side of the answer mode to set parameters for the answer mode.

Parameter Name Description
Is User Required to Answer When this switch is turned off, after the agent asks a question in the dialog box, a "Ignore This Question" button will appear below. Clicking it allows the user to ignore the question without answering. At this time, the keyword to be extracted will be assigned the default value in "Parameter Extraction" to continue execution; when this switch is turned on, the "Ignore This Question" button will not appear below after the question is asked, meaning the user is required to answer.
Conversation Timeout Setting When staying on the answer question interface for more than the preset time, the workflow will terminate. Minimum value: 2 minutes, maximum value: 5 minutes.
Maximum Number of Answer Attempts Setting The maximum number of times a user is allowed to answer the question. When the required keyword fields cannot be obtained from the user's multiple answers, the workflow will terminate. Minimum value: 2 times, maximum value: 5 times.

After checking Extract Fields from User Reply on the right side of the output, the system can extract and output key fields from the user's reply by customizing variables and descriptions. The default is unchecked.

Parameter Name Description
Variable Name The name of the keyword to be extracted, which can only contain letters, numbers, or underscores, and start with a letter or underscore.
Variable Type The type of the keyword, and the supported types can be viewed and selected in the drop-down box
Description The Prompt of the keyword to be extracted, that is, the descriptive sentence of the role of extracting the word. The large model will extract keywords from the user's reply according to the description information; the more detailed the description, the more accurate the extraction.
Default Value When the user chooses to ignore this question, if a default value is configured, the default value will be assigned to the corresponding keyword for subsequent operations.
Is Required Specify whether the keyword is required. If it is not required, if the corresponding keyword is not extracted in a round of inquiry, the default value will be used for subsequent operations. If it is required, if the corresponding keyword is not extracted in a round of inquiry, the question will continue to be asked until the keyword is extracted or the maximum number of inquiry rounds is exceeded.
  • Option Reply

The Q&A node allows developers to preset fixed options and reply to questions through fixed options. This mode is usually used in chat-based agents to advance the conversation progress and enhance interactivity.

Click the button on the right side of the answer mode to set parameters for the answer mode.

Parameter Name Description
Is User Required to Answer When this switch is turned off, after the agent asks a question in the dialog box, a "Ignore This Question" button will appear below. Clicking it allows the user to ignore the question without answering. At this time, the Q&A node will execute the "Others" option branch to continue execution; when this switch is turned on, the "Ignore This Question" button will not appear below after the question is asked, meaning the user is required to answer.
Conversation Timeout Setting When staying on the answer question interface for more than the preset time, the workflow will terminate. Minimum value: 2 minutes, maximum value: 5 minutes.

You can set the operations that users can perform as options to help users reply quickly within a specified range, or set common intentions as options as prompt information for user input. Each option usually corresponds to different workflow branch processing, and user replies outside the options also need branch processing (for example, guiding users to choose again or executing fallback logic).

Parameter Name Description
Option The ID of the option, which is an uppercase English letter and cannot be changed to other values.
Option Type The data type of the option content, currently only supporting strings or pictures. If "Picture" is selected, the external url link of the picture needs to be passed in the option content.
Option Content The option answers or intentions for users to choose.
Others The "Others" option is not visible to the outside. This option will take this branch only when the user selects "Ignore This Question". At this time, the returned id is "default".

# 2.3.7 Database Node

The database node is suitable for organizing and managing structured data. You can create a self-built database and then insert a database node into the workflow to achieve the functions of adding, deleting, modifying, and querying. The platform provides persistent storage services for structured data. When users do not delete or modify the data, it will be permanently valid and completely saved. The platform ensures the independent storage and access control of different developers' data resources through strict data isolation mechanisms, protecting user privacy and security. At the same time, the platform provides free cloud storage functions to save storage costs for users.

  1. Preparation

Before using the database node, you need to create a database in the resource management bar in advance; otherwise, you will not be able to specify the database to operate in the "Select Database" column. For the specific process of creating a database, please refer to the "Development Guide - Resource Management - Database Management" chapter.

  1. Node Introduction

The database node can connect to a specified database and perform common operations such as adding, querying, editing, and deleting on the database to realize dynamic data management. The database node supports two ways to manage database data: Custom SQL and Form-based Data Processing. Selecting Custom SQL allows you to write custom SQL statements to complete operations. When you are not familiar with SQL statements, you can select Form-based Data Processing to manage data by selecting specific data tables and processing modes.

  1. Parameter Description
  • Custom SQL

| Parameter Configuration | Description |