--- title: Web Research Agent emoji: ๐Ÿ”Ž colorFrom: gray colorTo: red sdk: docker app_port: 7860 pinned: false --- # Web Research Agent ๐Ÿ”Ž Ask a question โ†’ get a **cited briefing** built from live web sources you can verify โ€” then **dig deeper** into any claim, section, or source, in your own words, and it appends an expandable research branch. > Project **#13** of the *"30 AI Projects in 15 Days"* build-in-public challenge. > Focus: **multi-step agent orchestration** (plan โ†’ search โ†’ read โ†’ reflect โ†’ cite). ## What makes it different Most research tools hand you a static answer. This one is **explorable**: click *dig deeper* on any citation, highlighted sentence, or source, type what you want investigated, and it spawns a scoped research pass rendered inline as a branch โ€” which you can dig into again. A recursive research tree. ## How it works (honest by construction) - **Plan** โ€” the question is broken into targeted search queries. - **Search** โ€” keyless, multi-source: general web (DuckDuckGo / SearXNG / Bing) + Google News, and for the *technical* area, arXiv + GitHub. No API keys required. - **Read** โ€” top results are fetched and extracted to clean text (redirects resolved, SSRF-guarded). - **Reflect** โ€” deep mode critiques its own draft for gaps and runs another round. - **Cite** โ€” the writer uses ONLY the sources it actually read, cites every claim inline `[n]`, and says what's missing rather than inventing. Citations render as **domain chips**; click one for the supporting passage. ## Modes & areas - **Modes:** `quick` (search โ†’ read โ†’ cited answer) ยท `deep` (plan โ†’ gather โ†’ reflect โ†’ report). - **Areas:** `web` ยท `opportunity` ยท `technical` (adds arXiv + GitHub) ยท `competitive` ยท `client` โ€” each blends the right sources. ## Run it ```bash pip install -r requirements.txt python app.py # http://127.0.0.1:7860 (web UI) python agent.py "your question" --mode deep --area technical # CLI # Backend: local Ollama by default (free/private); set RESEARCH_LLM_BACKEND=claude + ANTHROPIC_API_KEY for cloud. # Optional: RESEARCH_SAVE=1 banks each brief to a memory store so research compounds (local use). ``` ## Two tiers - **This hosted demo** narrates with a hosted model, keyless search. - **GritAI Studio** runs the whole thing on your own local GPU fleet โ€” free per-run, fully private โ€” and can bank every brief to your own knowledge base so research compounds over time. --- Built by **Robert Lucyk** ยท [GritAI Solutions](https://gritai.solutions) ยท part of the 30-in-15 challenge.