> ## Documentation Index
> Fetch the complete documentation index at: https://sambanova-systems.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Compose for agents integration guide

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:

* A [SambaCloud](https://cloud.sambanova.ai/?utm_source=docker\&utm_medium=external\&utm_campaign=cloud_signup) account with an API key
* [Docker Desktop](https://www.docker.com/products/docker-desktop/) 4.43.0+ or [Docker Engine](https://docs.docker.com/engine/) installed
* A laptop with GPU support for running open models locally (alternatively, use [Docker Offload](https://www.docker.com/products/docker-offload/) if you don't have a GPU)

### Additional requirements

* **For Linux (Docker Engine) or Windows (Docker Desktop):** Ensure [Docker Model Runner requirements](https://docs.docker.com/ai/model-runner/) are met, specifically that GPU support is enabled and necessary drivers are installed
* **For Linux (Docker Engine):** Install [Docker Compose](https://github.com/docker/compose) version 2.38.1 or later
* Clone the [example repository](https://github.com/sambanova/integrations/tree/main/docker-compose-for-agents)

## Setup

<Steps>
  <Step title="Configure Environment Variables">
    Create a `.env` file in your project directory with the following configuration:

    ```bash theme={null}
        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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Start the Services">
    Launch the Docker Compose stack:

    ```bash theme={null}
        docker compose up
    ```

    If you've updated the code or configuration, rebuild the containers:

    ```bash theme={null}
        docker compose up --build
    ```

    The application will be available at [http://0.0.0.0:8000](http://0.0.0.0:8000)
  </Step>
</Steps>

## 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:

<Steps>
  <Step title="Upload an Image">
    Upload an image such as an application architecture diagram, system design, or workflow visualization through the web interface.
  </Step>

  <Step title="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
    ```
  </Step>

  <Step title="Request Code Generation">
    Use the Developer agent to generate code based on the analysis:

    ```
        Developer, can you create code from this description using Python?
    ```
  </Step>
</Steps>

### 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](https://docs.docker.com/guides/agentic-ai/).
