No Priors: Artificial Intelligence | Technology | Startups

Scaling Legal AI and Building Next-Generation Law Firms with Harvey Co-Founder and President Gabe Pereyra

12/5/2025
HARVEY

The Context

Building the IDE for Law

Moving past the pleasantries, the conversation immediately anchors on the scale and purpose of Harvey. Co-founder Gabe Pereyra defines the company not merely as a wrapper for LLMs, but as a specialized infrastructure layer for the legal industry—now serving over 1,000 customers with a team of 500.

Scale

1,000+

Enterprise Customers

500

Employees

Why not just use ChatGPT?

"The intuition at the time was just give the model to lawyers... and you ran into all the sharp edges. They hallucinate. They aren't connected to context."

Phase 1 Model Access
Phase 2 Individual IDE
Current Firm-Wide Orchestration

The "Codebase" of Law

Analogy

To explain why legal AI is difficult, Pereyra draws a parallel between a complex legal matter and a software codebase. Just as developers need tools to navigate millions of lines of code, lawyers need tools to navigate the unstructured "spaghetti code" of contracts.

Using Private Equity Fund Formation as the prime example, he illustrates that legal work isn't just reading a single document—it's managing a massive state machine of sovereign wealth requirements, tax implications, and side letters.

The Fund Formation Workflow

01
Structure Entity Tax implications & Sovereignty
02
Draft LP Agreement The "Core" 100+ page logic
03
Manage Side Letters 100s of exceptions modifying the core
04
Investment Execution Data rooms, revenue verification

"The reason legal is so difficult is the workflows aren't structured..."

Next: How do we turn this unstructured chaos into Agentic Workflows?

Continuity

Having mapped the intricate web of legal workflows, the question becomes: who—or what—navigates them? We move from static processes to dynamic execution, exploring the rise of "Agentic AI."

The Associate
Is An Agent.

The distinction between a junior lawyer and an AI agent is blurring. Both receive high-level intent, deconstruct logic trees, and execute loops of research, summarization, and drafting.

Key Insight "Winston went in his room for 14 hours and just redid a bunch of his associate tasks."

The "Hacky Agentic" Workflow

1

Receive high-level case strategy from Partner.

2

Deconstruct logic tree: What actions are needed?

3

Execute Loop: Lookup Case Law → Summarize → Draft Memo.

*This mirrors the exact cognitive process of a human associate handling a client matter.

Structural Shift

The Leverage Ratio Problem

Law firms are pyramids: many associates, few partners. If AI reduces the need for 100 associates to 50, how do you find the future partners?

"Can we go and sit with the fund formation group... and start thinking about workflows, staffing, pricing?"

The Old Way (Painful)

"Stuck all the time." Fear of asking questions. Learning by slow osmosis. The "Stack Overflow" era of struggle.

The AI Way (Accelerated)

"Generate this merger agreement. Why did we structure it that way?" Instant feedback loops allow lawyers to learn strategy faster than ever before.

What Doesn't Change?

Strategy & Abstraction

Defining the high-level approach remains a deeply human, senior-level task.

Client Connection

Sales, trust, and the "handshake" cannot be delegated to an agent.

Pattern Recognition

Years of experience provide intuition that models currently only mimic, not embody.

Coming Up

The Engine Beneath: Reinforcement Learning

Continuing the Thread

If the future law firm is evolving into an agentic system, the critical question becomes: how do we teach an AI not just to read the law, but to think like a master strategist?

The Reasoning Trace:
Modeling the Senior Partner

Public models see the final contract (the output), but they miss the thousands of micro-decisions, risk assessments, and structural arguments that produced it. To build true legal intelligence, we must capture the invisible logic of the "Distinguished Engineer" of law.

The Moody Analogy

Gordon Moody
(Wachtell)
Distinguished
Engineer (Google)

"He has the whole picture of this legal entity in his head... he can point out, 'hey, if you build this system this way at this scale, it's gonna collapse'."

The Hidden Dataset

The challenge with training RL (Reinforcement Learning) models on law is that public data—like SEC filings—is just the compiled binary. It lacks the source code. The real value lies in the "Reasoning Trace": the emails, the drafts, and the senior partner's guidance that structured the deal to avoid non-intuitive collapse years down the line.

The Verification Gap

In coding, RL scales because unit tests are binary: Pass/Fail.
In law, verification is ambiguous. The only "unit test" for a complex merger agreement is a senior partner saying, "Yeah, this looks pretty good," or the absence of litigation three years later.

Training Complexity: Code vs. Law

Comparing the dimensions of training RL models in different domains.

01

Short-Term Verification

Software: Unit tests run instantly.
Legal: Senior partner review (human-in-the-loop). This bottleneck defines the current limit of "Legal RL."

02

Long-Term Reality

Software: System stability over 6 months of user traffic.
Legal: Did the merged entities face unexpected litigation 3 years later? The ultimate test is reality itself.

Since verification relies so heavily on specific institutional knowledge...

Next: Deploying Harvey and The Need for Customization

Refining the Intelligence...

While Reinforcement Learning refines the model's legal mind, the challenge shifts to the physical infrastructure of the legal world. Moving from "what the model knows" to "how the model lives" within the chaotic IT environments of the Fortune 500 requires a shift from pure research to Forward Deployed Engineering.

