The main API endpoint that powers your AI chatbots with intelligent responses, conversation memory, and dynamic knowledge base integration.
What it is
The Chat workflow provides:
Intelligent AI responses formatted for chatbot interactions with text, mood, and animation
Conversation memory that maintains context across chat sessions
Knowledge base integration for accurate, contextual answers
Scenario-based customization with different personalities and behaviors
Rate limiting protection to manage API usage
Structured output optimized for frontend chatbot displays
How to use it
API Endpoint
Send POST requests to your webhook URL with:
{"message":"Hello, how can you help me?","scenario":"customer-service","sessionId":"user-123-session-456"}
Response Format
Receive structured responses ready for your chatbot interface:
{"messages":[{"text":"Hello! I'm here to help you.","animation":"Talking","mood":"Happy"},{"text":"What can I assist you with today?","animation":"Listening","mood":"Curious"}]}
How it works
Rate Limiting - Checks if the user has exceeded usage limits
Scenario Loading - Retrieves personality, prompts, and behavior rules for the selected scenario
Knowledge Retrieval - Searches the vector database for relevant information
AI Processing - Generates contextual responses using conversation memory
Response Formatting - Structures output with text, mood, and animation data
Memory Storage - Saves conversation context for future interactions
Key Features
Conversation Memory
Redis-powered persistence maintains chat history across sessions
30-day retention keeps conversations accessible for a month
Session-based isolation ensures user privacy and context separation
Knowledge Base Integration
Vector search finds relevant information from your knowledge bases
Automatic retrieval pulls context when users ask questions
Multi-collection support different scenarios can use different knowledge bases
Intelligent Response Generation
Multi-message responses breaks long answers into digestible parts
Mood detection adds emotional context to responses
Animation guidance suggests visual behaviors for avatar-based chatbots
JSON structure ready for frontend consumption
Error Handling
Rate limit responses (HTTP 429) when usage limits exceeded
Scenario validation (HTTP 404) when invalid scenarios requested
Graceful fallbacks for missing data or API failures
Customization Options
Language Model
The workflow uses OpenAI GPT-4.1-mini by default, but you can replace it with:
Session Management - Use consistent sessionId formats for reliable memory
Scenario Organization - Create focused scenarios for different use cases
Knowledge Base Maintenance - Keep vector databases updated with fresh content
Response Testing - Verify mood and animation mappings match your frontend
Memory Cleanup - Monitor Redis usage and adjust TTL as needed
This workflow serves as the core intelligence layer for your chatbot applications, handling everything from user input processing to contextual response generation.