A template and deployment mechanism for running multiple customizable chat agents with flexible LLM backends, configurable web interfaces, and Docker containerization.
This project provides a simple template and automation system for deploying multiple chat agents, each with their own web interface and configuration. The focus is on operational deployment rather than building an agent framework - it's designed to make it easy to spin up and manage multiple chat instances with different personalities, models, and configurations.
The project is currently functional for basic multi-agent deployment, with several advanced features planned:
Current Status:
- ✅ Template/mechanism to deploy multiple chat agents
- ✅ LLM flexibility (local and hosted models)
- ✅ Simple/configurable web front end per-agent
- ✅ Dockerized deployment
- 🚧 SSO capability (planned)
- 🚧 Reverse proxy capability (planned)
- 🚧 Memory/persistence (planned)
This project makes use of AI coding assistants - it serves as both a practical deployment tool and an ongoing learning exercise for me using various development tools and patterns.
- Multi-Chat Deployment: Deploy multiple chat agents with unique configurations
- LLM Flexibility: Support for various AI providers (Anthropic, OpenAI, local Ollama)
- Template-Based: All agents use the Mary2Ish chat template as a foundation
- Configuration-Driven: Customize each agent through external config files
- Automated Setup: Script automatically creates configurations and Docker setup
- Containerized: Each agent runs in its own Docker container with unique ports
- Web Interface: Simple, configurable chat interface per agent
- Easy Replication: Simple process for creating new chat instances
- Docker and Docker Compose installed
- Python 3.13+ with
uvpackage manager - Basic understanding of YAML configuration files
-
Generate Agent Configuration and Docker Setup
Use the automated script to create everything you need:
uv run generate_agents.py my_agent_name
This command automatically:
- Creates the
configs/my_agent_name/directory - Copies all template configuration files
- Generates/updates the
docker-compose.ymlfile - Assigns a unique port for your chat agent
- Sets up proper networking and health checks
- Creates the
-
Customize Your Chat Agent (Optional)
The script creates working defaults, but you can customize by editing files in
configs/my_agent_name/:system_prompt.txt: Define your agent's personality and chat behaviorknowledge_facts.txt: Add agent-specific knowledge and factsui.config.yaml: Customize the chat interface and brandingfastagent.config.yaml: Configure AI model and logging settingsfastagent.secrets.yaml: Add your API keys (keep secure!)
-
Deploy Your Chat Agent
Build and start your agent:
docker-compose up --build -d
-
Access Your Chat Agent
Your agent will be available at the port shown in the script output, typically:
http://localhost:8004Example: Mary agent running with custom configuration
Each chat agent requires the following configuration files in its configs/agent_name/ directory (automatically created by the script):
| File | Purpose | Required |
|---|---|---|
fastagent.config.yaml |
AI model, logging, MCP servers | Yes |
ui.config.yaml |
Chat UI customization and branding | Yes |
system_prompt.txt |
Chat agent behavior and personality | Yes |
knowledge_facts.txt |
Agent-specific knowledge and facts | Yes |
fastagent.secrets.yaml |
API keys and sensitive data | Yes |
# Use different AI providers
default_model: anthropic.claude-3-5-sonnet-20241022 # Anthropic Claude
# default_model: openai.gpt-4o # OpenAI GPT-4
# default_model: generic.llama3:8b # Local Ollamapage:
title: "My Custom Agent"
header: "Customer Support Bot"
icon: "🎧"
chat:
agent_display_name: "Support Agent"
user_display_name: "Customer"You are a specialized customer support agent for our software company.
You should be helpful, professional, and knowledgeable about our products.
Always try to resolve customer issues efficiently and escalate when necessary.
Important: The fastagent.secrets.yaml file contains sensitive API keys:
- Never commit this file to version control
- Keep API keys secure and rotate them regularly
- Use different keys for development/production environments
- Consider using environment variables for additional security
Note: The docker-compose.yml file is automatically generated by the script and should not be manually edited or committed to version control.
To create multiple chat agents, run the script with multiple agent names:
# Generate configurations and Docker setup for multiple chat agents
uv run generate_agents.py support_agent sales_agent technical_agentThis automatically:
- Creates separate config directories for each agent
- Copies template files to each directory
- Generates a single
docker-compose.ymlwith all agents configured - Sets up unique ports for each agent
- Preserves any existing customizations
The generate_agents.py script provides comprehensive automation:
- Intelligent Directory Creation: Creates
configs/agent_name/directories as needed - Template Copying: Copies all template files to each agent directory
- Preservation of Customizations: Never overwrites existing configuration files
- Docker Compose Generation: Creates or updates complete Docker configuration
- Network Setup: Configures Docker networking automatically
- Port Management: Automatically assigns unique ports (starting from 8004)
- Health Checks: Adds health monitoring for each agent container
- Validation: Sanitizes agent names and validates environment
# Single agent
uv run generate_agents.py my_agent
# Multiple agents
uv run generate_agents.py agent1 agent2 agent3
# Regenerate existing configurations (preserves customizations)
uv run generate_agents.py existing_agent
# Verbose output
uv run generate_agents.py --verbose my_agentMaryAndFriends/
├── README.md # This file
├── PLANNING.md # Project architecture and goals
├── TASK.md # Development task list
├── generate_agents.py # Chat agent deployment automation script
├── docker-compose.yml # Generated Docker configuration
├── template_agent_configs/ # Template configuration files
│ ├── fastagent.config.yaml
│ ├── ui.config.yaml
│ ├── system_prompt.txt
│ ├── knowledge_facts.txt
│ └── fastagent.secrets.yaml
├── configs/ # Chat agent configurations (auto-generated)
│ ├── agent_name_1/ # Individual chat agent configs
│ └── agent_name_2/
├── Mary2ish/ # Base chat agent template
└── docs/ # Project documentation
- Chat agent won't start: Check that all required config files exist in
configs/agent_name/ - Can't access chat interface: Ensure the port shown in the script output is available and not blocked
- API errors: Verify API keys in
fastagent.secrets.yamlare correct and valid - Port conflicts: The script automatically assigns unique ports, but check if base ports are available
- Script errors: Ensure you have
uvinstalled and thetemplate_agent_configs/directory exists
View chat agent logs:
docker-compose logs agent_nameView all running chat agents:
docker-compose psIf you need to manually create configurations without the script:
# Create agent directory
mkdir configs/my_agent_name
# Copy template files
cp template_agent_configs/* configs/my_agent_name/
# Manually edit docker-compose.yml to add your agentHowever, using the automated script is strongly recommended for consistency and ease of management.
All agents run on the ai_agents_network Docker network for isolation and inter-agent communication.
Each agent container includes health checks to ensure proper startup and ongoing availability.
Additional chat agents can be added at any time by running the script with new agent names. The system is designed to handle multiple concurrent chat agents efficiently.
See LICENSE file for licensing information.
