Skip to content

monuminu/multi-agent-demo

Repository files navigation

Multi-Agent Playground

This project is a multi-agent demo system with a FastAPI backend and a React frontend. It is containerized using Docker and orchestrated with Docker Compose for local development and Azure Container Apps for cloud deployment.


Project Structure

  • backend/: Python FastAPI server with multiple agent systems (Airline, Card Block, HR)
  • frontend/: React app (Create React App) for interacting with agents
  • docker-compose.yaml: Defines services for local development
  • Dockerfile: Multi-stage build for backend and frontend containers
  • deploy-to-azure.sh: Script for building, pushing, and deploying containers to Azure

Backend

  • Located in backend/
  • Main entry: app.py (FastAPI app)
  • Supports multiple agent domains: airline, cardblock, hr
  • Uses Azure OpenAI, Azure Search, and Application Insights (see backend/azure.env for required environment variables)
  • To run locally:
    cd backend
    pip install -r requirements.txt
    uvicorn app:app --host 0.0.0.0 --port 8080
  • Environment variables (see backend/azure.env):
    • AZURE_OPENAI_API_KEY, OPENAI_API_VERSION, AZURE_OPENAI_ENDPOINT, etc.

Frontend

  • Located in frontend/
  • React app (bootstrapped with Create React App)
  • Main entry: src/App.js
  • To run locally:
    cd frontend
    npm install
    npm start
  • Environment variables (see frontend/azure.env):
    • WS_BASE_URL, API_BASE_URL

Docker & Docker Compose

  • Build and run both services locally:
    docker-compose up --build
  • Backend exposed at http://localhost:8080
  • Frontend exposed at http://localhost:3000
  • Environment variables are loaded from backend/azure.env and frontend/azure.env

Dockerfile

  • Multi-stage build for both backend and frontend
  • Backend: Python 3.12, runs FastAPI with Uvicorn
  • Frontend: Node.js 20, builds static React app, served with serve
  • See Dockerfile for details

Azure Deployment

  • Use deploy-to-azure.sh to build, push, and deploy containers to Azure Container Apps
  • Requires Azure CLI and permissions to create resources
  • Script will:
    • Build and push images to Azure Container Registry
    • Deploy backend and frontend as Azure Container Apps
    • Set environment variables from backend/azure.env and frontend/azure.env

Security & Best Practices

  • Never commit secrets to source control
  • Use managed identity and Key Vault for production secrets
  • Enable Application Insights for monitoring
  • Follow Azure best practices for authentication, error handling, and scaling

References


For any Azure-specific code or deployment, follow the latest Azure best practices: use managed identity, never hardcode credentials, enable monitoring, and validate deployments before applying changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published