Multi-Agent System
Template for building complex systems with multiple cooperating agents.
View TemplateGetting Started with Templates
Agentopia templates provide pre-configured project structures to accelerate your agent development. Choose a template that best fits your needs and use our CLI tool to create a new project in minutes.
Using Templates with CLI
The easiest way to use our templates is through the Agentopia CLI:
agentopia create my-project --template basic-agent
This command creates a new project called "my-project" using the "basic-agent" template.
Available Template Types
Basic Agent Template
A minimal starter template for creating a simple AI agent with essential functionality.
Features:
- Single agent architecture
- Basic tool integration
- Simple conversation handling
- Environment configuration
Best for:
Beginners and simple use cases where you need a standalone agent with minimal complexity.
agentopia create my-agent --template basic-agent
Multi-Agent System
Template for building complex systems with multiple cooperating agents.
Features:
- Multiple specialized agents
- Agent orchestration
- Inter-agent communication
- Workflow management
- Shared knowledge base
Best for:
Complex tasks that benefit from division of labor and specialized agent roles.
agentopia create my-mas --template multi-agent
Web Assistant
Template for creating web-based AI assistants with a modern UI.
Features:
- Responsive chat interface
- Real-time streaming responses
- File upload capabilities
- Conversation history
- Customizable UI components
Best for:
Customer-facing applications where a polished user interface is important.
agentopia create my-assistant --template web-assistant
API Service
Template for building AI-powered API services and microservices.
Features:
- RESTful API endpoints
- Authentication and rate limiting
- Request validation
- OpenAPI documentation
- Containerization support
Best for:
Backend services and applications that need to expose AI capabilities via API.
agentopia create my-api --template api-service
Template Customization
All templates can be customized to fit your specific requirements:
Configuration Options
Each template includes a config.json
file where you can adjust settings:
{
"agent": {
"name": "My Custom Agent",
"description": "A specialized agent for my use case",
"model": "gpt-4",
"temperature": 0.7
},
"tools": [
"web_search",
"calculator",
"database"
],
"memory": {
"type": "vector",
"capacity": 1000
}
}
You can modify these settings to customize your agent's behavior without changing the code structure.
Adding Custom Tools
Extend your agent's capabilities by adding custom tools:
// JavaScript example
const { Tool } = require('@agentopia/sdk');
const weatherTool = new Tool({
name: 'get_weather',
description: 'Get weather information for a location',
parameters: {
location: {
type: 'string',
description: 'City name or zip code'
}
},
execute: async ({ location }) => {
// Implementation here
return `Weather information for ${location}`;
}
});
// Add to your agent
agent.addTool(weatherTool);
Best Practices
Keep Configuration Separate
Store environment-specific settings in .env
files and configuration in dedicated config
files.
Modular Tool Design
Create small, focused tools that do one thing well rather than complex multi-purpose tools.
Test Agent Behaviors
Write tests for your agent's behaviors to ensure consistent responses across different inputs.
Version Control
Use git to track changes to your agent project and collaborate with others.
Creating Custom Templates
You can create your own templates for reuse across projects:
- Create a project with your desired structure and configuration
- Remove environment-specific files and credentials
- Add template placeholders using
{{variable_name}}
syntax - Create a
template.json
file with metadata and variable definitions - Use the CLI to register your custom template:
agentopia template register ./my-custom-template
Once registered, you can use your custom template just like the built-in ones:
agentopia create new-project --template my-custom-template