The Enterprise
Playbook.

It’s not just an API call. It’s an ecosystem. Harvey isn't trying to be Palantir—building custom code from scratch—but they are embracing the Oracle/IBM heritage of bespoke implementation.

The Deployment Model

"We are not a full Palantir... going into the codebase to build custom software. This is closer to Sierra's agent engineering program."

Target: High-Touch Integration

Standardization Gap

Why Forward Deployed Engineering is critical: Law firms are standardized; Fortune 500s are chaotic.

"Law firms are starting to do this for their in-house clients... 'Buy Harvey, and we'll help you build the workflows.'"
— The new agency model

A fascinating secondary effect is emerging: Law firms as software integrators.

Large firms like Allen & Overy aren't just using the tool; they are becoming the implementation layer for their clients. In-house legal teams at smaller companies lack the budget for custom engineering, so big law firms step in to bridge the gap—turning legal service providers into tech service providers.

The Atrium Trap

Why Harvey stays pure tech

The Conflict

"You're building two different companies." Trying to scale high-end legal services clashes with the velocity required to scale software engineering.

The Conflict of Interest

If Harvey became a firm, they would be conflicted out of working with every other firm. "We can’t scale if we compete with our customers."

The Goal

The mission isn't to replace the law firm. It is to make every law firm an AI-first entity. The total addressable market of "everyone" beats "us vs. them."

Segment Analysis

Up Next

Scaling this vision brings its own friction. We move from deployment strategy to the existential challenges of the Legal Tech landscape.

Continuing the Narrative

Having established how Harvey penetrates the enterprise through customization and adoption, the conversation shifts to the sheer magnitude of the arena. It isn't just about modernizing law firms; it is about rewiring the global infrastructure of professional services.

The Trillion-Dollar
Complexity Problem

Why building for "Legal" is actually a Trojan Horse for the entire professional services economy.

The Microsoft-Activision Paradox

The scope of the problem is often invisible until you look at the edges. A massive M&A deal involving two global giants isn't just handled by one firm. It involves hundreds of outside counsels.

"You know why? Because in New Zealand, where both companies have customers, you have a tax implication, and the dude who understands that lives in New Zealand."

The realization? You cannot coalesce all that expertise into a single firm. The only solution is a platform that allows disparate professional service providers to collaborate securely.

Market Expansion

Estimated Total Addressable Market (TAM) in Trillions USD

"Legal is a trillion. Professional services is something like three to five trillion."

Research vs. Scale

Transitioning from an AI researcher at Meta to a founder required a total reconstruction of mental models.


The Shift Moving from individual contributor optimizing algorithms to architecting a system where 500 people can build products for an industry defined by extreme complexity and security requirements.

Conviction Before Consensus

While coding assistants like Cursor emerged after the models matured, Harvey started 3.5 years ago. The conviction came from an intuition that "Text In, Text Out" workflows in law were identical to the capabilities emerging in research labs.

The Insight:

"If you built a product that just checked for bugs, you wouldn't have built Cursor. The intuition was these models can help you do any task."

Scaling the Machine

With the market opportunity defined as a multi-trillion dollar landscape and the product intuition validated, the constraint moves from strategy to execution. How do you scale a team from an Airbnb to 500 people to service this complexity? Coming up next: Hiring philosophy and the future of the firm.

Continuing from the architectural challenges of building during the Gen AI boom...

From Product-Market Fit to Hyper-Scale.

With the technical foundation laid, the focus shifts to the human machinery required to sustain 250x growth, and a prediction on how AI moves from "individual copilots" to "organizational nervous systems."

The Talent Sprint

2 500

Employee Growth (3.5 Years)


Current Critical Needs:

  • NYC Site Leads
  • Frontend Scaling Experts
  • AI Research Engineers
"
"My bed frame broke when we moved to SF. For a year and a half, I just slept on the mattress on the floor... I physically couldn't do anything except the company."
— Gabriel Pereyra on the "Startup Founder Mode"

The Contrarian Prediction

Beyond Individual Productivity

We are leaving the era of the "Copilot" (individual speed) and entering the era of Organizational Scaling.

Just as the internet allowed law firms to grow 10x in headcount, AI will act as the infrastructure to scale professional service firms by another order of magnitude. It is not about coding 20% faster; it is about building the system that allows the organization to ship 20% faster.

The "Figma Moment" for Law

"It's the transition from the individual designer to the collaborative design team."

The challenge isn't building the AI; it's re-architecting the human workflows to adopt it.

Culture Check:

Founders capable of 15+ pull-ups per set. | Preferred distraction: Erewhon Smoothie TikTok reviews.

"People don't appreciate how much better these models are going to get."

Next: Wrapping up the discussion and final thoughts.

From Predictions to Verdict

Having mapped out the aggressive hiring roadmap at Harvey and speculated on where the technology will take the legal profession next, we arrive at the final takeaway. The future isn't just about the tools—it's about the hands that wield them.

The Final
Argument.

Innovation in legal tech is no longer a hypothetical debate. It is an operational reality defined by talent, speed, and precision.

Episode Recap

  • 01

    Scaling technical talent is the primary bottleneck for Harvey.

  • 02

    Future moats will be built on proprietary data, not just wrapper models.

  • 03

    The intersection of Law and AI requires a new breed of operator.

Signing off...

Related Episodes