02 / PROJECTAI Research Infrastructure
InvestIQ
A reviewed research pipeline, not a single model call
An equity-research system built as an explicit state graph. Research fans out into parallel analysis, a thesis is drafted, and a reviewer node can send it back — a bounded critique loop rather than one prompt and a hope.
Architecture
Retrieval
Research
Tavily search plus Yahoo Finance data, so the graph reasons over live sources.
Research → Analysis Fan-out → Investment Thesis → Reviewer → Approved / Rejected → Final Report
The problem
A single language-model call produces confident research with no mechanism for catching its own weaknesses. Quality control has to be part of the graph, not a manual step afterwards.
Engineering challenge
Getting reviewable output out of a language model, and giving the user visibility into a multi-stage process that takes time to run.
Approach
Modelled the workflow as a LangGraph.js state graph with a reviewer node and a conditional rejection edge, so a weak thesis is sent back for revision inside a bounded loop. Node transitions stream to the client over Server-Sent Events, making a slow pipeline legible while it runs.
- LangGraph.js
- Explicit state machine for agent flow — inspectable transitions instead of opaque chaining.
- Tavily
- Retrieval over live sources rather than relying on model recall.
- Server-Sent Events
- One-way streaming fits progress updates without WebSocket overhead.
- Supabase
- Persistence for report history and auth in one managed service.
Engineering detail
- 015-node LangGraph.js state graph with explicit transitions between stages
- 02Live research data retrieved through Tavily rather than model recall
- 03Yahoo Finance integration supplying quantitative market context
- 04Parallel analysis fan-out, so independent angles are evaluated concurrently
- 05Reviewer node that critiques the drafted thesis against the gathered evidence
- 06Bounded critique loop — revision is capped, so the graph always terminates
- 07Conditional rejection edge that routes a failed thesis back for revision
- 08Server-Sent Events streaming each node transition to the client as it happens
- 09Persistent report history in Supabase
Engineering practices
- Critique loop is bounded — the graph is guaranteed to terminate.
- Retrieval is separated from synthesis, so sources stay attributable.
- Streamed transitions make long-running work observable.
Features
- Five-stage reviewed research graph.
- Parallel analysis fan-out.
- Live streaming of graph progress.
- Persistent report history.