Work project · Multi-agent platform

Agent Builder

Research agents for a financial research firm

TypeScriptMastraClaudeVercel AI SDKMCPNestJSReactlibSQLDocker

Why I built it

Analysts at a financial research firm spend earnings season on work that follows the same steps every time. They watch the calendar of earnings events, cross-reference their own reports, write a daily digest, and after every expert call they write the call up as anecdotes in the firm's house style.

The goal was agents that do the repetitive part and leave the judgment to the analysts: everything arrives as a draft, and a person checks it and sends it.

What it does

How it works

A React front end talks to a NestJS gateway, which forwards to a Mastra agent service. The earnings sweep dedupes events with single-purpose LLM calls and sends small research agents for consensus figures and price anchors. Code then builds the digest, updates the calendar and creates the drafts, and records what it did so the next run doesn't repeat it.

The Zoom webhook is verified with a constant-time signature check and answered at once. The slow work goes to a queue, where a background worker runs the anecdote passes: KPI selection, synthesis, a lint and rewrite pass, a completeness check, and sentiment. A larger Claude model does the synthesis and smaller ones do the rest.

The base prompts never change, so they stay cached, and learned house rules are appended after them. MCP tools are mapped to fixed names, so the model never sees each server's raw tool names. Per-user Google tokens are encrypted at rest with AES-256-GCM.

Why build agents when ChatGPT or Copilot already exist?

A chat assistant answers when someone asks it something. This work has to start on its own, on a schedule and whenever a call ends. It has to read the firm's own sources, follow its house style, and land in its Gmail and calendar as drafts for a person to check.

That takes code around the model: the workflow, the state, deduplication and templates. The model is used only for the steps that need judgment, like choosing which KPIs a call touched and writing the synthesis. Everything else is ordinary code that does the same thing every time.

Why rebuild an anecdote pipeline the firm already had?

Rebuilding it on Mastra put it in the same system as the other agents. It gained the review queue, editable channels, monitoring and evals, and an editor agent that learns house rules from analysts' edits, with a person approving each rule.

Where it stands

Packaged with Docker for the firm's team. Sign-in through the Centralised Auth Service is built on a branch.