Environments
Environments in Chatmode define where and how your AI agents interact with users. They serve as the connection between your agents and various platforms or channels, primarily through embeddable web chats (EMBED
) or specific integrations like ZAPI
.
Understanding Environments
An environment represents a specific deployment of an agent. For example, you might have:
- A customer support agent on your website
- The same agent deployed via API for your mobile app
- Another instance of the agent for internal use by your team
Each of these would be a separate environment in Chatmode, potentially with different configurations tailored to each use case.
Environment Types
Chatmode currently supports the following environment types defined in the system:
Embed (EMBED
)
Embed a chat interface directly on your website using an <iframe>
, allowing visitors to interact with your agent.
ZAPI
Connect your agent through specific integrations configured under this type (e.g., potentially WhatsApp via Z-API). Detailed configuration depends on the specific integration.
Creating an Environment
To create a new environment:
- Navigate to the Environments section in the sidebar
- Click the Create Environment button
- Select the environment type
- Choose the agent to deploy in this environment
- Configure the environment settings (varies by type)
- Save your configuration
Environment Settings
General Settings
All environments include these common settings:
- Name: Identify your environment
- Agent: The AI agent that will power this environment
- Active Status: Toggle to enable/disable the environment
- Preferred Language: Set the default language for interactions
Embed (EMBED
) Settings
When creating an Embed (EMBED
) environment, you can customize aspects of the chat interface presented:
- Display Name: The text shown in the chat header.
- Display Picture: The logo or avatar shown in the chat header.
- Icon: The icon displayed on the floating chat bubble when closed.
- Primary Color: Affects buttons and other accents within the chat interface.
- Initial Message: The first message the Agent sends when the chat loads.
ZAPI
Environment Settings
Configuration for ZAPI
environments depends on the specific integration being set up. This typically involves API keys, endpoint URLs, or other credentials required by the third-party service.
Implementing Environments
Embed (EMBED
) Implementation
After creating an Embed environment, you need to add an <iframe>
element to your website’s HTML. The src
attribute should point to the public chat page for your environment ID.
Place this <iframe>
tag where you want the chat interface to appear on your page.
(Note: The primary recommended implementation for the floating chat bubble uses a script snippet provided in the UI, as detailed in the Embeds guides. The iframe method is mainly for inline embedding.)
API Implementation (ZAPI
)
Implementation for ZAPI
environments involves configuring the connection according to the specific service (e.g., providing webhook URLs, API keys). Refer to the configuration section within the environment details page after creation.
Managing Environments
Environment List
The Environments page displays all your environments with key information:
- Environment name and type
- Associated agent
- Active status
- Creation date
- Usage statistics
Environment Details
Click on an environment to view its details and access:
- Configuration settings
- Implementation code
- Usage metrics (if applicable)
- Conversation history (if applicable)
Monitoring and Analytics
Detailed monitoring and advanced analytics per environment may not be universally available. Review associated conversations for insights.
Best Practices
- Test in Staging: Before deploying to production, test your environment in a controlled setting
- Customize for Context: Tailor environment settings to match the platform and user expectations
- Monitor Regularly: Check environment performance and make adjustments as needed
- Implement Fallbacks: Configure behavior for when an agent can’t handle a request (if applicable)
Next Steps
After setting up your environment:
- Test your agent in the new environment
- Monitor conversations to ensure everything works correctly
- Customize appearance for website widgets