Skip to main content
Docker Compose for Agents extends Docker Compose’s capabilities to facilitate the development, deployment, and management of AI agents and agentic applications. It allows developers to define and run complex agent architectures, including AI models, tools, and supporting services, using the same familiar YAML syntax used for microservices.

Prerequisites

Before you begin, ensure you have:

Additional Requirements

Setup

1

Configure Environment Variables

Create a .env file in your project directory with the following configuration:
    SAMBANOVA_API_KEY=your_api_key_here
    SAMBANOVA_BASE_URL=https://api.sambanova.ai/v1
    SAMBANOVA_CHAT_MODEL=Llama-4-Maverick-17B-128E-Instruct
Tip: Reference the .env.sample file in the repository for additional configuration options.
2

Define Agent Prompts

All agent prompts are defined in the docker-compose.yml file. Customize agent behaviors, roles, and capabilities by modifying the prompts in this configuration file to match your use case.
3

Start the Services

Launch the Docker Compose stack:
    docker compose up
If you’ve updated the code or configuration, rebuild the containers:
    docker compose up --build
The application will be available at http://0.0.0.0:8000

Usage

The agents can be accessed through both the web interface and API endpoints.

Example Workflow

Enable Token Streaming for real-time responses, then follow these steps:
1

Upload an Image

Upload an image such as an application architecture diagram, system design, or workflow visualization through the web interface.
2

Interact with the SambaNova Agent

Ask the SambaNova agent to analyze and explain the uploaded content:
    Sambanova, describe this app
    Explain the info and the stack required to develop this app
3

Request Code Generation

Use the Developer agent to generate code based on the analysis:
    Developer, can you create code from this description using Python?

Multi-Agent Collaboration

The Docker Compose setup enables multiple specialized agents to work together:
  • SambaNova Agent: Analyzes images, documents, and provides architectural insights
  • Developer Agent: Generates code based on specifications and requirements
  • Custom Agents: Define your own agents with specific roles and capabilities

Architecture

Docker Compose for Agents allows you to define:
  • AI Models: SambaNova models for inference and reasoning
  • Agent Services: Specialized agents with distinct roles and prompts
  • Supporting Services: Databases, message queues, storage, and other infrastructure
  • Tool Integration: Connect agents to external APIs, databases, and services
All components are orchestrated through a single docker-compose.yml file, making it easy to:
  • Version control your entire agent architecture
  • Scale services independently
  • Deploy consistently across environments
  • Share configurations with your team

Benefits

Docker Compose for Agents with SambaNova combines containerization best practices with high-performance AI inference to deliver:
  • Familiar workflow: Use the same Docker Compose syntax you already know
  • Simplified deployment: Define complex multi-agent systems in a single YAML file
  • Local development: Test and iterate quickly on your local machine
  • Production-ready: Deploy to production with the same configuration
  • Flexible architecture: Easily add, remove, or modify agents and services
  • High-performance inference: Leverage SambaNova’s optimized models for fast response times

Additional Resources

For comprehensive guidance on building agentic AI applications with Docker Compose, visit the official Docker Compose for Agents documentation.