by G4brym
A serverless, AI-powered deep research agent built with Cloudflare Workers and Google Gemini 2.5
# Add to your Claude Code skills
git clone https://github.com/G4brym/workers-researchA serverless, Cloudflare Workers-based Deep Research Agent powered by Google Gemini 2.5.
autorag_id is provided with the research request.Inspired by dzhng's deep-research. Thank you to dzhng for the original concept. workers-research adapts this for the Cloudflare ecosystem.
No comments yet. Be the first to share your thoughts!
graph TD
B{Cloudflare Worker} -- API Calls --> D[Cloudflare Workflows];
B -- Fetches Status/Data --> F[Cloudflare D1 Database];
D -- Triggers --> E[Gemini 2.5 API];
D -- Stores/Retrieves Research --> F;
D -- If Crawling Needed --> G[Browser Rendering API];
E -- Report Chunks/Results --> D;
subgraph "Cloudflare Ecosystem (Backend)"
B
D
F
G
end
subgraph "External Services"
E
end
style B fill:#ccf,stroke:#333,stroke-width:2px;
style D fill:#ccf,stroke:#333,stroke-width:2px;
style E fill:#fca,stroke:#333,stroke-width:2px;
style F fill:#ccf,stroke:#333,stroke-width:2px;
style G fill:#ccf,stroke:#333,stroke-width:2px;
The following diagram illustrates the detailed workflow of the research agent when processing a request:
graph TD
A["User Input: Query, Parameters"] --> B["System: Prepare Full Query & Setup"];
B --> C["Start Iterative Research Cycle"];
C --> C1["Generate Search Tasks/Queries based on current goal & learnings"];
C1 --> C2["Gather Information (Web Search & Content Extraction)"];
C2 --> C3["Process Information: Extract Key Learnings & Identify Follow-up Needs"];
C3 --> C4["Further Research Iterations Needed? (based on depth/breadth)"];
C4 -- Yes --> C1;
C4 -- No --> D["Compile All Learnings & Generate Final Report"];
D --> E["Store Report & Update Status in Database"];
E --> F["Research Complete / Report Available"];
Follow these steps to set up and run workers-research on your Cloudflare account:
Clone the Repository:
git clone git@github.com:G4brym/workers-research.git
Install Dependencies:
npm install
Cloudflare Login: Authenticate with your Cloudflare account using Wrangler:
wrangler login
Create a Cloudflare D1 Database: Create a D1 database in your Cloudflare dashboard or using Wrangler:
wrangler d1 create workers-research
Important: Replace "replace-me" in your wrangler.toml file with the database_id output from the command above.
Database migrations are applied automatically.
Deploy to Cloudflare Workers: Deploy your worker to Cloudflare:
wrangler deploy
This will deploy your worker to workers-research.{your-user}.workers.dev (or your custom domain if configured).
Set up API Keys:
npx wrangler secret put GOOGLE_API_KEY
(Optional) Configure Cloudflare AI Gateway:
npx wrangler secret put AI_GATEWAY_NAME
npx wrangler secret put AI_GATEWAY_ACCOUNT_ID
npx wrangler secret put AI_GATEWAY_API_KEY
Access the Dashboard:
Open your deployed worker URL (e.g., https://workers-research.{your-user}.workers.dev) in your browser to access the research dashboard.
Create a New Research:
Answer Follow-up Questions:
Monitor Research Status:
Read Research Reports:
Ask Follow-up Questions:
Re-run Researches:
Home page

New Research

Follow up questions

Reading a report

This project is licensed under the MIT License - see the LICENSE file for details.