guy-hartstein/company-research-agent

An agentic company research tool powered by LangGraph and Tavily that conducts deep diligence on companies using a multi-agent framework. It leverages OpenRouter on the backend for rapid inference with any leading model.

Company Research Agent – What it is

A small web app that lets you type a company name and get a structured, source‑backed briefing (business overview, industry context, recent news, etc.). The heavy lifting is done by a FastAPI backend that orchestrates a research graph of LLM‑driven steps and a Tavily web‑search/relevance service. The React + Vite front‑end streams progress to the browser and can export the final markdown report as a PDF.


Core capabilities

Feature How it works
Automated research Sends queries to Tavily, scores relevance, and collects URLs.
LLM‑driven synthesis Uses any model reachable via OpenRouter (or direct OpenAI/Gemini keys) to generate search prompts, summarize sources, and write the final briefing.
Live streaming The UI receives server‑sent events from GET /research/{job_id}/stream so you see the job progress in real time.
PDF export The backend converts the markdown report to PDF via POST /generate-pdf.
Optional persistence If a MongoDB URI is supplied, jobs and reports are stored for later retrieval.
Model flexibility Pick a model in the Settings UI; the same model is used for every step of the pipeline.

Architecture at a glance

React + Vite (frontend)  ←→  FastAPI (backend)
        │                     │
        └─ POST /research ──►  Research graph
                               ├─ analyzers
                               ├─ collector (Tavily)
                               ├─ curator (relevance scoring)
                               ├─ briefing (LLM synthesis)
                               └─ editor (final markdown)

The backend talks to:

  • Tavily – web search and relevance ranking.
  • LLM – any model on OpenRouter, or OpenAI/Gemini directly, for prompt generation, summarisation, and editing.
  • MongoDB (optional) – job/report storage.

Getting started (local development)

  1. Backend – Python 3.11+, create a venv, install requirements.txt, copy .env.example → .env and fill in your OpenRouter/Tavily keys (MongoDB optional).
  2. Frontend – copy ui/.env.development.example → ui/.env.development.local, set VITE_API_URL to http://localhost:8000, install npm deps.
  3. Run –
    • uvicorn application:app --reload --port 8000 (API)
    • npm run dev inside ui (UI) → open http://localhost:5174.
  4. Docker – after the same .env files exist, docker compose up --build brings up both services.

Typical workflow

curl -X POST http://localhost:8000/research \
  -H 'Content-Type: application/json' \
  -d '{"company":"Tavily","company_url":"https://tavily.com","industry":"AI search","hq_location":"New York, USA","model":"anthropic/claude-sonnet-5.5"}'
  • The response gives a job_id.
  • The UI (or a GET …/stream request) streams progress events.
  • When finished, GET /research/{job_id}/report returns the markdown; POST /generate-pdf creates a downloadable PDF.

Who might use it?

  • Investors or analysts needing quick, sourced overviews of target companies.
  • Business development teams scouting partners or competitors.
  • Students or journalists who want a reproducible briefing without manual web‑search.
  • Developers looking for a template to build other LLM‑orchestrated research agents.

Limitations & considerations

  • API‑key dependent – you must supply a working OpenRouter (or OpenAI/Gemini) key and a Tavily key; without them the service cannot run.
  • Source quality – the relevance scoring is heuristic; the final report reflects whatever the LLM synthesises from the retrieved pages.
  • Persistence optional – without MongoDB each job lives only in memory for the current server run.
  • Model cost – using large models via OpenRouter can be expensive; choose a model that balances price and quality.

License

Apache License 2.0 – free to use, modify, and distribute.

Related

  • Project
  • Project
  • Project
  • Project
  • Project