How Range Built an AI-Native Investment Adviser on Mastra

Range, a regulated financial company, has more than 15 Mastra agents running in prod. The flagship one, Rai, gives high-quality financial advice using the same technology that Range built for human advisers over the years.

15+

Agents in production

25

Engineers, all building agents

Range is an all-in-one AI-powered wealth management product. It offers investing, taxes, cash flow, retirement, and estate planning — the same scope of services a traditional financial adviser offers.

Rather than adding an agent on top of an existing SaaS product, the way most companies do these days, Range puts agents at the core of an SEC-registered investment adviser.

The flagship agent, Rai, is trained on Range's internal investment philosophy and benchmarked across financial advising certifications and exams, the same ones human advisers take. Rai passes those exams "with flying colors," against a roughly 70% pass rate for the typical human adviser. Users ask questions like "make me a tax plan for 2026" or "help me save on taxes," and Rai executes a tax projection using the system that Range built internally (it codified all 50 states' and federal tax codes).

Beyond Rai, Range runs separate agents for client onboarding, document parsing, internal tools for its in-house financial advisers, and support diagnostics.

Choosing workflows over agents

Range's Mastra usage goes back to the framework's early days. David's first message in Mastra's Discord was back in April 2025. "I remember having to install an alpha branch that lived in our codebase for a little bit longer than I'd like to admit, just to get things like containers working and execution context shared between different steps and different tools." says David Cusatis, co-founder and Chief AI Architect at Range.

That early exposure influenced a deliberate choice: Range overindexes on workflows rather than agents, specifically for latency. Document parsing, for example, is a fixed four-step pipeline — pre-process, classify, extract, validate — which David believes is a workflow problem, not an open-ended agent problem.

Agents come in for open-ended, non-latency-critical tasks. They are wired up to tools Range had mostly already built for its human advisers like context retrieval, financial calculations, Monte Carlo simulations, investment projections, transaction search, goal management, memory, web search, and tax scenario generation. Some of those agent runs call sub-agents, but in a guided, non-open-ended way rather than a free-form supervisor pattern.

"One of the cool things I like about Mastra's framework is agents and workflows are very composable, so you can use workflows and agents as you see fit." — David Cusatis, co-founder and Chief AI Architect

Building around compliance, reliability and observability

As an SEC-registered RIA, Range has to meet specific regulatory obligations. That requirement, plus a hard latency bar and a need to actually understand what a multi-step agent run did, influenced how the team approached Mastra from the start.

David Cusatis, co-founder and Chief AI Architect at Range, said the company had to build around three areas that are not handed to you by default:

  • Compliance: auditability of every LLM call, adherence to data-retention policy
  • Reliability: no dropped client requests, automatic multi-provider failover, fleet-wide health checks across hosts
  • Observability: per-step tracing across sub-agent executions, latency and token metrics, graceful shutdown coordination

Each became its own piece of infrastructure.

Reliability

To meet its reliability bar, Range built what it calls the Resilient Language Model. It's a circuit-breaker layer that fails requests over to a different provider or model — Anthropic's API to Bedrock, or Claude Opus 4.5 to Gemini 3.1 Pro — when the primary starts erroring or degrading.

One thing Range learned over time is that failover needs its own judgment, not just a default target. Routing everyone's traffic to the same fallback provider during an outage just moves the capacity problem, and cascades into a second outage on the fallback itself.

Observability and compliance

For observability, Range leans on Mastra's and the AI SDK's execution lifecycle hooks. It has logging for every step start/complete and tool call, plus latency, success/failure, and token metrics per step.

David says Range spent a lot of time thinking about how to measure whether or not its AI financial advice is good. One of the things it found to be very effective was post-generation analysis.

On top of that logging, Range runs a second, decoupled pipeline after every response: an LLM-as-judge step that scores the output asynchronously, outside the main Mastra workflow. It checks grounding, user sentiment, whether the user is correcting missing or wrong data, and compliance and policy checks specific to an RIA.

When it comes to compliance, David frames it as a narrower case of a more general problem: explainability. Range needs to be able to pinpoint exactly why an agent produced the response it did. It built its observability and post-generation analysis pipeline to answer that question — for regulators first, but the same infrastructure is what lets Range debug and improve its agents.

"We have over 15 agents right now running in production, and all of them have a different definition of what "good" looks like. So having a live view of those metrics, and how that's behaving in real time, has actually been very helpful." — David Cusatis, co-founder and Chief AI Architect

Everyone on Range's eng team builds agents

Range's engineering team is about 25 people, all of them building agents on what the company calls internally its "AI platform." There's no separate AI team walled off from the rest of engineering. Range has also built internal tooling that lets non-engineers ship code: PMs and designers now push code live to the product.

"At this point, all of our PMs, all of our designers — they're pushing code live to Range. It's been amazing to see." — David Cusatis, co-founder and Chief AI Architect

Start building today

Quickstart