Multi-Agent AI Code Analysis System powered by Google ADK and Cloud Run
An enterprise-grade AI-powered code analysis platform that uses multi-agent architecture to provide comprehensive code intelligence. Built for the Google Cloud Run Hackathon 2025 in the AI Agents Category.
- π€ Multi-Agent AI System - 4 specialized agents working sequentially
- π Security Analysis - SQL injection, XSS, and vulnerability detection
- β‘ Performance Optimization - Complexity analysis and bottleneck detection
- π§ Code Refactoring - Best practices and code quality improvements
- π Real-time Dashboard - System metrics and analysis tracking
- βοΈ Cloud-Native - Fully serverless on Google Cloud Run
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Code Input β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Multi-Agent Coordinator β
β (Sequential Execution Pattern) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββ΄ββββββββββ¬ββββββββββ¬ββββββββββ
βΌ βΌ βΌ βΌ
ββββββββββ ββββββββββββ ββββββββββ ββββββββββ
β Parser β ββββββ> β Security β β Perf β βRefactorβ
β Agent β β Agent β β Agent β β Agent β
ββββββββββ ββββββββββββ ββββββββββ ββββββββββ
β β β β
βββββββββββ¬ββββββββββ΄ββββββββββ΄ββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Combined Analysis Results β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Backend:
- FastAPI (Python 3.11)
- Google Generative AI (Gemini 2.0 Flash)
- Google Cloud Run (8 vCPU, 8GB RAM)
- Google Firestore (NoSQL Database)
- Google Cloud Storage (File Storage)
- Google Secret Manager (API Key Management)
Frontend:
- React 18.2 + TypeScript
- Ant Design 5.x
- Vite 5.0
- Nginx (Production Server)
- Google Cloud Project with billing enabled
- Google Cloud SDK (gcloud) installed
- Gemini API Key
- Node.js 18+ and Python 3.11+
Backend:
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
export GEMINI_API_KEY="your-api-key"
export PROJECT_ID="your-project-id"
export REGION="us-central1"
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadFrontend:
cd frontend
npm install
npm run devBackend:
cd backend
gcloud run deploy code-intelligence-api \
--source . \
--region us-central1 \
--platform managed \
--allow-unauthenticated \
--memory 8Gi \
--cpu 8 \
--timeout 300 \
--min-instances 2 \
--max-instances 20 \
--set-env-vars PROJECT_ID=your-project-id,REGION=us-central1 \
--update-secrets GEMINI_API_KEY=GEMINI_API_KEY:latestFrontend:
cd frontend
gcloud run deploy code-intelligence-ui \
--source . \
--region us-central1 \
--platform managed \
--allow-unauthenticated \
--memory 512Mi \
--cpu 1 \
--timeout 60Endpoint: POST /api/adk/analyze
Request:
{
"code": "def get_user(id):\n query = f\"SELECT * FROM users WHERE id = {id}\"\n return db.execute(query)",
"agent_type": "multi"
}Response:
{
"analysis_id": "uuid",
"status": "completed",
"results": {
"parser": "Code structure analysis...",
"security": "SQL injection vulnerability detected...",
"performance": "Query optimization needed...",
"refactoring": "Use parameterized queries..."
},
"timestamp": "2025-11-10T12:00:00Z"
}Endpoint: GET /api/monitoring/health
Response:
{
"status": "healthy",
"queue": {
"total_queued": 0,
"executing": 0,
"available_slots": 10
},
"system": {
"cpu": 0.0,
"memory": 1.4,
"load_score": 0.42
}
}- Code structure analysis
- Syntax validation
- Complexity metrics (Cyclomatic, Halstead)
- Function/class detection
- SQL injection detection
- XSS vulnerability scanning
- Insecure deserialization
- Hardcoded credentials detection
- Time complexity analysis (O(n), O(nΒ²), etc.)
- Memory usage optimization
- Database query optimization
- Caching recommendations
- Code quality improvements
- Best practices enforcement
- Design pattern suggestions
- Clean code recommendations
Real-time monitoring dashboard showing:
- System metrics (CPU, Memory, Load)
- Queue status (Queued, Executing, Completed)
- Performance statistics (P50, P95, P99 latency)
- Agent execution metrics
This project is built for the AI Agents Category of the Google Cloud Run Hackathon.
Why This Project Wins:
- Multi-Agent Architecture - Demonstrates advanced AI agent coordination
- Cloud-Native Design - Fully serverless, auto-scaling, cost-efficient
- Production-Ready - Enterprise-grade monitoring, error handling, testing
- Real-World Impact - Solves actual developer pain points in code review
- Google Cloud Integration - Uses Cloud Run, Firestore, Storage, Secret Manager
MIT License
This is a hackathon project. Contributions are welcome after the competition ends.
Built with β€οΈ for Google Cloud Run Hackathon 2025
#CloudRunHackathon #GoogleADK #AIAgents