spb/worthdoing Public
Autonomous investigation agent that discovers, challenges, and ranks things genuinely worth doing — Claude + Firecrawl, Next.js 16, PostgreSQL
TypeScript 91.5%
SQL 5.8%
CSS 2.2%
1<p align="center">2 <img src="public/logo.svg" alt="WorthDoing.ai" width="88" height="88" />3</p>45<h1 align="center">WorthDoing.ai</h1>67<p align="center"><em>Google finds what exists. WorthDoing finds what should.</em></p>89<p align="center">10 <img src="https://img.shields.io/badge/Next.js-16-black?logo=nextdotjs&logoColor=white" alt="Next.js 16" />11 <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" alt="TypeScript strict" />12 <img src="https://img.shields.io/badge/PostgreSQL-17-4169E1?logo=postgresql&logoColor=white" alt="PostgreSQL 17" />13 <img src="https://img.shields.io/badge/Drizzle-ORM-C5F74F?logo=drizzle&logoColor=black" alt="Drizzle ORM" />14 <img src="https://img.shields.io/badge/Claude-Opus%205-D97757?logo=anthropic&logoColor=white" alt="Claude Opus 5" />15 <img src="https://img.shields.io/badge/Firecrawl-v2-FF6B35" alt="Firecrawl v2" />16 <img src="https://img.shields.io/badge/tests-19%20passing-166B49" alt="Tests" />17 <img src="https://img.shields.io/badge/realtime-SSE-3D5A80" alt="SSE realtime" />18 <img src="https://img.shields.io/badge/license-proprietary-6b6355" alt="License" />19</p>2021---2223**WorthDoing.ai** is an agentic web application that continuously discovers, investigates, challenges, and ranks things genuinely worth doing. It answers a different question from search engines:2425> **What should exist, be built, researched, tested, funded, or pursued that does not exist yet — or is not being pursued enough?**2627It is not a thin LLM wrapper and not a fixed `query → search → scrape → summarize` pipeline. It is a real multi-step autonomous investigation agent: Claude repeatedly decides what it knows, what remains uncertain, what to search next, which sources to inspect, whether to reject hypotheses, and when the evidence suffices to conclude.2829## How an investigation works30311. **Scout** — the agent maps a domain with varied Firecrawl searches and forms *falsifiable hypotheses*.322. **Investigate** — targeted searches (`verify` / `market` / `technical` / `competition`), page scrapes, and evidence saved as near-verbatim quotes linked to hypotheses.333. **Skeptic** — mandatory falsification: every high-confidence hypothesis gets adversarial `falsify` searches. Hypotheses weaken, branch, or die. *A rejected hypothesis is useful progress.*344. **Synthesize** — surviving hypotheses become **opportunities** with a seven-dimension, evidence-cited **Worth Score** (demand, neglectedness, feasibility, why-now, impact, competition, risk) — with evidence confidence reported separately, never blended in.355. **Report** — a streamed, citation-grounded report per opportunity; citations resolve mechanically to saved evidence, never invented.3637Every UI event corresponds to a real backend `AgentEvent` streamed over SSE — the live timeline never fabricates progress.3839## Screenshots4041| Discover | Live investigation |42| --- | --- |43|  |  |4445| Opportunity report | Mobile (390 px) |46| --- | --- |47|  | <img src="docs/screenshots/mobile.png" alt="Mobile live view" width="260" /> |4849*Real output: the agent investigated "Find things worth doing in local AI" — 21 steps, 14 searches, 17 evidence items, one hypothesis rejected and one weakened by adversarial checks, one opportunity (Worth Score 74 at 69% evidence confidence) with a fully cited report.*5051## Architecture5253```54Next.js 16 (App Router, port 3001)55├── src/lib/agent/ the investigation engine56│ ├── engine.ts explicit tool loop (Claude decides → backend executes)57│ ├── tools.ts 11 tools, Zod-validated, strict schemas58│ ├── executors.ts budget enforcement, dedup, persistence, events59│ ├── state.ts InvestigationState + compact digest (state compression)60│ ├── synthesis.ts streamed reports with mechanical citations61│ └── scoring.ts evidence-weighted Worth Score62├── src/lib/firecrawl/ search / scrape / crawl / extract behind an adapter63│ └── cache.ts canonical URLs, sha-256 content hashes, 24h freshness64├── src/lib/anthropic/ Claude adapter (streaming, cost telemetry)65├── src/lib/db/ Drizzle schema — 17 tables (Opportunity-Graph-ready)66└── src/app/ Discover · live investigation · reports · explore · history67```6869**Hard guarantees**7071- Budgets are hard bounds (30 steps, 20 searches, 60 scrapes, 3 crawls, wall-time) with structured stop reasons.72- No conclusion without traceable evidence; every score dimension carries `{score, confidence, reasoning, evidenceIds}`.73- Scraped content is untrusted data, never instructions (prompt-injection defense in the system prompt and `<untrusted_source>` wrapping).74- Investigations are resumable: state lives in Postgres, not in the model's context.7576## Getting started7778```bash79cp .env.example .env # fill in ANTHROPIC_API_KEY, FIRECRAWL_API_KEY, DATABASE_URL80pnpm install81pnpm db:migrate82pnpm dev # http://localhost:300183pnpm test # unit tests (scoring, dedup, tool contracts)84```8586## Deployment8788Runs on node `m3u96a` behind an ngrok tunnel mapped to **https://www.worthdoing.ai** (see `deploy/`). SSE routes are proxy-safe: `Cache-Control: no-cache`, `X-Accel-Buffering: no`, per-event flush, `Last-Event-ID` replay on reconnect.8990---9192## Author9394**Simon-Pierre Boucher**95📧 [contact@spboucher.ai](mailto:contact@spboucher.ai)9697*Deployment: node `m3u96a` via ngrok → https://www.worthdoing.ai*98