Skip to content

ShikeChen01/DeepScrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepScrap

Agent-powered deep research tool that produces institutional-quality investment research reports on publicly traded companies.

DeepScrap uses a multi-agent architecture with a Synthesis-driven feedback loop to produce comprehensive LaTeX-to-PDF reports — covering forensic due diligence, rigorous valuation, and forward-looking catalyst analysis — all from a single CLI command.

Sample Output

SMCI Report (PDF) — Super Micro Computer deep-dive generated with --depth medium (3 research rounds)

The report covers 13 sections including executive summary, financial deep dive, valuation analysis, forensic red flag analysis, bull/bear cases, and a confidence assessment with per-section breakdowns.

Python 3.11+ Multi-model LaTeX PDF

Features

  • Multi-agent research — 6 parallel research agents gather data from SEC filings, financial APIs, web search, and insider trading databases
  • Synthesis-driven feedback loop — Opus evaluates coverage gaps and directs follow-up research across multiple rounds
  • Adversarial review — GPT independently challenges the analysis for blind spots before finalizing
  • 12-section reports — Executive summary, financials, valuation (comps/DCF/SOTP), forensic analysis, bull/bear cases, risk matrix, catalyst timeline, and confidence scoring
  • LaTeX PDF output — Professional typeset reports with charts, hyperlinked references, and a numbered bibliography
  • Configurable depth — From quick screening (shallow, 1 round) to full forensic deep-dives (deep, up to 10 rounds)
  • Resume support — Interrupted runs can be resumed from saved research state
  • Budget controls — Set a max spend to cap API costs

Installation

Requires Python 3.11+ and a LaTeX distribution (pdflatex on PATH).

pip install -e ".[dev]"

Configuration

Set API keys via environment variables or a .env file in the project root:

ANTHROPIC_API_KEY=sk-ant-...   # Required — powers research + synthesis agents
OPENAI_API_KEY=sk-...          # Required — powers adversarial reviewer
SERPER_API_KEY=...             # Optional — enables web/news search (via serper.dev)

Usage

deepscrap analyze <TICKER> [OPTIONS]

Examples

# Quick screening
deepscrap analyze AAPL --depth shallow

# Standard analysis (default)
deepscrap analyze AAPL --depth medium

# Full forensic deep-dive with verbose logging
deepscrap analyze AAPL --depth deep --verbose

# Set a spend limit
deepscrap analyze TSLA --depth deep --budget 5.00

# Resume an interrupted run
deepscrap analyze AAPL --depth medium --resume

# Custom output location
deepscrap analyze NVDA --output ./reports/NVDA/report.pdf

Options

Flag Default Description
--depth medium Research depth: shallow, medium, or deep
--output None Output PDF path (default: output/<TICKER>/report/)
--budget None Max estimated spend in USD (no limit by default)
--max-iterations None Override max research rounds (default: 1/3/10 by depth)
--resume False Resume a previously interrupted run from saved store
--verbose False Show agent activity and debug logging
--focus None Comma-separated focus areas

Depth Levels

Depth Max Rounds Claude Effort Use Case
shallow 1 medium Quick overview, screening
medium 3 high Standard research report
deep 10 max Full forensic deep-dive

Architecture

CLI (typer)
 └─ Orchestrator
     ├─ Research Agents x6 (Sonnet) ── parallel data gathering
     │   └─ Source Registry
     │       ├─ Yahoo Finance   (financials, price, estimates, company info)
     │       ├─ SEC EDGAR       (10-K, 10-Q, DEF 14A, insider filings)
     │       ├─ Serper.dev      (web search, news search)
     │       └─ OpenInsider     (insider trading activity)
     ├─ Synthesis Agent (Opus) ── evaluates coverage, directs research, writes analysis
     └─ Adversarial Reviewer (GPT) ── challenges findings for blind spots

How It Works

  1. Dispatch — 6 research agents run in parallel with targeted directives: company overview, financials, valuation, executive/insider analysis, forward-looking catalysts, and industry/sentiment.

  2. Iterate — The Synthesis agent (Opus) evaluates collected data against a coverage map, identifies gaps, and issues targeted follow-up directives to specific agents. This loop continues until coverage is sufficient or the depth limit is reached.

  3. Synthesize — Opus produces a 12-section qualitative-first analysis from all collected research data.

  4. Challenge — GPT adversarially reviews the analysis, probing for blind spots and weak arguments. Synthesis revises or rebuts, with up to 2 escalation rounds for unresolved issues.

  5. Report — Jinja2 LaTeX templates and matplotlib charts are compiled to a typeset PDF via pdflatex, with auto-generated bibliography and hyperlinked source references.

Report Sections

  1. Executive Summary
  2. Business Analysis
  3. Financial Deep Dive (accounting quality, red flags)
  4. Valuation Analysis (comps, DCF, sum-of-parts, pricing verdict)
  5. Leadership Assessment
  6. Forensic & Red Flag Analysis (related-party deals, suspicious M&A, SEC inquiries)
  7. Bull Case
  8. Bear Case
  9. Risk Matrix
  10. Forward-Looking Analysis (earnings preview, catalyst timeline)
  11. Conclusion
  12. Confidence Assessment (per-section breakdown, evidence gaps, source quality)

LLM Routing

Role Model Purpose
Research Agents Claude Sonnet Data gathering and source queries
Synthesis Agent Claude Opus Coverage evaluation and final analysis
Adversarial Reviewer GPT (OpenAI) Independent challenge of findings
Orchestrator Claude Sonnet Pipeline coordination

Output Structure

output/<TICKER>/
├── report/
│   ├── <TICKER>_report.pdf    # Final typeset report
│   └── <TICKER>_report.tex    # LaTeX source
├── references/                 # Downloaded SEC filings
└── <TICKER>_store.json        # Research data (resumable)

Development

# Run all tests
pytest tests/ -v

# Run a single test
pytest tests/path/test_file.py::TestClass::test_name -v

License

Proprietary.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors