Overview
AI Agents in SurveyAnalytica are autonomous, deployable services that can execute custom logic, connect to external APIs, process data, and integrate into workflows. You can build agents from scratch using natural language instructions, deploy them as live API endpoints, and connect them to your campaigns, surveys, and automation workflows. Agents are managed through the Agent Catalog and can be built using the AI-powered Agent Builder.
Navigating to Agents
From the main navigation sidebar, click Agents to open the Agent Catalog. The catalog has two tabs:
- My Agents: Agents you have created or have access to in your workspace.
- Templates: Pre-built agent templates that you can use as starting points.
Agent Catalog
The Agent Catalog displays all your agents with their status, description, and deployment information. You can:
- Search: Filter agents by name or description.
- Filter by status: View all agents, only deployed agents, or only drafts.
- Create new agent: Opens the Agent Builder.
- Edit: Modify an existing agent’s code, configuration, or settings.
- Delete: Remove an agent. The system checks for dependent workflows before deletion and warns you about active dependencies.
Building an Agent
The Agent Builder provides an AI-assisted development environment for creating agents.
Agent Configuration
When building an agent, you configure:
- Name: A descriptive name for the agent.
- Description: What the agent does, used for discovery and documentation.
- Code: The agent’s application code. The AI assistant can generate this from natural language descriptions.
- Environment variables: Key-value pairs for secrets and configuration (API keys, endpoints, etc.). Names are automatically uppercased and sanitized.
- Input/Output Schema: JSON Schema definitions for the agent’s API request and response formats, validated at runtime.
AI-Powered Code Generation
Describe what your agent should do in natural language, and the AI assistant generates the complete application code. The generated code includes:
- Server setup and routing
- API endpoint handlers
- Input validation
- External API integrations
- Error handling
Knowledge Base (RAG)
Agents can be enhanced with a knowledge base for Retrieval-Augmented Generation (RAG):
- URL scraping: Provide URLs and the system extracts text content, then segments it into optimized chunks for retrieval.
- PDF upload: Upload PDF documents (up to 10 MB) that are parsed and chunked for knowledge retrieval.
- Text chunking: Content is automatically split into segments optimized for retrieval performance.
Missing Environment Variable Detection
The system automatically scans agent code for environment variable references and warns you about any variables referenced in the code but not defined in the configuration. Platform-provided variables are excluded from this check.
Deploying an Agent
Deployment creates a live, accessible API endpoint for your agent:
- The system packages your agent code and configuration.
- A containerized service is built and deployed to the cloud.
- Environment variables are securely injected into the runtime.
- The agent receives a unique URL endpoint for API calls.
Testing an Agent
Before deployment or after, you can test agents by making API calls through the Agent Catalog interface. Send sample requests matching the input schema and verify the responses match the expected output schema.
Agent Templates
The platform provides pre-built agent templates for common use cases. Templates serve as starting points that you can customize:
- Browse available templates in the Templates tab.
- Click a template to preview its configuration and code.
- Use a template as a starting point for a new agent, which copies the template configuration into the Agent Builder for customization.
Model-Backed Agents
Trained ML models can be deployed as agents automatically. When you deploy a model as an agent (from the ML Models interface), the system:
- Verifies the model has a valid live version.
- Creates an agent wrapper around the trained model for real-time inference.
- Deploys the agent as a live API endpoint.
- Links the agent back to the model record for easy management.
Agents in Workflows
Agents integrate into SurveyAnalytica workflows through the workflow automation engine. You can:
- Add an agent as a step in a campaign workflow
- Trigger agents based on survey responses or data events
- Chain multiple agents together in sequence
- Use agent outputs as inputs to subsequent workflow steps
Managing Agent Lifecycle
- Update: Modify agent code and redeploy.
- Undeploy: Take the agent offline while keeping the configuration.
- Delete: Permanently remove the agent. The system warns about any dependent workflows before allowing deletion.
- Monitor: View agent invocation logs and performance metrics.