PETAL is a multi-agent AI workspace for tasks, calendar, notes, and chat.
Built with FastAPI, React, Vite, Supabase, and Gemini.
| Layer | Technology | Badge |
|---|---|---|
| Frontend | React 18 | |
| Vite | ||
| TypeScript | ||
| Backend | FastAPI | |
| Python | ||
| SQLAlchemy | ||
| Database | PostgreSQL | |
| Supabase | ||
| AI | Gemini 2.0 Flash | |
| Cloud | Docker | |
| Google Cloud Run |
PETAL routes natural language requests through a small team of specialized agents:
- Orchestrator — routes requests and manages context
- Task Agent — manages todo workflows
- Calendar Agent — handles event scheduling
- Info Agent — stores notes and knowledge
The frontend is a brutalist, high-contrast interface designed to feel like one coherent workspace instead of separate apps.
flowchart TB
subgraph Client["Frontend (React + Vite)"]
UI["Brutalist UI"]
SC["Supabase Client"]
API["API Client"]
end
subgraph CloudRun["Cloud Run"]
subgraph Backend["FastAPI Backend"]
Auth["JWT Auth"]
Router["Request Router"]
subgraph Agents["Multi-Agent System"]
Orch["Orchestrator Agent"]
Task["Task Agent"]
Calendar["Calendar Agent"]
Info["Info Agent"]
end
DB["SQLAlchemy + asyncpg"]
end
end
subgraph Supabase["Supabase"]
PG["PostgreSQL"]
AuthSupabase["Auth"]
end
subgraph Gemini["Google Gemini 2.0 Flash"]
AI["AI Inference"]
end
UI --> API
API --> CloudRun
API --> SC
SC --> Supabase
CloudRun --> Auth
Auth --> Router
Router --> Orch
Orch --> Task
Orch --> Calendar
Orch --> Info
Task --> AI
Calendar --> AI
Info --> AI
Orch --> DB
DB --> PG
PG --> AuthSupabase
sequenceDiagram
participant User
participant UI as Frontend
participant API as Backend
participant Orch as Orchestrator
participant Agent as Specialized Agents
participant DB as Database
participant AI as Gemini
User->>UI: Natural language input
UI->>API: POST /api/chat (bearer token)
API->>Orch: Route to orchestrator
Orch->>AI: Analyze intent + context
AI-->>Orch: Intent + required agents
alt Task intent
Orch->>Agent: Invoke Task Agent
Agent->>AI: Generate todos / update status
AI-->>Agent: Structured response
Agent->>DB: CRUD operations
end
alt Calendar intent
Orch->>Agent: Invoke Calendar Agent
Agent->>AI: Parse event details
AI-->>Agent: Structured response
Agent->>DB: Create / update event
end
alt Info intent
Orch->>Agent: Invoke Info Agent
Agent->>AI: Store / retrieve knowledge
AI-->>Agent: Structured response
Agent->>DB: Note operations
end
DB-->>Agent: Confirm operation
Agent-->>UI: Structured response
UI-->>User: Render updated UI
cp .env.example .env
pip install -r requirements.txt
cd frontend && npm installBackend:
cd backend
python -m uvicorn main:app --reload --port 8080Frontend:
cd frontend
npm run devUse .env.example as the source of truth. Do not commit real keys or secrets.
Required variables:
DATABASE_URL=
SUPABASE_URL=
SUPABASE_JWT_SECRET=
SUPABASE_ANON_KEY=
GEMINI_API_KEY=
JWT_SECRET=
ALLOWED_ORIGINS=
VITE_API_URL=
VITE_SUPABASE_URL=
VITE_SUPABASE_ANON_KEY=Backend deployment on Cloud Run:
./scripts/deploy-cloud-run.shFrontend build and deploy:
./scripts/deploy-frontend.shProduction URLs:
- Frontend: https://petal-frontend-ycmhorzhoa-uc.a.run.app
- Backend: https://petal-api-ycmhorzhoa-uc.a.run.app
Secrets are intentionally excluded from source control.
Ignored by default:
.env,.env.local,.env.productionfrontend/.env,frontend/.env.local,frontend/.env.productionconfig/keys/*.jsoninfrastructure/terraform/*.tfvars- Terraform state files
- Common private key formats
backend/ FastAPI app, agents, routes, database
frontend/ React app, components, pages, styles
assets/ Logo and showcase images
infrastructure/ Terraform and migrations
scripts/ Deployment helpers
- The app is designed to run with bearer-token auth and Cloud Run-friendly CORS.
- Build-time frontend env vars are required for the deployed Supabase client.
- If you change deployment URLs, update the frontend build args and the backend CORS origin list together.






