How to build advanced applications using Flow
After selecting Flow as your orchestration method on the App Details page, click the ‘Next’ button at the bottom right corner to proceed. This will direct you to the Configure Bot page, where you can seamlessly integrate your selected Flow and fine-tune your bot’s settings.

Configure bot
In this section, you can fine-tune and personalize your bot’s settings by integrating the chosen orchestration method and configuring essential parameters to meet your unique business needs. These adjustments ensure smooth bot operation within your workflow, offering a streamlined, personalized, and outcome-focused experience.
Steps to configure the bot:
Select the Flow
The flow defines the behavior and interaction patterns of your bot. From the available list of flows, choose the one that best matches the desired interaction model for your bot.
How to add Flow:
Click ‘Add’ to open the flow selection dialog.
Choose an existing flow from the list to start building a ZBrain AI app.

Upon selection, the flow governs task execution and subsequent user interactions within the application.

Add guardrails
Once you've selected a relevant Flow, you can add guardrails. Guardrails are configurable safety mechanisms that help your app operate safely, accurately, and within defined boundaries. They work by monitoring and controlling user inputs, AI outputs, and system behavior to prevent harmful, inappropriate, or off-policy responses, ensuring consistent, compliant performance throughout the interaction.
How to add guardrails:
Click on ‘+ Add a guardrail parameter’. This will open the Add Guardrail Parameter panel in the top-right corner.

Choose from three guardrail types:
Input checking: Validates user inputs to block harmful, inappropriate, or unsafe content.
Output checking: Ensures that responses generated by the app align with the knowledge base.
Jailbreak detection: Detects and prevents attempts to bypass system safety measures.
Toggle on any guardrail to add it. Once added, it will appear in the list below with:
A settings icon for detailed filter configuration
A delete icon to remove the parameter if needed

Configuring guardrails
Click the settings icon for each guardrail to customize filters:
Input checking: Enable content moderation filters for harassment, hate, sexually explicit, and dangerous content
Output checking: Enable checks for misinformation and system prompt leakage
Jailbreak detection: Enable detection of system override attempts, code injection and access to PII
Note: All filters are selected by default. You can deselect or re-enable them based on your app’s safety requirements.
After selecting the flow, click ‘Next’ to proceed to the Appearance page, where you will customize the visual and user interface elements of your app.
Building context-aware apps with Flow integration
Creating an effective app using ZBrain Flow involves more than just designing the logic; it requires thoughtful handling of how responses are delivered and conversations are managed across sessions. Two critical components in this process are app output and app previous conversations. While app output ensures that the right responses are returned to the app after a flow executes, app previous conversations help maintain continuity by referencing past interactions. These should be configured as part of the Flow to ensure the app delivers high-quality responses and retains contextual awareness across user sessions.
App output
The app output component returns the final flow's output to the app after executing the interaction. This step ensures the bot's responses are appropriately delivered and aligned with the defined flow behavior.
Key fields to configure:
Result: The chatbot’s response to the user will appear in this field.
Context: Specify the context or summary of the interaction. This provides valuable insights for reviewing past conversations and understanding user intent.
Instructions for the LLM: Provide specific instructions or prompts for the Large Language Model (LLM). These guide how the response should be crafted, whether you want it to be concise, detailed, empathetic, or task-oriented.
Model used: Choose the appropriate LLM that will generate the bot's response. This selection determines how advanced or creative the responses will be.
Temperature: Adjust the model’s creativity level.
A lower value (e.g., 0.2) delivers more deterministic and factual responses.
A higher value (e.g., 0.8) produces more diverse, creative, and open-ended replies.
Note: The following fields, context, instructions for the LLM, model used, and temperature , will be logged in the query history logs of the application. These entries help ensure transparency, reproducibility, and improved review of past interactions.

Managing conversational flow
To make conversations feel continuous and intelligent, your app needs to remember what was previously discussed. The app previous conversations component in ZBrain allows your app to retrieve and use historical data to provide more personalized, context-aware interactions.
Key fields to manage conversations:
API key: Input your API key to authenticate access to the conversation logs and ensure secure data retrieval.
Select app: Choose the app whose historical data you want to access, especially important when working across multiple applications.
Select app sessions: Pick a session ID to retrieve specific past conversations. This helps your bot tailor its responses based on prior interactions from the same user.
Limit: Set how many past messages should be fetched (e.g., the last 10 queries). This keeps the context relevant without overwhelming the flow with too much history.


Why managing conversational flow matters: By integrating past interactions, your app can maintain continuity, avoid repetitive responses, and build a more human-like relationship with users. This significantly improves the user experience by:
Keeping responses relevant to the conversation’s history
Personalizing outputs based on previous inputs
Allowing the app to handle complex, multi-step interactions over time.
Last updated