waelio/agent is a Google ADK-powered research agent with an installable Vite frontend.
The repository contains:
- a Python ADK agent package exposed from
Agent/agent.py - a Cloudflare Worker backend in
backend/for production-hosted frontend requests - a frontend app in
frontend/ - Cloudflare Pages-friendly PWA output for the frontend
The agent package lives in Agent/ and exposes root_agent for ADK.
- package entry:
Agent/agent.py - root agent name:
researcher - model:
gemini-flash-latest - tool: Google Search grounding via
google_search
The production backend adapter lives in backend/.
It provides the same minimal API shape the frontend already expects:
POST /apps/:app/users/:user/sessionsPOST /run_sseGET /health
Instead of requiring a separately hosted Python ADK server, it calls the Gemini API server-side with Google Search grounding enabled and returns an ADK-like SSE payload for the frontend.
The frontend lives in frontend/ and is published as:
- npm package:
@waelio/agent
It is built with Vite and includes:
- chat UI for the ADK backend
- installable PWA support
- Cloudflare Pages SPA routing
- environment-based backend URL configuration
Agent/— ADK agent package withroot_agentbackend/— Cloudflare Worker backend for deployed frontend trafficfrontend/— static frontend/PWA app.env— backend environment values such asGOOGLE_API_KEYpackage.json— workspace scripts.vscode/tasks.json— saved backend run task
- Python 3.10+
- virtual environment in
.venv/ google-adkGOOGLE_API_KEYin the repo root.env
- pnpm
- Node.js compatible with the installed Vite toolchain
From the repository root:
pnpm install
If needed for Python dependencies, activate the virtualenv and install backend packages there.
Backend .env at the repository root:
GOOGLE_API_KEY=...
Frontend example env file:
frontend/.env.example
Frontend variables:
VITE_API_BASE_URLVITE_AGENT_APP_NAME
From the repository root:
pnpm dev
This starts Vite on http://127.0.0.1:3000.
From the repository root:
source .venv/bin/activateadk api_server --port 8000 --allow_origins "regex:http://(127\\.0\\.0\\.1|localhost):3000" .
There is also a saved VS Code task in .vscode/tasks.json for the backend server.
If you want ADK's built-in web UI instead of the custom frontend:
source .venv/bin/activateadk web .
Run that command from the repository root, not from inside Agent/.
The frontend is set up to deploy as a static PWA on Cloudflare Pages.
For production, the simplest setup in this repository is:
- deploy
backend/to Cloudflare Workers - build the frontend with
VITE_API_BASE_URLpointed at that Worker - deploy
frontend/distto Cloudflare Pages
- project root: repository root
- build command:
pnpm --filter ./frontend build - output directory:
frontend/dist - deploy command: leave empty
Set these in Cloudflare Pages:
VITE_API_BASE_URL=https://your-api.example.comVITE_AGENT_APP_NAME=Agent
Runtime behavior:
- on localhost, the frontend falls back to
http://localhost:8000 - in production without
VITE_API_BASE_URL, the frontend waits for a configured backend URL instead of calling the Pages origin - users can also save a backend URL from the app sidebar in the browser
The repository now includes a server-side Worker in backend/ that can back the
Cloudflare Pages frontend without requiring Cloud Run or a separate VM.
Required secret for the Worker:
GOOGLE_API_KEY
Optional Worker variable:
GEMINI_MODEL(defaults togemini-2.5-flash)
Typical deployment flow:
npx wrangler secret put GOOGLE_API_KEY --config backend/wrangler.jsoncnpx wrangler deploy --config backend/wrangler.jsonc- build the frontend with
VITE_API_BASE_URLset to the deployed Worker URL npx wrangler pages deploy frontend/dist --project-name waelio-agent
The Worker allows CORS from:
https://waelio-agent.pages.dev- preview subdomains of
waelio-agent.pages.dev https://waelio.comhttps://www.waelio.com- local development origins like
http://localhost:3000
Cloudflare Pages still hosts the frontend only.
For local development, the Python ADK backend can still run separately, such as:
- Cloud Run
- a VM
- another HTTPS service you control
For this repository's production deployment, the included Cloudflare Worker backend is the recommended default.
Make sure your backend CORS allows your Pages domain.
Example production backend command:
adk api_server --port 8000 --allow_origins "https://your-pages-domain.example.com" .
If Cloudflare runs npx wrangler deploy from the repository root, deployment will fail because this repo is a pnpm workspace and there is no root Wrangler app configuration.
For a Pages project, do not set a deploy command at all. Pages only needs the build command and output directory above.
This repository now also includes a Wrangler redirect file at .wrangler/deploy/config.json that points root-level Wrangler deploys at frontend/wrangler.jsonc.
If you want to do a manual direct upload instead of Git-integrated Pages builds, use a Pages-specific command such as:
npx wrangler pages deploy frontend/dist --project-name <your-pages-project>
The frontend build now generates:
manifest.webmanifestsw.js- Workbox assets
_redirectsfor SPA routing_headersfor Cloudflare Pages response headers
The app also includes an install button for supported browsers.
From the repository root:
pnpm build
This builds the frontend into frontend/dist.
The frontend package is published to npm as:
@waelio/agent
For package-specific notes, see frontend/README.md.
MIT