edgar/agent
Architecture

How Edgar Agent works

Edgar Agent is a deterministic pipeline wrapped around non-deterministic models. A filing enters at one end, gets decomposed through four analytical lenses, and exits as a signed invest/pass signal with a confidence score and a critic review.

Pipeline
01Filing
02Extract
03Risk
04Growth
05History
06Financials
07Synthesis
08Proposal
09Critique
10Result

SEC EDGAR supplies 10-K filings. We chunk and embed them, then run four parallel lenses, synthesize a proposal, and have a separate critic agent review it before a final signal is emitted.

The four lenses
Risk

Extracts material risks from Item 1A. Flags concentration, leverage, legal, regulatory, and macro exposures.

Growth

Parses MD&A and business description for growth narrative, market share moves, and forward guidance.

History

Compares current filing against prior years. Surfaces changes in tone, new risks, and trend reversals.

Financials

Pulls quantitative signals from statements: margins, cash conversion, leverage, capital allocation.

How signals are generated
  1. 1
    Extraction. Filings are pulled from EDGAR and sectioned by item.
  2. 2
    Chunk + embed. Text is split into ~1k-token chunks and embedded into pgvector.
  3. 3
    Lens analysis. Each lens queries the vector store and asks the LLM for structured, typed signals (numeric or categorical) with a confidence score.
  4. 4
    Synthesis. The synthesizer agent weighs lens outputs and produces a research note.
  5. 5
    Critique. A separate critic agent scores the note for rigor and missing evidence.
  6. 6
    Signal. If the critic score clears the threshold, the note is finalized with an invest or pass signal and an aggregate confidence.
Tech stack
LangGraph
Agent orchestration
Gemini
LLM inference — research & lenses
Groq
LLM inference — low-latency critic
pgvector
Semantic search over chunked filings
Supabase
Postgres, auth, storage
Cloudflare
DDoS protection, WAF, TLS
Vercel
Frontend hosting & edge
SEC EDGAR
Filing source of record
References