The Problem
Researchers need to pull up‑to‑date web content, see how an LLM reaches its conclusions, and keep track of sources—without manually switching between a browser, a notebook, and a citation manager.
What This Does
open-researcher is a Next.js app that stitches Anthropic’s Claude model with Firecrawl’s scraper. The UI lives under components/ (e.g., thinking-chat.tsx, search-results-display.tsx) and presents a split‑view chat beside live search results. The server‑side entry points are the API routes in app/api/, especially app/api/open-researcher/route.ts, which forwards the user query to lib/open-researcher-agent.ts. That agent builds a prompt, calls Claude, and, when needed, invokes Firecrawl via helpers in lib/utils.ts. The rendered page is app/open-researcher/page.tsx, which composes open-researcher-content.tsx and the UI components.
How It Is Wired
- Browser → Next.js page – Navigation to
/open-researcherloadsapp/open-researcher/page.tsx. This file importsapp/open-researcher/open-researcher-content.tsx(the most‑connected module: Ca = 2, Ce = 0). - User submits a query –
thinking-chat.tsxcaptures the input and POSTs to/api/open-researcher. - API route –
app/api/open-researcher/route.tsreceives the request and calls the exported handler inlib/open-researcher-agent.ts. This file is the second oversized component (661 LOC) and a hub for external effects: it formats the prompt, invokesfetchto Anthropic, and may calllib/utils.tsto trigger Firecrawl. - AI reasoning – Claude returns a streaming response;
thinking-chat.tsxstreams the tokens to the UI, showing the “thinking” view in real time. - Citation handling –
components/citation-tooltip.tsxrenders source links returned by the agent. - Result display –
components/search-results-display.tsx(deeply nested, max indent = 9) renders the scraped snippets beside the chat.
The import graph contains 68 internal modules and only three cross‑module edges, with zero circular dependencies, so most changes have a limited blast radius. The only modules with non‑zero instability are the page files (app/page.tsx, app/open-researcher/page.tsx), each importing a single downstream component.
How To Use It
# clone the exact repo
git clone https://github.com/moses-y/open-researcher
cd open-researcher
# install with pnpm (pnpm lockfile present)
pnpm install
# copy example env and add keys
cp .env.local.example .env.local
# edit .env.local → set ANTHROPIC_API_KEY (required)
# FIRECRAWL_API_KEY is optional; can be added via UI
# start dev server
pnpm dev # runs `next dev` as defined in package.json scripts
The server starts on http://localhost:3000. The entry point for the backend logic is app/api/open-researcher/route.ts; the front‑end entry is app/open-researcher/page.tsx.
Real‑World Use
A product team can embed the app in an internal portal to let analysts ask “What are the latest regulatory changes for GDPR?” The analyst types the query, sees Claude’s step‑by‑step reasoning, clicks citation tooltips to open the original Firecrawl‑scraped pages, and can follow up without leaving the interface.
Code Health & Issues
- High – Missing LICENSE – No
LICENSEfile; default “all rights reserved” blocks reuse. - High – No test suite – 68 source files, only one test file detected.
- High – No CI pipeline – No
.github/workflowsor other automation. - Medium – No Dependabot/Renovate – Single manifest (
package.json) but no update bot config. - Low – Missing convention files – No
.editorconfig,.gitattributes, or formatter config. - High – Deep nesting –
components/thinking-chat.tsx,lib/open-researcher-agent.ts,components/search-results-display.tsxeach have indentation depth 9, making logic hard to follow. - Medium – Duplicated UI blocks – Repeated 6‑line snippets across
components/ui/context-menu.tsx,dropdown-menu.tsx,menubar.tsx. - Medium – Oversized files –
components/ui/sidebar.tsxandlib/open-researcher-agent.tseach exceed 600 lines; splitting by responsibility is advisable.
The Bottom Line
The repo delivers a functional AI‑augmented research UI with clear separation between front‑end components and back‑end agent logic. However, the codebase suffers from deep nesting, large monolithic files, and a lack of tests, CI, and licensing. It is suitable for teams that need a quick proof‑of‑concept but will require refactoring and tooling additions before production deployment.