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.

Year
2026
Status
Building
Technology
Next.js · TypeScript · LangGraph.js · Google Gemini · Tavily · Supabase · SSE
01 / SYSTEM MAP

Architecture

AI Research Infrastructure / flow6 stages

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

02 / CONTEXT

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.

03 / DESIGN DECISION

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.
04 / IMPLEMENTATION

Engineering detail

  1. 015-node LangGraph.js state graph with explicit transitions between stages
  2. 02Live research data retrieved through Tavily rather than model recall
  3. 03Yahoo Finance integration supplying quantitative market context
  4. 04Parallel analysis fan-out, so independent angles are evaluated concurrently
  5. 05Reviewer node that critiques the drafted thesis against the gathered evidence
  6. 06Bounded critique loop — revision is capped, so the graph always terminates
  7. 07Conditional rejection edge that routes a failed thesis back for revision
  8. 08Server-Sent Events streaming each node transition to the client as it happens
  9. 09Persistent report history in Supabase
05 / OPERATING PRINCIPLES

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.
06 / CAPABILITIES

Features

  • Five-stage reviewed research graph.
  • Parallel analysis fan-out.
  • Live streaming of graph progress.
  • Persistent report history.