{"id":25386187,"url":"https://github.com/g4brym/workers-research","last_synced_at":"2025-04-09T16:58:06.961Z","repository":{"id":277437046,"uuid":"929960227","full_name":"G4brym/workers-research","owner":"G4brym","description":"A Durable Objects implementation of OpenAI's Deep Research agent","archived":false,"fork":false,"pushed_at":"2025-02-13T22:45:00.000Z","size":1216,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T23:32:31.306Z","etag":null,"topics":["ai-agent","cloudflare","deep-research","durable-objects","openai"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/G4brym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T19:40:57.000Z","updated_at":"2025-02-13T22:45:03.000Z","dependencies_parsed_at":"2025-02-13T23:43:40.761Z","dependency_job_id":null,"html_url":"https://github.com/G4brym/workers-research","commit_stats":null,"previous_names":["g4brym/workers-research"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G4brym%2Fworkers-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G4brym%2Fworkers-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G4brym%2Fworkers-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/G4brym%2Fworkers-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/G4brym","download_url":"https://codeload.github.com/G4brym/workers-research/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238975882,"owners_count":19561784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","cloudflare","deep-research","durable-objects","openai"],"created_at":"2025-02-15T10:21:34.928Z","updated_at":"2025-04-09T16:58:06.955Z","avatar_url":"https://github.com/G4brym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# workers-research\n\n**A serverless, Cloudflare Workers-based Deep Research Agent powered by Google Gemini 2.0.**\n\n[![Visit Website](https://img.shields.io/badge/website-visit-blue)](https://rosai.dev)\n[![GitHub stars](https://img.shields.io/github/stars/G4brym/workers-research?style=social)](https://github.com/G4brym/workers-research/stargazers)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/G4brym/workers-research/blob/main/LICENSE)\n\n[**Try it now →**](https://rosai.dev)\n\n## ✨ Features\n\n- **Deep Research Capabilities:** Conduct in-depth research on any topic you can imagine.\n- **Powered by Google Gemini 2.0:** Leverages the advanced reasoning and language capabilities of Google's latest models\n  for high-quality research reports.\n- **Serverless Architecture:** Runs entirely on Cloudflare Workers and Workflows, offering scalability, reliability, and\n  cost-effectiveness.\n- **User-Friendly Dashboard:**  Built with Hono and JSX for a reactive and intuitive web interface to manage and view\n  your researches.\n- **No Prompt Compression Needed:** Takes advantage of Gemini 2.0's massive context window, simplifying the architecture\n  and improving report quality.\n\n## 🚀 Inspiration and Acknowledgements\n\nThis project is heavily inspired by the incredible work of [dzhng](https://github.com/dzhng) and\ntheir [deep-research](https://github.com/dzhng/deep-research) project.  **A huge thank you and props to dzhng for\ncreating the original concept and codebase that served as the foundation for workers-research.**  This project adapts\nand reimagines the core ideas of deep-research to run seamlessly within the Cloudflare ecosystem, making it more\naccessible and easier to deploy.\n\n## 💡 Key Differences from Deep-Research\n\n- **Serverless First with Cloudflare Workers:**  The original `deep-research` project is designed to run in Node.js or\n  Docker environments. `workers-research` is built from the ground up for Cloudflare Workers.\n- **Cloudflare Workflows for Reliability:**  A significant enhancement is the use of Cloudflare Workflows to manage the\n  research process. This ensures that even complex, multi-step research tasks are reliably completed.\n- **Gemini 2.0 and Simplified Architecture:**  Leveraging the extensive 2 million token context window and\n  cost-effectiveness of Google Gemini 2.0, `workers-research` **omits prompt compression techniques** found in the\n  original project. This simplifies the codebase, potentially improves report quality by providing more context to the\n  model, and reduces complexity.\n- **Low Cost Deployment:** `workers-research` is designed to be deployable on Cloudflare Workers. But due to some\n  features being locked in the\n  paid mode (namely browser rendering), deploying this project requires having to pay the minimum $5\n  per month subscription. The included volume in your base subscription is going to cover more than 100 researches per day, without going over the $5\n  a month.\n\n## 🔍 Use Cases\n\n- **Academic Research:** Quickly gather information and insights for academic papers, theses, and research projects.\n- **Market Analysis:** Research industry trends, competitors, and market dynamics for business decisions.\n- **Content Creation:** Generate comprehensive research for blog posts, articles, and educational content.\n- **Product Development:** Explore user needs, technical solutions, and industry standards for new products.\n- **Educational Projects:** Help students gather information on complex topics for projects and assignments.\n\n## 🛠️ Technology Stack\n\n- **Cloudflare Workers:**  The core runtime environment for the application.\n- **Cloudflare Workflows:**  Manages the research process, ensuring reliable execution and persistence.\n- **Cloudflare D1 Database:**  Serverless SQL database to store research data, status, and results.\n- **Browser Rendering:**  Web crawling API used to gather information from the internet.\n- **Google Gemini 2.0:**  The cutting-edge language model from Google AI, responsible for generating research reports\n  and insights.\n- **Cloudflare AI Gateway:** Optional proxy for AI requests, providing caching and enhanced management capabilities.\n- **Hono:**  A lightweight web framework for Cloudflare Workers, used for building the dashboard and API endpoints.\n- **workers-qb:**  A lightweight query builder for Cloudflare D1, simplifying database interactions.\n\n## 🚦 Getting Started\n\nYou have two options to get started with workers-research:\n\n### 1. Try the Hosted Version\n\nVisit our [hosted platform](https://rosai.dev) to start using workers-research instantly with no setup required. Free for testing and light usage.\n\n### 2. Self-Deployment\n\nFollow these steps to set up and run `workers-research` on your Cloudflare account:\n\n#### Setup Steps\n\n1. **Clone the Repository:**\n   ```bash\n   git clone git@github.com:G4brym/workers-research.git\n   ```\n\n2. **Install Dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Cloudflare Login:**\n   Authenticate with your Cloudflare account using Wrangler:\n   ```bash\n   wrangler login\n   ```\n\n4. **Create a Cloudflare D1 Database:**\n   Create a D1 database in your Cloudflare dashboard or using Wrangler:\n   ```bash\n   wrangler d1 create workers-research\n   ```\n   **Important:**  Replace `\"replace-me\"` in your `wrangler.toml` file with the `database_id` output from the command\n   above.\n\n5. **Apply Database Migrations:**\n   Apply D1 database migrations using Wrangler:\n   ```bash\n   wrangler d1 migrations apply DB --remote\n   ```\n\n6. **Deploy to Cloudflare Workers:**\n   Deploy your worker to Cloudflare:\n   ```bash\n   wrangler deploy\n   ```\n   This will deploy your worker to `workers-research.{your-user}.workers.dev` (or your custom domain if configured).\n\n7. **Set up API Keys:**\n   - **Google AI Studio API Key:** [https://aistudio.google.com](https://aistudio.google.com).\n\n   - Upload API Keys into workers:\n\n     ```bash\n     npx wrangler secret put GOOGLE_API_KEY\n     ```\n\n8. **(Optional) Configure Cloudflare AI Gateway:**\n   - Create an AI Gateway in your Cloudflare account dashboard.\n   - Configure the gateway with your preferred settings.\n   - Set the required environment variables:\n\n     ```bash\n     npx wrangler secret put AI_GATEWAY_NAME\n     npx wrangler secret put AI_GATEWAY_ACCOUNT_ID\n     ```\n\n   - If your gateway has authentication enabled, also set the API key:\n\n     ```bash\n     npx wrangler secret put AI_GATEWAY_API_KEY\n     ```\n\n9. **Access the Dashboard:**\n   Open your deployed worker URL (e.g., `https://workers-research.{your-user}.workers.dev`) in your browser to access\n   the research dashboard.\n\n## ✍️ Usage\n\n1. **Create a New Research:**\n   - On the dashboard homepage, you'll see a \"Create New Research\" section.\n   - Enter your research query, desired depth, and breadth.\n   - Click \"Continue with creation\".\n\n2. **Answer Follow-up Questions:**\n   - The application will generate follow-up questions to clarify your research intent.\n   - Answer these questions to refine the research direction.\n   - Click \"Create new Research\" to start the research workflow.\n\n3. **Monitor Research Status:**\n   - You can track the status of your researches on the dashboard.\n   - Researches in progress will be marked as \"Running\".\n   - Completed researches will be marked as \"Complete\".\n\n4. **Read Research Reports:**\n   - Once a research is complete, a \"Read\" button will appear next to it.\n   - Click \"Read\" to view the generated research report in a nicely formatted HTML page.\n\n5. **Re-run Researches:**\n   - If you want to re-run a previous research, click the \"🔄\" button next to the research entry. This will create a new\n     research based on the same query and parameters.\n\n## 📊 Performance \u0026 Limitations\n\n- **Research Time:** Most researches complete within 5-10 minutes, depending on complexity.\n- **Research Depth:** Configure depth from 1-5, with higher values producing more comprehensive reports.\n- **API Limits:** Be aware of Cloudflare and Google Gemini API limits when running multiple researches.\n\n## 💬 Community \u0026 Support\n\n- **[GitHub Issues](https://github.com/G4brym/workers-research/issues):** Report bugs or suggest features\n- **[Discussions](https://github.com/G4brym/workers-research/discussions):** Ask questions and share ideas\n- **[Discord Community](https://discord.gg/example):** Join our community for real-time help\n\n## 🖼️ Screenshots\n\nHome page\n![homepage](https://github.com/G4brym/workers-research/raw/main/assets/images/home.png)\n\nNew Research follow up questions\n![homepage](https://github.com/G4brym/workers-research/raw/main/assets/images/new-research.png)\n\nReading a report\n![homepage](https://github.com/G4brym/workers-research/raw/main/assets/images/report.png)\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg4brym%2Fworkers-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg4brym%2Fworkers-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg4brym%2Fworkers-research/lists"}