Multi-Agent Battery Intelligence Platform powered by Google Gemini 3 & ADK
An advanced agentic AI system for battery manufacturing defect detection, physics-based optimization, and fleet management. Built with Google's Agent Development Kit (ADK) for seamless multi-agent orchestration.
- π― Overview
- β¨ Key Features
- ποΈ Architecture
- π Quick Start - Start Here!
- π³ Docker Deployment (Recommended)
- π» Manual Setup
- π Usage Guide
- π οΈ Technology Stack
- π API Endpoints
- π Deployment
- π€ Contributing
BatteryForge AI revolutionizes battery quality control and fleet management through 5 specialized AI agents working in harmony:
| Agent | Role | Capabilities |
|---|---|---|
| ποΈ BatteryForge Commander | Strategic Orchestrator | Routes requests, coordinates workflows, ensures safety protocols |
| ποΈ Defect Analysis Agent | Visual Inspection Expert | Real-time defect detection, PCB/BMS inspection, thermal runaway monitoring |
| β‘ Charging Optimization Agent | Electrochemistry Specialist | EIS analysis, PyBaMM physics simulation, capacity fade prediction |
| π Fleet Commander Agent | Strategic Planner | Fleet monitoring, scenario simulation, risk assessment |
| π‘οΈ Safety Guardian Agent | Emergency Response | HITL emergency shutdown, thermal event detection, safety protocols |
| π§ Predictive Maintenance Agent | Lifecycle Expert | RUL prediction, aging analysis, maintenance scheduling |
- Autonomous delegation - Commander intelligently routes tasks to specialist agents
- Real-time trace visualization - See agent transfers and tool calls in action
- Context & Memory - Agents maintain long-term conversation history, remembering previous queries, results, and user preferences (e.g., "Show me the graph for that pack")
- Marathon workflows - Long-running tasks (pack audits, continuous monitoring)
- Real-time analysis - Webcam, screen share, or YouTube video defect detection
- "Detect-Locate-Describe" methodology for precise classification
- Multi-modal support - Images, videos, live streams, thermal cameras
- PCB inspection - Open circuits, shorts, solder mask defects via Gemini Vision
- PyBaMM integration - Doyle-Fuller-Newman (DFN) physics modeling
- Universal CSV parser - AI-powered semantic column mapping for any format
- Interactive visualization - Multi-plot Recharts with voltage, current, temperature
- EIS analysis - Layer-by-layer impedance diagnosis (Ohmic, Kinetics, Diffusion)
- Unified Dashboard - Real-time tracking of vehicles, drivers, and charging stations
- Scenario Simulation - Heat waves, cold snaps, fast charging stress tests
- Strategic Insights - Thermal spread analytics, risk assessment, tactical commands
- Smart Settings - Configurable thresholds, notifications, and units via new Settings Panel
- AI Command Center - "Add Driver", "Assign Vehicle" via natural language commands
- Gerber file analysis - Automated CAM validation
- Adaptive process control - Etching optimization, lamination scaling
- Quality assurance - Automated compliance certificate generation
- Flight bar optimization - Plating uniformity prediction
- ChromaDB vector store - Semantic search across technical documentation
- Gemini embeddings - Context-aware retrieval
- Chat integration - Ask questions with automatic knowledge injection
- PDF ingestion - Parse battery safety standards, extensive manuals, and supplier datasheets
- Technical Q&A - "What is the max charging current for the Samsung 30Q based on the datasheet?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend (Vite) β
β ββββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββ¬βββββββββ β
β β Visual β Charging β Fleet β PCB β Chat β β
β β Scout β Analysis β Monitor β Mfg. β AI β β
β ββββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββ΄βββββββββ β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β FastAPI REST + WebSocket
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
β Python Backend (FastAPI) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ADK Multi-Agent System (Runner) β β
β β ββββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββββ β β
β β βCommander β Defect β Charging β Fleet β β β
β β β Agent β Agent β Agent β Agent β β β
β β ββββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββββ β β
β β ββββββββββββ¬βββββββββββββββββββββββββββββββββββ β β
β β β Safety β Predictive Maintenance Agent β β β
β β ββββββββββββ΄βββββββββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 20+ Specialized Tools β β
β β Vision β’ PyBaMM β’ EIS β’ Fleet β’ Reporting β’ RAG β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββ¬βββββββββββ¬ββββββββββββββββββββββββββββββ β
β β SQLite β ChromaDB β PyBaMM Physics Engine β β
β ββββββββββββ΄βββββββββββ΄ββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The fastest way to run BatteryForge AI - containerized deployment with zero manual configuration.
- Docker Desktop (includes Docker Compose)
- Gemini API Key (free tier available)
# 1. Clone and navigate
git clone <your-repo-url>
cd BatteryForgeAI
# 2. Configure API key
cp .env.example .env
nano .env # Add: GEMINI_API_KEY=your_actual_key_here
# 3. Launch (builds and starts all services)
docker compose up --build -d| Service | URL | Description |
|---|---|---|
| π Frontend | http://localhost | Main web interface |
| π§ Backend API | http://localhost:8000 | FastAPI server |
| π API Docs | http://localhost:8000/docs | Interactive Swagger UI |
| β€οΈ Health Check | http://localhost:8000/health | Service status |
# View real-time logs
docker compose logs -f
# View specific service logs
docker compose logs -f backend
docker compose logs -f frontend
# Restart services
docker compose restart
# Stop services (keeps data)
docker compose down
# Stop and REMOVE all data (β οΈ destructive)
docker compose down -v
# Rebuild after code changes
docker compose up --buildπ For advanced Docker usage, troubleshooting, and production deployment, see DOCKER.md
For local development without Docker:
- Python 3.11+ (3.13 recommended)
- Node.js 18+
- Gemini API Key (Get one here)
cd backend
# Create virtual environment
python -m venv venv
# Activate (Windows)
.\venv\Scripts\activate
# Activate (macOS/Linux)
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY
# Run server
uvicorn main:app --reloadBackend will be available at http://localhost:8000
cd frontend
# Install dependencies
npm install
# Run development server
npm run devFrontend will be available at http://localhost:5173
Upload Mode:
- Navigate to Visual Intelligence tab
- Upload battery/PCB image or video
- Click Analyze to detect defects
- Review classification, severity, and mitigation
Live Scout Mode:
- Go to Visual Intelligence β Live Scout
- Select input source (Webcam, Upload, YouTube URL)
- Click Start Scout AI for real-time analysis
- Monitor live defect logs with timestamps
Standard Workflow:
- Go to Charging Analysis tab
- Upload CSV file (any format - Arbin, BioLogic, Tesla, etc.)
- System auto-detects columns using AI semantic mapping
- View interactive plots with voltage, current, temperature
- Get PyBaMM physics comparison and safety score
EIS Analysis:
- Upload EIS data (frequency, real/imaginary impedance)
- View Nyquist plot with layer-by-layer diagnosis
- Get ohmic, kinetics, and diffusion health assessment
- Navigate to Fleet Monitor
- View real-time status of Vehicles, Drivers, and Charging Stations at a glance
- Use the Map View (powered by Leaflet) to track assets geographically
- Run scenario simulations (heat wave, cold snap) via the AI Agent
- Manage fleet configuration via the new Settings tab
- Open Chat Interface
- Ask questions or give commands:
- "Analyze this battery image for defects"
- "Simulate a heat wave on the fleet"
- "What is lithium plating?"
- "According to the uploaded LG datasheet, what is the cutoff voltage?"
- "Run a full pack audit"
- Watch agent trace to see specialist collaboration
- Navigate automatically with
[VIEW: VISUAL]commands - Contextual Memory - The agent remembers previous context, allowing for natural follow-up questions (e.g., "Add a driver for that vehicle")
- Go to PCB Manufacturing tab
- Upload Gerber file for CAM validation
- Get adaptive etching control recommendations
- Run lamination scaling predictions
- Generate compliance certificates
- Google Gemini 3 Flash Preview - Multi-agent orchestration & tool calling
- Google ADK - Agent Development Kit for workflow coordination
- Gemini Vision - Multimodal defect detection
- ChromaDB - Vector database for RAG
- Gemini Embeddings - Semantic search
- PyBaMM - Python Battery Mathematical Modeling (DFN solver)
- NumPy - Numerical computing
- Pandas - Data analysis
- SciPy - Scientific computing
- FastAPI - High-performance API framework
- Uvicorn - ASGI server
- Pydantic - Data validation
- SQLite - Analysis history
- AsyncIO - Asynchronous programming
- React 18 - UI framework
- Vite - Lightning-fast build tool
- Recharts - Scientific data visualization
- Leaflet (Vanilla) - Lightweight, robust mapping without React wrappers
- Framer Motion - Smooth animations
- React Player - Video playback
- Tailwind CSS - Utility-first styling
- Docker - Containerization for consistent deployment
- Docker Compose - Multi-container orchestration
- Nginx - Production web server and reverse proxy
- Multi-stage builds - Optimized container images
- Persistent volumes - Data preservation across restarts
GET /api/agent/status- Check ADK agent availabilityPOST /api/chat/send- Multi-agent chat interfacePOST /api/agent/workflow- Trigger marathon workflowsGET /api/agent/session/{id}- Get session stateWS /api/ws/agent- Real-time agent streaming
POST /api/analyze/defect- Visual defect detectionPOST /api/analyze/charging- Charging curve analysisPOST /api/analyze/log- Fault log parsingPOST /api/analyze/aging- Battery aging predictionPOST /api/analyze/comparison- Multi-file comparison
GET /api/fleet/data- Real-time fleet statusPOST /api/fleet/simulate- Run scenario simulationPOST /api/fleet/material-selection- Material optimizationPOST /api/fleet/drill-check- Drill wear analysis
POST /api/gerber/analyze- Gerber file validationPOST /api/process/etching-control- Etching optimizationPOST /api/process/lamination-scaling- Lamination predictionPOST /api/process/plating-optimization- Plating uniformity
POST /api/rag/query- RAG knowledge base search
Pack Audit Workflow:
POST /api/agent/workflow
{
"workflow_name": "pack_audit",
"session_id": "audit_session_1",
"parameters": {
"pack_id": "PACK-001",
"depth": "comprehensive"
}
}Continuous Monitor Workflow:
POST /api/agent/workflow
{
"workflow_name": "continuous_monitor",
"session_id": "monitor_session_1",
"parameters": {
"interval_seconds": 30,
"alert_threshold": "critical"
}
}All agents have access to 20+ specialized tools:
- Vision:
analyze_battery_image,analyze_pcb_image,analyze_video_stream - Simulation:
run_pybamm_simulation,simulate_fleet_scenario,predict_aging_trajectory - Data:
parse_charging_data,analyze_eis_spectrum,search_knowledge_base - Fleet:
get_fleet_status,control_charging_rate,send_operator_alert - Safety:
initiate_emergency_shutdown(HITL confirmation required)
Follows "Detect-Locate-Describe" framework:
- Detect - Identify anomaly presence (swelling, corrosion, thermal runaway)
- Locate - Pinpoint physical region (tab, body, terminal)
- Describe - Technical electrochemical assessment
- Recommend - Immediate mitigation action
Uses Doyle-Fuller-Newman (DFN) model - the gold standard for lithium-ion simulation:
- Accounts for solid-state diffusion, electrolyte transport, and electrochemical reactions
- Predicts voltage, current, temperature with high accuracy
- Validates experimental data against first-principles physics
Multi-layer impedance diagnosis per IEST standards:
- High Frequency (>1kHz) - Ohmic resistance (contact, cable, electrolyte)
- Mid Frequency (1Hz-1kHz) - Charge transfer (R_ct), SEI layer
- Low Frequency (<1Hz) - Diffusion (Warburg impedance)
- Automated visual inspection at production line speeds
- PCB defect detection before assembly
- Compliance certification generation
- Batch quality trending and analytics
- Charging curve optimization using physics models
- Aging mechanism identification from EIS data
- Material comparison via multi-file analysis
- Protocol validation against knowledge base
- Predictive maintenance scheduling
- Thermal event monitoring with live alerts
- Strategic planning via scenario simulation
- Emergency response with HITL safety controls
- Interactive battery physics visualization
- AI-powered technical Q&A with citations
- Multimodal analysis demonstrations
- Agent reasoning transparency via trace logs
BatteryForge AI is fully containerized and ready for deployment to any Docker-compatible platform.
docker compose up -dAWS (Elastic Container Service)
# Push to ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <account>.dkr.ecr.us-east-1.amazonaws.com
docker tag batteryforgeai-backend:latest <account>.dkr.ecr.us-east-1.amazonaws.com/batteryforge-backend:latest
docker push <account>.dkr.ecr.us-east-1.amazonaws.com/batteryforge-backend:latest
# Deploy via ECS task definitionGoogle Cloud Platform (Cloud Run)
# Build and deploy
gcloud builds submit --tag gcr.io/<project-id>/batteryforge-backend
gcloud run deploy batteryforge --image gcr.io/<project-id>/batteryforge-backend --platform managedAzure (Container Instances)
# Deploy via Azure Container Instances
az container create --resource-group batteryforge-rg \
--name batteryforge-backend \
--image batteryforgeai-backend \
--dns-name-label batteryforge \
--ports 8000DigitalOcean App Platform
- Use
docker-compose.ymlwith App Platform's Docker Compose support - Configure environment variables in dashboard
- Automatic HTTPS and scaling
For high-availability production deployments:
- Convert
docker-compose.ymlto Kubernetes manifests using kompose - Use Helm charts for package management
- Configure horizontal pod autoscaling for backend
- Set up Ingress for routing
See DOCKER.md for detailed production deployment, security hardening, and monitoring setup.
All data is preserved across container restarts via Docker volumes:
- Analysis history - SQLite database
- Knowledge base - ChromaDB vector store
- User uploads - Battery images, CSVs, videos
Backup volumes before upgrades:
docker run --rm -v batteryforgeai_battery-db:/data -v $(pwd)/backups:/backup \
alpine tar czf /backup/battery-db-$(date +%Y%m%d).tar.gz -C /data .We welcome contributions! Areas of interest:
- New specialist agents (compliance, supply chain, thermal management)
- Extended tool library (acoustic analysis, X-ray/CT integration)
- Custom PyBaMM models (degradation mechanisms, parameter fitting)
- Hardware integrations (BMS live telemetry, thermal cameras)
This project is built for the Google Gemini 3 Hackathon.
β‘ Powered by Google Gemini 3 & ADK β‘
- Google Gemini Team - For the incredible Gemini 3 and ADK framework
- PyBaMM Community - For open-source battery modeling tools
- ChromaDB Team - For vector database infrastructure
- React Ecosystem - For amazing frontend libraries
Have questions or want to collaborate?
- GitHub Issues - Bug reports and feature requests
- Discussions - Technical Q&A and ideas
- Email - For partnership inquiries
Built with β€οΈ for safer, smarter batteries