How Bridgewater Built an AI Analyst That Does Hours of Expert Research in Minutes

How Bridgewater Built an AI Analyst That Does Hours of Expert Research in Minutes — LangChain

LangChain

AI-assisted summary of How Bridgewater Built an AI Analyst That Does Hours of Expert Research in Minutes — original source. Check the original for full context.

Source published:

Key ideas

  • Bridgewater built the Pocket Analyst Tool (PAT) on top of 50 years of codified, machine-readable economic logic, giving their models immediate access to deep domain frameworks without retroactively writing context. (0:06)
  • Embedding human-like inspection heuristics (frequency, currency, economic priors) into time series search increased retrieval accuracy from roughly 50% to 90% across tens of millions of series. (10:24)
  • By treating natural language research plans as strict schema contracts, PAT generates code for discrete DataFrame tasks in parallel, decoupling generation time so 20-task plans complete in the same wall-clock time as 3-task plans. (13:15)
  • An automated 'Teach' button allows investors to flag omissions or steering issues, autonomously creating failing benchmark tests, iterating on internal context, verifying against a global regression suite, and submitting automated pull requests. (15:24)
  • Engineering agentic code generation like an optimizing compiler—using DAG validation layers and static analysis caching—prevents redundant queries and makes iterative downstream revisions nearly instantaneous. (18:08)

Detailed notes

## Background Published by LangChain on YouTube on July 24, 2026, this presentation features Brendan McManus, Michael Ran, and Santi Weight from Bridgewater Associates' applied AI team. The video details how the firm developed the Pocket Analyst Tool (PAT), an internal AI analyst deployed to hundreds of investors that leverages 50 years of codified investment logic to compress hours of deep exploratory research into minutes.

## TL;DR Bridgewater Associates showcases PAT (Pocket Analyst Tool), an internal agentic AI system engineered to automate complex macroeconomic exploratory research. Grounded in five decades of systematically written-down investment principles and proprietary time-series data, PAT operates through a strict separation between a LangGraph-powered chat interface and a deterministic Python coding engine. Rather than relying on open-ended code generation, PAT treats research plans as compiler source code, executing parallel LLM code generation, DAG-enforced validation layers, and static analysis caching that decouples wall-clock latency from analysis complexity. The platform also integrates an autonomous self-healing flywheel, known as the 'Teach' button, which transforms investor feedback into failing regression benchmarks and automated GitHub pull requests.

## Atmosphere & style The presentation carries the polished, analytical rigor of systematic finance merged with modern compiler theory and software engineering. Moving seamlessly between strategic rationale, live product demonstrations, and deep architectural diagrams, the speakers project measured authority rather than Silicon Valley hype. It feels like an inside look into a high-stakes institutional engineering laboratory where every design decision—from hard-coded validation guardrails to per-user security harnesses—is deliberately calibrated to eliminate 'vibe-coded' hallucinations when billions of dollars are on the line.

## Bulletin - [00:06](https://www.youtube.com/watch?v=lXZb21CfeIY&t=6s) Bridgewater built the Pocket Analyst Tool (PAT) on top of 50 years of codified, machine-readable economic logic, giving their models immediate access to deep domain frameworks without retroactively writing context. - [10:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=624s) Embedding human-like inspection heuristics (frequency, currency, economic priors) into time series search increased retrieval accuracy from roughly 50% to 90% across tens of millions of series. - [13:15](https://www.youtube.com/watch?v=lXZb21CfeIY&t=795s) By treating natural language research plans as strict schema contracts, PAT generates code for discrete DataFrame tasks in parallel, decoupling generation time so 20-task plans complete in the same wall-clock time as 3-task plans. - [15:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=924s) An automated 'Teach' button allows investors to flag omissions or steering issues, autonomously creating failing benchmark tests, iterating on internal context, verifying against a global regression suite, and submitting automated pull requests. - [18:08](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1088s) Engineering agentic code generation like an optimizing compiler—using DAG validation layers and static analysis caching—prevents redundant queries and makes iterative downstream revisions nearly instantaneous.

## Key takeaways - [00:06](https://www.youtube.com/watch?v=lXZb21CfeIY&t=6s) Bridgewater's half-century discipline of recording causal investment rules on paper created a human- and machine-readable expert system that eliminated the need to retroactively author foundational domain context for AI agents. - [02:22](https://www.youtube.com/watch?v=lXZb21CfeIY&t=142s) PAT focuses strictly on deep exploratory research and analytical investigation within the firm's broader 'research circle' roadmap, deliberately avoiding automated trade execution or order routing. - [06:56](https://www.youtube.com/watch?v=lXZb21CfeIY&t=416s) Development pods were structured as internal high-velocity startups combining a multi-archetype triad of domain investors, systems technologists, and quantitative scientists. - [09:21](https://www.youtube.com/watch?v=lXZb21CfeIY&t=561s) To prevent proprietary investment IP from leaking across roles, Bridgewater rejected generic single-harness designs in favor of dynamically instantiating a custom PAT harness mirroring each user's exact permissions and data access. - [10:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=624s) Searching massive financial time series databases requires human-like inspection heuristics—such as currency denomination, frequency, and alignment with economic priors—raising accuracy from 50% to 90% over standard semantic search. - [12:01](https://www.youtube.com/watch?v=lXZb21CfeIY&t=721s) In PAT's architecture, 'the plan is the analysis': interactive clarifying questions establish exhaustive DataFrame schemas and dependency graphs before any code is generated. - [13:15](https://www.youtube.com/watch?v=lXZb21CfeIY&t=795s) Schema-driven planning allows parallel sub-agents to generate code concurrently, matching generation wall-clock time between 3-task and 30-task analyses and running roughly 4x faster than sequential agents like Claude Code. - [13:47](https://www.youtube.com/watch?v=lXZb21CfeIY&t=827s) Successful analytical outputs write directly back into Bridgewater's central time series database, enabling compounding reuse across future human and agent research workflows. - [14:27](https://www.youtube.com/watch?v=lXZb21CfeIY&t=867s) Before presenting findings, PAT runs an automated self-correction loop that validates charts and tables against internal visual and economic standards. - [15:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=924s) The in-app 'Teach' button triggers an autonomous background CI/CD workflow that synthesizes failing benchmarks, iterates on prompts or context, runs regression suites, and opens pull requests via Slack. - [16:48](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1008s) Financial code generation requires abandoning unpredictable 'vibe-coding' in favor of treating prompts and plans as source code to be deterministically translated through compiler-like stages. - [17:59](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1079s) LangGraph powers the conversational front-end to provide persistent state, cancellations, and continuations, while deliberately abstracting code generation away from macro investors as a pure implementation detail. - [20:04](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1204s) Deterministic task contracts allow down-funnel tasks like visualization to know exact DataFrame shapes and types before upstream data-fetching code is written or executed. - [21:13](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1273s) Correctness is enforced through deterministic architecture rather than agentic orchestration loops, using static analysis to build task DAGs and running parallel validation layers. - [23:10](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1390s) A custom execution engine injects caching annotations across functions via static analysis, enabling near-instantaneous execution during iterative downstream edits. - [24:25](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1465s) Enterprise AI success relies on building highly specialized agents benchmarked on narrow workflows and designed using traditional compiler principles rather than relying on generic, open-ended autonomous agents.

## Detailed walkthrough ### [00:06](https://www.youtube.com/watch?v=lXZb21CfeIY&t=6s) The 1980 Legal Pad and Bridgewater's 50-Year Foundation for AI

Brendan McManus, team lead of the applied AI team at systematic macro hedge fund Bridgewater Associates, opens by introducing the Pocket Analyst Tool (PAT) alongside his colleagues Michael Ran (investor lead) and Santi Weight (technical lead). McManus has spent nearly a decade at Bridgewater, evolving from a software engineer into a systematic investor and researcher before focusing on bridging the divide between investing and technology. PAT was engineered to act as an internal AI analyst capable of compressing hours of rigorous research into minutes for hundreds of active internal investors while continuously learning from every interaction. Rather than presenting a speculative prototype, McManus emphasizes that PAT's technical viability rests directly on Bridgewater's half-century history of methodically encoding economic principles into compounding, systematic architectures.

This tradition dates back to Bridgewater's original 1980 bond system, originally drafted by hand on a yellow legal pad. The operating principle was straightforward: whenever an investor wanted to execute a trade, they had to record the precise causal logic and decision rules justifying it. Putting those rules on paper allowed other investors to critique the reasoning, identify flaws, and suggest structural improvements. Over five decades, this routine of crossing out invalidated hypotheses and inscribing updated rules created an expansive, human- and machine-readable expert system. As McManus observes, this deliberate discipline positioned the firm uniquely for modern generative AI: “We didn't have to go back and write down everything for agents.” Decades of institutional investment intuition were already formalized and structured for retrieval.

- **Bridgewater's Institutional Lineage**: 50 years of capturing market and economic rules within compounding, machine-readable expert systems. - **The Core Practice**: Forcing investors to document their precise causal hypotheses before trading so their logic could be systematically audited and iterated. - **AI Readiness**: Decades of structured data, methodology documentation, and formalized investment rules eliminated the need to retroactively author foundational domain context for agents.

---

[02:22](https://www.youtube.com/watch?v=lXZb21CfeIY&t=142s) The Artificial Investor Roadmap and the Research Circle

Bridgewater approaches modern AI from two distinct vantage points: as macro investors and as technology practitioners. As macro investors, understanding AI dynamics is table stakes—the firm analyzes the capital expenditure buildout, hardware supply-and-demand imbalances, and their second-order ramifications on global markets in the same way it navigated the COVID-19 pandemic or historical oil shocks. As practitioners, however, the firm applies agentic AI across every phase of its investment workflows. The explicit endgame is ambitious: creating a comprehensive "artificial investor" capable of replicating the full operational scope of human analysts.

To build an artificial investor, Bridgewater deconstructs its analytical routine into an iterative "research circle." Human investors continuously observe real-world market signals, formulate hypotheses about what is true or overlooked, conduct rigorous analytical investigations, synthesize findings, and store newly derived insights back into the firm's shared memory. Bridgewater mirrors this loop through specialized sub-agents tailored to each stage, but McManus clarifies that PAT addresses one specific, labor-intensive bottleneck: the deep analytical investigation phase that historically consumed days or weeks of analyst time. Crucially, PAT is not an automated execution bot. As McManus clarifies: “PAT is not about how we trade.” Instead, it acts as an exploratory research partner, unlocking analytical pathways that investors previously lacked the bandwidth to investigate.

```mermaid flowchart TD accTitle: The Bridgewater Research Circle accDescr: An iterative research loop showing perception, hypothesis formulation, deep investigation with PAT, synthesis, and shared memory updating. subgraph Circle["The Research Circle"] P["Perception of World"] --> Q["Formulate Questions"] Q --> I["Analytical Investigation (PAT)"] I --> S["Synthesize Findings"] S --> M["Shared Memory & Expert Systems"] M --> P end ```

- **Two Roles for AI**: Macro assessment of market-wide AI capital expenditure impacts versus operational practitioner deployment across research workflows. - **The Research Circle Loop**: Continuous progression from perception to question formulation, analytical investigation, synthesis, and shared memory feedback. - **Scope Boundary**: PAT handles deep analytical exploratory research rather than automated trade execution or order routing.

---

[04:44](https://www.youtube.com/watch?v=lXZb21CfeIY&t=284s) The Product Spec for PAT and the Continuous Improvement Flywheel

The engineering specification for PAT required matching every core workflow executed by human analysts. First, PAT requires comprehensive data access: it must query and interpret structured time-series data (such as multi-decade equity prices) alongside unstructured qualitative material, including external broker-dealer research notes and internal investment memos. Second, PAT must interface with Bridgewater’s proprietary internal toolsets for visualization, data diagnostics, and indicator validation. Third, because human-grade analyses are deeply layered, PAT’s execution must be fully transparent and diagnosable—structured so that both human investors and background auditor agents can inspect execution traces to verify calculations and intermediate steps.

Beyond data and tools, PAT leverages Bridgewater's 50 years of codified investment logic, giving the model deep contextual familiarity with internal frameworks and standards of proof. Most critically, PAT is architected to learn systematically across the entire organization rather than operating in an isolated per-user vacuum. Having been deployed internally several months prior, hundreds of Bridgewater investors now run real-world research queries through PAT daily. An autonomous background evaluation harness continuously parses these operational traces, flags computational or reasoning errors, produces human-audited evaluation benchmarks, and feeds revisions back into prompt context and tool harnesses. This dynamic creates a firm-wide flywheel where a failure encountered by a single analyst drives automated architectural fixes that enhance performance for every user.

- **Data Modalities Handled**: Long-horizon structured market time series, subscription-based broker-dealer reports, and internal qualitative memos. - **Tooling Integrations**: Direct access to internal Bridgewater diagnostic engines, charting modules, and quantitative indicator testing environments. - **Diagnosability Mandate**: Execution traces are structured for automated background agents and human investors to inspect intermediate mathematical operations. - **Scale and Adoption**: Deployed internally to hundreds of investment professionals who generate real-world operational feedback loops daily.

---

[06:56](https://www.youtube.com/watch?v=lXZb21CfeIY&t=416s) Multi-Archetype Teams and Launching the Live Research Demo

Addressing the common question of how a 50-year-old traditional hedge fund built a high-velocity AI system, McManus explains that the initiative required disrupting internal norms. Bridgewater incubated the applied AI unit as an internal startup, affording it the operational speed and agility of an early-stage company while retaining access to institutional data and infrastructure. Central to this model was assembling cross-functional, "multi-archetype" pods where investors, software engineers, and research scientists work side by side. As McManus puts it: “Investors bring the context and the domain-specific expertise. Technologists bring the architectural capability. And scientists bring the rigor.” This triad ensures the resulting tools satisfy expert users who immediately detect superficial hallucinations.

McManus hands off the presentation to investor lead Michael Ran, who spent five years at Bridgewater moving between engineering and macro research. Ran opens the live demo directly on PAT's internal landing interface. To demonstrate PAT’s depth on a complex macro question, Ran submits an unconstrained research prompt: investigating how global financial markets responded to recent Middle Eastern conflicts, comparing those reactions to historical oil supply shocks, and producing comparative data visualizations illustrating the similarities and divergences across historical macroeconomic regimes.

- **Incubation Structure**: An autonomous internal applied AI startup operating with high velocity inside Bridgewater’s broader corporate umbrella. - **Multi-Archetype Triad**: Direct pairing of domain-expert investors, systems technologists, and quantitative scientists within the same development pod. - **Michael Ran's Background**: Five years at Bridgewater, beginning in engineering before transitioning into macro research and AI process infusion. - **Demo Prompt Objective**: Analyze market impacts of recent Middle East conflicts, map them against historical oil supply shocks, and render comparative charts.

[09:21](https://www.youtube.com/watch?v=lXZb21CfeIY&t=561s) The Per-User Security Problem: Custom Harnesses for Every Investor

Before submitting a live research prompt addressing oil supply shocks and Middle Eastern conflict dynamics that Bridgewater has been studying, Michael Ran pauses to unpack a fundamental architectural and security challenge the team encountered when designing PAT's harness. To provide meaningful leverage, an AI research assistant must have access to all the information an investor uses. However, at a major hedge fund, information access is strictly compartmentalized across different roles and seniority levels. A senior portfolio manager might have full visibility into the firm’s live positioning across global markets, whereas an analyst working on a specific asset class must not be exposed to that proprietary portfolio intellectual property.

To solve this, Bridgewater rejected the generic single-harness model popularized by tools like Claude Code, where all users interact with identical system prompts, permissions, and tool suites. Instead, Bridgewater designed PAT so that every individual investor receives a uniquely instantiated harness. In practice, each user’s PAT is restricted to the exact context, datasets, and execution tools that the specific human researcher is permitted to see, ensuring that secure internal IP cannot leak across organizational boundaries.

As Michael Ran puts it: “So unlike a harness like Claude Code, where everyone is interfacing with the same system prompt and the same tools, each person at Bridgewater has a unique version of PAT tailored to what they can and cannot see.”

- **Information access principle:** PAT mirrors human entitlements exactly so that it can emulate human research without creating information leakage risks. - **Dynamic harness instantiation:** Uniqueness across user sessions is governed dynamically by filtering available prompt context, proprietary databases, and tool configurations.

---

[10:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=624s) Unstructured Context and Time Series Search: Human-Like Inspection

Once the user prompt is submitted, PAT initiates research by scouring external web sources and Bridgewater's internal vault of unstructured data to contextualize current real-world events against history. While web browsing is standard for modern LLMs, Bridgewater's edge lies in its proprietary, near-real-time unstructured data repository. This system ingests thousands of incoming items daily—including global broker research, earnings call transcripts, and internal email discussions—encompassing millions of historical documents.

Next, PAT queries Bridgewater's proprietary time series database, an asset developed over fifty years containing tens of millions of distinct series. These include standard external market feeds like crude oil spot prices as well as internally computed signals, such as proprietary 12-month forward inflation expectations. Rather than relying solely on traditional retrieval-augmented generation (RAG) and semantic re-ranking, Bridgewater discovered that search accuracy jumped dramatically when they equipped the agent with human-like inspection heuristics. Human researchers evaluate frequency, currency, and whether incoming data matches fundamental economic priors rather than simply matching keyword names.

Michael Ran highlights the dramatic impact of this design choice: “So embedding this sort of reasoning into our search agent is something that got us up from roughly 50% accuracy all the way to 90%.”

- **Unstructured repository:** Ingests thousands of real-time sources daily, spanning global broker research, corporate earnings transcripts, and internal communications. - **Time series scale:** Tens of millions of historical series combining exogenous market quotes with internally modeled macroeconomic metrics. - **Human-like evaluation criteria:** Agents inspect series frequency, currency denomination, and numerical alignment with economic priors.

---

[12:01](https://www.youtube.com/watch?v=lXZb21CfeIY&t=721s) "The Plan Is the Analysis": Clarifying Questions and Schema Design

After compiling the relevant historical context and time series datasets, PAT initiates an interactive dialogue with the researcher, asking targeted clarifying questions and offering alternative analytical angles. Rather than treating clarifying questions as a polite chatbot gimmick, the Bridgewater team devoted substantial prompt engineering and internal benchmarking to teach PAT the substantive difference between strong and weak research questions. The goal is to force human investors—who frequently rush into computation without sufficient forethought—to establish an exhaustive plan before writing a single line of code.

This interactive clarification sets up the formal planning phase. During planning, PAT specifies the entire analysis: every intermediate dataframe that must be constructed, the precise schema of each dataframe, and the exact dependency graph connecting them. While this planning stage demands significant upfront time and computational overhead, the team willingly pays the cost because a mathematically rigid plan unlocks massive downstream efficiencies during the execution phase.

Describing this structural philosophy, Michael Ran explains: “During PAT's development, we came to the view that the plan really is the analysis.”

```mermaid flowchart TD accTitle: PAT Research Planning and Parallel Execution Pipeline accDescr: An end-to-end flow showing how a user prompt moves from context retrieval to clarifying questions, schema planning, parallel code generation, and execution.

subgraph Preparation ["Context & Data Preparation"] A["User Prompt Submitted"] --> B["Search Unstructured Data & Web"] B --> C["Query Time Series Database"] C --> D["Human-Like Inspection (50% to 90% Accuracy)"] end

subgraph Planning ["Interactive Planning Phase"] D --> E["PAT Asks Clarifying Questions"] E --> F["Define Dataframes & Schemas"] F --> G["Map Complete Dependency DAG"] end

subgraph Execution ["Parallel Generation & Storage"] G --> H1["Sub-Agent: Dataframe 1 Code"] G --> H2["Sub-Agent: Dataframe 2 Code"] G --> H3["Sub-Agent: Dataframe N Code"] H1 --> I["Supervised Python Execution Engine"] H2 --> I H3 --> I I --> J["Self-Correction & Diagnostic Inspection"] J --> K["Internal Time Series DB & Interactive Report"] end ```

- **Planning philosophy:** If a plan's input and output schemas are perfectly specified, execution becomes a deterministic compilation step. - **Collaborative scoping:** PAT challenges human biases by proactively suggesting missing analytical dimensions and interrogating ambiguous constraints.

---

[13:15](https://www.youtube.com/watch?v=lXZb21CfeIY&t=795s) Parallel Code Generation and Compounding Time Series Data

Because PAT generates an explicit structural plan containing data dependencies and schemas for every node in the analysis graph, code generation does not need to happen sequentially. Instead, PAT delegates the coding of each dataframe to specialized sub-agents running in parallel. Each sub-agent is supplied with its upstream inputs, input schemas, and the required output schema, isolating it from the rest of the project. Consequently, generating code for an intricate analysis involving 30 dataframes requires virtually the same elapsed clock time as an analysis involving only three.

Once the Python code is assembled, it runs under the supervision of an execution monitor agent programmed to intercept runtime tracebacks or nonsensical numeric outputs. Crucially, when computation succeeds, the resulting time series do not disappear into an isolated reporting UI; they are written directly back into Bridgewater’s central time series database. This means AI-generated time series are formatted identically to human-curated datasets, allowing future analyses run by humans or other agents to consume them immediately as inputs.

Michael Ran underlines the speed advantage of schema-driven parallelization: “So this lets an analysis with three data frames or a medium-sized one with something like 30 data frames take roughly the same amount of time to generate code in both scenarios.”

- **Sub-agent parallelization:** Code generation latency is decoupled from analytical complexity by distributing discrete schema implementations concurrently. - **Autonomous supervision:** A monitor agent catches runtime exceptions and flagrant mathematical anomalies during Python execution. - **Compounding knowledge loop:** Analysis outputs are written back into the corporate time series database, making them indistinguishable from human-uploaded series and immediately reusable.

---

[14:27](https://www.youtube.com/watch?v=lXZb21CfeIY&t=867s) Automated Self-Correction and In-House Interactive Reporting

Before presenting analytical findings to a researcher, PAT performs an automated quality-control check. Mirroring the dynamic between a senior portfolio manager and a junior analyst, PAT inspects its own generated tables and charts, validating that computed quantities adhere to economic sense and that chart layouts are clean and readable. If an anomaly or visual artifact is detected, PAT halts, diagnoses the underlying cause, refines the implementation, and re-executes the pipeline until it satisfies its own internal criteria.

The final output is an interactive research dossier rendered with Bridgewater’s proprietary in-house charting libraries and software stack, developed internally across several decades. Researchers can pan and zoom across historical intervals or push the underlying data slices directly into Bridgewater’s internal visualization software for live manual adjustments.

Reflecting on the need for rigorous self-evaluation, Michael Ran notes: “Now, after execution completes, just like you'd want your junior analyst to double-check their work before coming back to you, we want PAT to do the same.”

- **Self-critique workflow:** The model evaluates its own charts and numeric outputs against internal standards prior to delivering results to the user. - **Native tooling integration:** Visualizations run on Bridgewater’s proprietary financial charting engine, providing immediate operational compatibility for institutional investors.

---

[15:24](https://www.youtube.com/watch?v=lXZb21CfeIY&t=924s) The "Teach" Button: Self-Healing Repositories and Automated PRs

PAT incorporates two distinct mechanisms for continuous operational improvement. The first is passive: background agents systematically scan completed investor sessions to identify systemic analytical blind spots. The second mechanism is explicit: if an investor observes that an analysis yielded the correct numbers but omitted an important analytical perspective or preferred visualization, they can hit an in-app "Teach" button to capture the insight immediately.

Clicking "Teach" triggers a background agent that parses the conversation history to detect context gaps, behavioral discrepancies, or steering patterns that should have been anticipated. The agent formulates a failing benchmark test that reproduces the suboptimal behavior. It then iteratively modifies Bridgewater’s internal context repositories or the agent harness until the benchmark passes, runs regression checks across the entire corporate test suite to ensure existing capabilities remain intact, and dispatches a Slack notification linking directly to an automated GitHub pull request.

Michael Ran emphasizes the compounding advantage of this autonomous self-correction loop: “And the thing this does is that the next time a human comes to PAT with a similar question, we expect them to get the better version of PAT right out of the box.”

```mermaid flowchart LR accTitle: The Teach Button Autonomous CI/CD Loop accDescr: Flowchart illustrating how user feedback via the Teach button generates failing benchmarks, iterates on code, verifies regressions, and opens a pull request.

A["User Clicks 'Teach' Button"] --> B["Agent Identifies Context Gap / Mistake"] B --> C["Generate Failing Benchmark Test"] C --> D["Iterate on Context or Harness"] D --> E{"Benchmark Passes?"} E -- No --> D E -- Yes --> F["Run Full Regression Suite"] F --> G["Send Slack Alert with Automated PR"] ```

- **Dual-track learning:** Combines autonomous post-conversation mining with real-time, user-directed feedback triggers. - **Test-driven evolution:** Automatically synthesizes a reproducible failing benchmark before modifying code or system prompts. - **Continuous deployment safety:** Validates fixes against the global regression suite before submitting automated pull requests via Slack.

---

[16:48](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1008s) Santi Weight: Reframing Coding Agents as a Compiler Problem

Following Michael Ran’s demonstration, Santi Weight, Technical Lead for the Pocket Analyst Tool, takes the stage to unpack PAT's underlying architecture. Acknowledging that many software engineers find building agentic coding tools frustrating, Weight points out that general-purpose coding agents are notoriously fickle, unpredictable, and prone to catastrophic errors—such as inadvertently corrupting underlying databases. While such unreliability might be tolerated in consumer prototypes, it is unacceptable in an institutional investment firm responsible for deploying billions of dollars in global capital.

Drawing upon his personal background in compiler theory and programming language design, Weight argues that high-performance coding agents should not be treated as freewheeling generative chatbots. Instead, they must be engineered like traditional optimizing compilers. A software compiler accepts user code and deterministically translates it into low-level execution targets without introducing off-by-one errors or structural defects. Similarly, an agentic system in finance must treat a natural language prompt and its research plan as source code, compiling it deterministically and reliably down to verifiable, executable Python.

Santi Weight states the high-stakes engineering reality plainly: “At a hedge fund, we're trying to trade billions of dollars, and so we can't have just vibe-coded analysis be the underpinning of how these analyses go.”

- **The fragility of coding agents:** Unconstrained agents frequently hallucinate logic, fail unpredictably, or damage production runtime environments. - **The compiler paradigm:** Treats the human request and structured plan as high-level source code that must be compiled into lower-level Python through rigid, verifiable, and deterministic phases.

[17:59](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1079s) The LangGraph Chat Agent and Coding as an Implementation Detail

Santi Weight shifts focus to PAT's chat agent architecture. The explicit purpose of the chat agent is for the model and the investor to reach a shared understanding of what the research is trying to achieve. Under the hood, it is built in LangGraph, chosen primarily for out-of-the-box persistent state, continuations, and cancellations—mechanisms the team previously tried to build manually “with a much worse effect.” The chat agent has access to tool calls such as time series search and unstructured search. Once it discovers and assembles all the necessary data series, it creates an explicit analysis plan and calls a sub-agent: the coding agent, which generates a complete Python and Pandas analysis.

```mermaid flowchart TD accTitle: Two-tier agent interaction in Pocket Analyst accDescr: The investor talks to a LangGraph chat agent which gathers data via tool calls and passes a structured plan to a Python coding sub-agent.

subgraph ChatStage["Chat Agent (LangGraph)"] User["Investor"] --> Agent["Chat Agent"] Agent <--> Tools["Search Tools<br/>(Time series, unstructured)"] end

subgraph CodeStage["Coding Sub-Agent"] Agent -->|"Analysis plan"| Coding["Coding Agent"] Coding --> Out["Python / Pandas Analysis"] end ```

The strict boundary between the chat layer and the coding layer was an intentional product choice. Bridgewater's investors are not professional software engineers; their focus is macroeconomic logic. The chat interface is therefore kept exclusively focused on investment ideas, deliberately hiding the code so that programming becomes a pure implementation detail. This separation also provides clean prompt context, allowing each agent to specialize and improve at its designated role. To ensure seamless collaboration, the chat agent is trained to communicate using Bridgewater's specific internal vocabulary and investor shorthand:

> “Your user is better at writing context than you are, most likely. And so having low ego about it and letting them contribute directly is a good way to win.”

- **LangGraph Infrastructure:** Provides native state persistence, workflow cancellations, and continuations out of the box. - **Investor Co-Development:** Investors contribute domain context directly into the repository via PRs rather than having software engineers translate their investment logic. - **Workflow Guides:** The chat agent relies on explicit, step-by-step procedural guides for specific analysis types rather than nebulous general context blocks.

---

[20:04](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1204s) Analysis Plans as Natural Language Python Projects

Weight moves to his favorite component: the coding agent. While its architecture is conceptually influenced by LangGraph, it relies on standard Python code rather than autonomous agentic orchestration loops. When the chat agent finishes gathering requirements, it outputs an analysis plan split into discrete tasks. Rather than serving as an open-ended scratchpad or to-do list, each task maps directly to an individual Python function intended to compute a Pandas DataFrame.

```mermaid flowchart LR accTitle: Natural language task schema to deterministic Python code accDescr: An analysis task contains a name, description, and structural and semantic metadata which deterministically compiles into a Python function.

subgraph PlanTask["Plan Task Schema"] Name["Task Name"] Desc["Calculation Description"] Meta["DataFrame Shape & Semantics"] end

PlanTask -->|"LLM Compilation"| Func["Python Function<br/>(Calculates DataFrame)"] ```

The plan functions as a full-fledged natural language software project. Every task schema contains an operational name, calculation instructions, and explicit structural and semantic expectations for the output DataFrame. The objective is strict reproducibility: two different LLMs handed the exact same task specification must generate code that produces identical semantic outputs. Because these task contracts are locked down in advance, down-funnel tasks—such as final data visualizations—already know the exact shape and types of the DataFrames they will consume before earlier tasks (like raw data retrieval) have even written or executed their code.

- **Deterministic Task Compilation:** Two independent LLM runs on the same specification should produce semantically equivalent code. - **Decoupled Task Schemas:** Downstream chart-generation tasks hold complete interface contracts for upstream DataFrames before upstream generation runs. - **Architecture over Autonomy:** Hard-coded Python contracts replace unconstrained agent autonomy for code generation.

---

[21:13](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1273s) Parallel Code Generation and DAG-Enforced Validation

Because the natural language Python plan defines clear data contracts, the coding agent can generate all functions concurrently via parallel LLM calls. A visualization task does not need to wait for upstream ingestion code to finish writing before it starts compiling its own function. In comparative benchmarks against Claude Code on identical plans and context, PAT generates code approximately four times faster. More critically, execution time decouples from plan size: a 20-task plan takes the same wall-clock time to generate as a three-task plan.

```mermaid flowchart TD accTitle: Parallel generation and DAG-based validation architecture accDescr: Tasks generate in parallel, are parsed into a DAG via static analysis, and execute through parallel validation layers until outputs match task requirements.

subgraph Gen["1. Parallel Generation"] T1["Task 1 LLM"] T2["Task 2 LLM"] T3["Task 3 LLM"] end

subgraph Val["2. DAG Validation Layers"] DAG["Static Analysis & DAG Builder"] L1["Validation Layer 1<br/>(Parallel Workers)"] L2["Validation Layer 2<br/>(Parallel Workers)"] end

T1 & T2 & T3 --> DAG DAG --> L1 --> L2 L1 -.->|"Mismatch: Edit & Retry"| L1 ```

Because models rarely produce perfect output on the first attempt, the system runs a structured validation loop. PAT extracts the generated code, runs a static analysis pass to construct a Directed Acyclic Graph (DAG) of task dependencies, and executes validation agents in parallel along topological layers. A five-task plan collapses into three validation layers, while a 20-task plan typically resolves in four or five layers. Each task's output DataFrame is inspected against its original contract. If a discrepancy arises, the validation agent revises the code in place and re-runs it until it conforms.

> “The main point I want you to take away from this part of the slides is that we enforce correctness in the architecture. Again, no agentic orchestration. This is regular Python code, so the guardrails are really hard, and the agents cannot forget to validate.”

- **Hyper-Scaling Speed:** Concurrency allows 20-task analytical plans to complete in the same wall-clock time as small 3-task jobs. - **Deterministic Coding Rate:** Across test suites, identical plans yield matching final code 95% of the time across independent agents. - **Moving Beyond Vibes:** Strict deterministic reproducibility provides dependable evaluation baselines instead of relying on subjective "LLM-as-a-judge" heuristics.

---

[23:10](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1390s) The Execution Engine: Static Analysis and Instant Re-Runs

Traditional coding agents invoke commands directly through terminal tool calls, which introduces network latency and risks the agent getting sidetracked during long execution chains. PAT circumvents this by managing code execution directly through a custom Python engine. The engine runs a classical static analysis pipeline that inspects the code and injects caching annotations across functions to prevent redundant evaluations and double-fetching of heavy macroeconomic time series.

| Execution Dimension | Traditional Coding Agent (e.g., Claude Code) | Pocket Analyst Tool (PAT) | |:--- |:--- |:--- | | **Execution Method** | LLM orchestrates self-directed terminal tool calls | Static analysis pipeline with deterministic harness | | **First-Run Behavior** | Often re-queries and double-executes intermediate steps | Caching annotations prevent duplicate data retrieval | | **Iterative Re-Run** | Re-executes the entire script from top to bottom | Re-executes only modified nodes; upstream is cached | | **Downstream Edit Speed** | Incurs latency overhead of full re-computation | Near-instantaneous updates when changing downstream code |

While PAT is faster on clean first-time runs because it never fetches identical data twice, its primary advantage appears during iterative revisions. Weight demonstrates a benchmark where an investor edits only the title of the final chart in an analysis. A standard terminal-driven agent re-runs the entire Python script from scratch, taking almost as long as the initial run. Because PAT's static analysis isolates dependencies and leverages its cached data frames, it updates only the downstream chart function, resulting in near-instantaneous execution. This enables investors to experiment with analytical iterations without waiting through repeated data-loading pipelines.

---

[24:25](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1465s) Three Takeaways: Specialize, Benchmark, and Think Like a Compiler

Weight concludes the presentation with three core lessons learned while developing PAT for Bridgewater's investment floor:

> “The first takeaway: we really believe in specializing our agents. We don't really believe in generic, powerful agents. They make really cool demos. I'm sure many of us have given them. But it's really hard to make that a daily workflow that you can depend on.”

Rather than deploying open-ended autonomous agents, the team isolates narrow, well-defined workflows, subjects them to rigorous quantitative benchmarks, and methodically hill-climbs those metrics. Highly specialized agents can later be combined into compound workflows, whereas untangling an over-generalized agent after the fact is exceedingly difficult.

Finally, Weight encourages the audience to treat agentic code generation as an applied compiler engineering problem rather than an open-ended autonomy problem:

> “Compilers have been around for decades and they have a ton of techniques for how to generate code more reliably, correctly, and deterministically.”

Borrowing proven compiler strategies—such as intermediate structural representations, DAG-based scheduling, static analysis, and deterministic caching—transforms brittle LLM programming loops into dependable, enterprise-ready systems. Weight wraps up by acknowledging the direct team responsible for the product and inviting attendees to continue the discussion outside for the post-talk AMA.

## Notable quotes > [16:48](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1008s) At a hedge fund, we're trying to trade billions of dollars, and so we can't have just vibe-coded analysis be the underpinning of how these analyses go. — Santi Weight

> [24:25](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1465s) We don't really believe in generic, powerful agents. They make really cool demos. I'm sure many of us have given them. But it's really hard to make that a daily workflow that you can depend on. — Santi Weight

> [24:25](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1465s) Compilers have been around for decades and they have a ton of techniques for how to generate code more reliably, correctly, and deterministically. — Santi Weight

> [06:56](https://www.youtube.com/watch?v=lXZb21CfeIY&t=416s) Investors bring the context and the domain-specific expertise. Technologists bring the architectural capability. And scientists bring the rigor. — Brendan McManus

> [17:59](https://www.youtube.com/watch?v=lXZb21CfeIY&t=1079s) Your user is better at writing context than you are, most likely. And so having low ego about it and letting them contribute directly is a good way to win. — Santi Weight

## Mentioned Bridgewater Associates, Pocket Analyst Tool (PAT), Brendan McManus, Michael Ran, Santi Weight, LangChain, LangGraph, LangSmith, Claude Code, Python, Pandas, GitHub, Slack

## Video description Brendan McManus, Michael Ran, and Santi Weight from Bridgewater Associates' applied AI team walk through PAT, the Pocket Analyst Tool — an internal AI analyst deployed to hundreds of investors that performs hours of deep exploratory research in minutes. Brendan explains how 50 years of written-down investment logic gave Bridgewater a unique advantage entering the AI era. Michael demos PAT live — covering time series search with human-like inspection (jumping from 50% to 90% accuracy), per-user security harnesses, and a Teach button that autonomously generates benchmarks and PRs to fix its own mistakes. Santi then goes deep on the architecture: treating agentic code generation as a compiler problem, parallel LLM code gen from a structured plan, DAG-based validation agents, and a static analysis caching layer that makes iterative re-runs nearly instantaneous.

Chapters: 0:00 Introduction: 50 years of written-down investment logic as an AI advantage 1:52 Bridgewater's approach to AI: as investors and as practitioners 3:11 The research circle and the artificial investor roadmap 4:30 PAT: what it is and what it's not 5:01 What PAT had to do: data, tools, diagnosable analyses, context, and learning 6:24 How a 50-year-old hedge fund actually builds this 7:09 Multi-archetype teams: investors, technologists, and scientists side by side 8:32 Demo: PAT live — oil supply shocks and the Middle East conflict 9:33 The per-user security problem: every investor gets their own PAT 10:24 Time series search with human-like inspection: 50% to 90% accuracy 11:14 The plan is the analysis: clarifying questions and high-quality research plans 12:49 Parallel code generation: 3-task and 20-task plans take the same time 14:27 Self-correction: PAT checks its own work before returning results 15:24 The Teach button: autonomous benchmark creation and PR generation 18:08 Santi Weight: treating coding agents as a compiler problem 19:44 Chat agent architecture in LangGraph and why coding is a pure implementation detail 21:13 The natural language Python project: deterministic tasks and parallel LLM gen 22:37 Validation agents in parallel: enforcing correctness in the architecture 24:00 Execution layer: static analysis, caching annotations, and near-instant re-runs 25:29 Three takeaways: specialize agents, benchmark narrow workflows, think compiler

Resources: → LangGraph: https://www.langchain.com/langgraph → LangSmith: https://www.langchain.com/langsmith → LangChain Academy: https://academy.langchain.com

Bridgewater Disclaimer: The AI tools and capabilities discussed herein are for informational purposes only. There is no guarantee that any discussed capabilities or anticipated benefits will be achieved. See Important Disclosures and Other Information: https://www.bridgewater.com/important-disclosures-and-other-information Risks Associated with the Use of AI Tools: https://www.bridgewater.com/risks-associated-with-use-of-ai-tools

[Source](https://www.youtube.com/watch?v=lXZb21CfeIY)

Reading summary

Bridgewater Associates developed the Pocket Analyst Tool (PAT) to compress complex macroeconomic research from days into minutes by combining five decades of formalized investment logic with a compiler-inspired multi-agent architecture. Codified Investment Principles as Agent Context (0:06) Bridgewater's deployment of PAT relies on an institutional practice dating back to its 1980 bond system, which required investors to hand-write causal logic on legal pads to allow critique and iterative refinement. According to team lead Brendan McManus, this half-century of systematically inscribing and updating rules meant the firm did not need to author domain context retroactively for modern generative models. Within Bridgewater's broader 'research circle' loop—spanning perception, hypothesis generation, investigation, synthesis, and shared memory—PAT is strictly confined to exploratory analytical investigations rather than trade execution or order routing. Tailored Security and Heuristic-Driven Search (9:21) To prevent internal intellectual property leaks across different clearance tiers, Bridgewater rejected generic, shared system prompts. Instead, PAT dynamically instantiates unique harnesses per user, restricting context, datasets, and tools to match individual investor entitlements. When retrieving context across external sources, millions of proprietary documents, and an internal repository of tens of millions of time series, the team bypassed standard semantic re-ranking. Investor lead Michael Ran noted that equipping agents with human-like inspection heuristics—such as evaluating update frequency, currency denominations, and alignment with economic priors—increased search accuracy from roughly 50% to 90%. Treating Research Plans as Compilable Software (16:48) Technical lead Santi Weight argues that finance workflows cannot tolerate open-ended 'vibe coding,' requiring agents to be engineered like traditional optimizing compilers. PAT uses LangGraph to manage the user-facing chat layer, keeping code generation abstracted as an implementation detail. Once the research scope is established, PAT generates an explicit structural plan where each calculation task specifies exact input and output DataFrame schemas and dependency relationships. Because task contracts are locked down in advance, down-funnel components like visualization modules hold complete schema definitions before upstream data retrieval code is even written or executed. Parallel Generation, Static Analysis, and Caching (21:13) Because schemas are predefined, PAT delegates code generation to concurrent sub-agents, decoupling wall-clock coding time from project complexity so that generating a 30-dataframe analysis requires roughly the same time as a three-dataframe script. Generated Python code is organized into a Directed Acyclic Graph (DAG) and validated across topological layers, yielding semantically equivalent code 95% of the time across independent agents. A custom execution engine performs static analysis and injects caching annotations, which prevents redundant data fetching and enables near-instantaneous updates when an analyst modifies downstream visual parameters without re-running upstream data ingestion. Continuous Improvement and Autonomous Pull Requests (15:24) PAT incorporates a continuous learning flywheel using both passive operational trace audits and explicit user feedback. If an investor spots an omission, an in-app 'Teach' button prompts a background agent to diagnose the gap, generate a reproducible failing benchmark test, modify internal context repositories or the agent harness, verify the global test suite against regressions, and dispatch an automated GitHub pull request alert to Slack. Successfully computed time series are also written back into the central corporate database, allowing future human and agent analyses to consume them as native inputs. Bridgewater's engineering team concludes that dependable enterprise AI requires rejecting broad, generic agents in favor of specialized, quantitatively benchmarked workflows grounded in proven compiler techniques like static analysis, intermediate schemas, and hard architectural guardrails.

Source quotes

[16:48] Santi Weight: At a hedge fund, we're trying to trade billions of dollars, and so we can't have just vibe-coded analysis be the underpinning of how these analyses go. [24:25] Santi Weight: We don't really believe in generic, powerful agents. They make really cool demos. I'm sure many of us have given them. But it's really hard to make that a daily workflow that you can depend on. [24:25] Santi Weight: Compilers have been around for decades and they have a ton of techniques for how to generate code more reliably, correctly, and deterministically. [6:56] Brendan McManus: Investors bring the context and the domain-specific expertise. Technologists bring the architectural capability. And scientists bring the rigor. [17:59] Santi Weight: Your user is better at writing context than you are, most likely. And so having low ego about it and letting them contribute directly is a good way to win.

Original transcript

[0:06] >> Hello, everyone. [0:08] My name is Brendan McManus, the team lead of the applied AI team at Bridgewater Associates, [0:12] a systematic macro hedge fund. [0:14] I've been at Bridgewater for almost a decade now, where I started as a software engineer, [0:19] then became a systematic investor and researcher, and for the past few years I've been focused [0:24] heavily on bridging the gap between investing and technology. [0:27] I'm here today with my colleagues Michael Ran and Santi [0:30] Weight, our investor lead and technical lead [0:32] of this project respectively, to talk to you about a great tool [0:36] that we built internally called PAT, the Pocket Analyst Tool. [0:39] By the end of this talk, all of you [0:42] should have seen how we built an AI analyst that's [0:45] capable of performing hours of expert research work [0:48] in minutes — that's been internally deployed [0:50] to hundreds of investors and that learns [0:53] from every single interaction. [0:55] On top of that, we'll also show you exactly how we architected such a thing. [1:00] So before we show you what we built, [1:02] I wanted to go through some quick framing on Bridgewater's approach to AI. [1:07] Bridgewater has been spending decades — 50 years — [1:10] thinking about how to encode markets and economies into compounding systems. [1:15] And all of this really started with what you're seeing on the screen: [1:18] our 1980 bond system, written down on a yellow legal pad. [1:22] The idea here was quite simple. [1:24] Every time you wanted to make a trade, [1:26] write down exactly the rules for why you think that trade makes sense. [1:30] Write down the exact causal logic. [1:32] Because once you do this, [1:33] another investor can take a look at what you've written, [1:36] help you figure out where you went wrong, [1:38] and help you improve upon this process. [1:41] Every time you learn something new, you scratch out a rule, [1:43] you write down a new one, [1:45] and this creates a pretty incredible learning process [1:47] that has been the foundation of everything that we've done at Bridgewater [1:50] for the past 50 years. [1:52] Over the decades, we've compounded upon this process [1:54] significantly, taking every lesson, every methodology, every rule that we've [1:59] developed about the trades we make — how and why — and codifying them into [2:04] an expert system that's both machine-readable and human-readable. [2:07] And it's really now that we're sitting on a pretty tremendous trove of data. [2:12] And all of this data is really what sets us up well for the AI era. [2:16] We didn't have to go back and write down everything for agents. [2:19] It was already there for us to draw upon. [2:22] Before we get into the tool, [2:24] I wanted to talk about how we're approaching AI at Bridgewater [2:26] more generally. [2:27] We're doing this in two ways. [2:28] The first is as investors. [2:30] As investors, we need to deeply understand [2:32] every major dynamic that's shaping global markets [2:35] and economies. [2:36] Just as we had to understand COVID or the recent oil supply [2:39] shock, we've also had to understand AI. [2:42] What's the shape of the supply-demand mismatch? [2:45] What's driving the buildout? [2:47] And how do these things ultimately impact markets? [2:49] This understanding is table stakes for us as investors. [2:53] The second way we're approaching AI [2:54] is as practitioners — which is what we're mostly [2:57] going to be spending our time on here today. [2:59] As practitioners, we're applying AI [3:01] across all aspects of our research process, [3:03] with the ultimate goal of building out [3:05] an artificial investor that's capable of the full range [3:08] of activities that our human investors are performing [3:10] every single day. [3:11] So what do our human investors actually do? [3:14] Well, we think about it as a research circle. [3:16] Investors are constantly perceiving [3:18] what's happening in the outside world, [3:20] formulating questions about what is true [3:22] and what they might potentially be missing, [3:24] performing analytical investigations [3:26] to try to answer these questions, [3:29] synthesizing their findings, [3:30] and ultimately taking anything that they learned [3:32] and putting it back into the compounded understanding — [3:34] the expert systems that we've built out. [3:37] It's really this last step that's key. [3:39] Everything that we learn as a function of this process [3:41] gets put back into a shared memory [3:43] that humans are able to draw upon. [3:47] And so you might imagine that if you're [3:51] going to build out an artificial investor, [3:53] they need to be able to do all of the different steps [3:55] of this research process. [3:57] You can imagine having built out discrete sub-agents [4:01] focused on each portion of the research circle. [4:04] And that's exactly how we're approaching AI. [4:06] We're building out discrete sub-agents [4:08] for each of these different things [4:09] that human investors must do, drawing upon the same understanding [4:13] that we've built up over the last 50 years. [4:16] But today, we're only going to be talking about one of these [4:18] agents — the one focused on the [4:20] investigation portion of the research process: the kinds of [4:24] deep analytical work that take our human analysts days and [4:27] weeks to perform. [4:29] We called this tool PAT, the Pocket Analyst Tool. [4:32] And just to set expectations: PAT is not about how we trade. [4:36] It's really about performing deep exploratory research, [4:39] enabling our investors to go after questions that they [4:41] never would have had the bandwidth to pursue before. [4:44] So what did we actually build? [4:46] We built PAT, the Pocket Analyst Tool. [4:49] And from day one, the spec was simple. [4:52] We had to enable PAT to do all of the things [4:54] that our human investors are doing [4:56] as they perform investigatory or analytical work. [5:00] And that really starts with data. [5:01] PAT had to be able to search across [5:03] and read all of the different data that we have internally — [5:05] from structured time series data, [5:07] for example, stock prices going back decades, [5:10] to unstructured data, for example, [5:12] broker-dealer research pieces that we subscribe to, [5:14] or internal memos that we produce. [5:16] PAT has to be able to search across and read all of it. [5:19] PAT also has to be able to use all of the different tools [5:21] that our human analysts have access to. [5:23] All of the proprietary tools that we've built out [5:25] for visualization, for diagnostics, [5:27] or for evaluating the quality of the indicator ideas [5:29] that we've built out. [5:31] In addition to this — and this is where things [5:33] might get a little bit more interesting [5:34] for a technical audience — many of the analyses [5:37] that PAT is running would take a human analyst [5:39] many hours to run. [5:41] And this means that the analyses are quite complex, [5:45] which means that PAT's analyses [5:46] have to be completely diagnosable — [5:48] not just for humans, but also for agents [5:51] running in the background, reading through the traces, [5:53] understanding and making sure [5:55] that every calculation is correct. [5:57] On top of this — and this is really where [5:59] building upon all of the things that we've written down [6:02] over the past 50 years starts to pay off — [6:03] PAT knows all of our context. [6:06] It has access to all of our investment processes, [6:09] our frameworks. It knows exactly how our analysts [6:11] are supposed to be doing work, because we've been writing it [6:13] down for the past 50 years. [6:15] And lastly, PAT has to learn. [6:17] It has to compound upon its own learning, [6:20] not just for one investor, but for every investor [6:22] at the firm. [6:24] PAT is not a prototype today. [6:26] It was actually deployed internally several months ago. [6:28] And we now have hundreds of investors using it every single [6:30] day, which is leading to a pretty incredible flywheel [6:34] of improvement: as investors use [6:37] PAT for real research, we have agents continuously [6:40] running in the background, scanning through these interactions, [6:42] figuring out where PAT went wrong, [6:44] developing human-audited benchmarks, which then [6:47] results in changes to context, and also [6:49] to the harnesses that we built for PAT — which results in PAT [6:52] improving not just for one, but for everyone. [6:56] And lastly, before we get into what we built, [6:58] I wanted to leave you with one question [6:59] that I pretty commonly get, which is: [7:01] how does a 50-year-old hedge fund actually [7:03] build out something like what you're about to see? [7:06] Well, it really starts with being [7:08] willing to shake yourself up. [7:09] The team that built out PAT was ultimately [7:11] an internal applied AI startup that [7:14] was incubated within the broader firm, [7:16] with the ability to move incredibly flexibly and quickly [7:19] while being able to draw upon the resources of the broader firm. [7:23] In addition to this, we've established multi-archetype [7:26] teams where we have investors, technologists, [7:28] and scientists sitting side by side, [7:31] building alongside each other. [7:34] And I think this is really a key thing [7:36] if you're going to build out a product like this. [7:39] Investors bring the context and the domain-specific expertise. [7:43] Technologists bring the architectural capability. [7:45] And scientists bring the rigor. [7:47] It's really these types of multi-archetype teams [7:49] that are necessary if you're going to build AI systems [7:52] for expert users. [7:53] And speaking of expert users, we have hundreds of them [7:56] internally using all of our AI tools — [7:59] not just PAT — generating signal [8:02] daily on how these things should be evolving [8:04] and improving over time. [8:06] And lastly, we have a pretty incredible compounding [8:08] ecosystem to plug into. [8:10] 50 years of shared data, tooling, and methodologies, [8:13] all built out not just for our human analysts to plug into, [8:16] but also for agents on our journey [8:18] to build out a fully artificial investor that's [8:21] capable of everything that humans are able to do today. [8:24] And so with that, I'm going to pass things off [8:25] to Michael Ran, investor lead, to go through a demo of what [8:28] we built and take you through the product architecture. [8:32] All right. [8:32] Thank you, Brendan. [8:34] [APPLAUSE] [8:36] My name is Michael Ran. [8:37] I'm the investor lead working on the Pocket Analyst Tool, [8:39] and a little bit about myself: [8:41] I've been at Bridgewater for five years, [8:42] where I joined as a technologist [8:44] but have spent most of my time in an investor role. [8:46] And nowadays, the thing I'm mostly focused on [8:48] is how we can infuse AI into our investment process. [8:51] With that, I'd love to jump into a demo [8:53] of the Pocket Analyst Tool to highlight its capabilities [8:56] and show you how investors at Bridgewater are using it. [8:59] Behind me you can see the PAT landing page, [9:01] which has the prompt we'll be using for today's demo. [9:04] The gist of it: we're asking PAT [9:06] to look at how markets have responded [9:07] to the recent conflict in the Middle East [9:09] and to compare today's events to similar historical episodes. [9:12] Then lastly, we asked PAT to put together [9:14] some visualizations that highlight [9:16] how similar or dissimilar today is [9:18] relative to previous oil supply shocks. [9:21] This is a real question we've been working on at Bridgewater [9:23] over the past couple of months, [9:24] and PAT has been a tool leveraged by investors [9:26] to help expedite our research process. [9:29] But before we submit the prompt, [9:30] I'd like to spend a moment talking [9:31] about an interesting security problem [9:33] we ran into when designing PAT's harness. [9:37] Our starting point was: for PAT to truly be helpful, [9:40] it needs to be able to access all of the information [9:42] that investors have access to when conducting research. [9:44] But the thing is, at Bridgewater, [9:46] different investors have access to different information. [9:49] So for example, you may have one investor [9:51] who has access to what our positions are across all markets [9:53] today, and it's important for that person's PAT [9:55] to also have this information. [9:57] But then you might have analysts who are not exposed to this, [9:59] and it's similarly critical that we do not accidentally [10:01] leak that secure IP to those analysts. [10:04] So unlike a harness like Claude Code, [10:05] where everyone is interfacing with the same system prompt [10:08] and the same tools, each person at Bridgewater [10:10] has a unique version of PAT tailored [10:12] to what they can and cannot see. [10:14] Practically speaking, this uniqueness [10:17] is just a function of what context [10:18] and what tools each person's PAT has. [10:20] So with that, we'll go ahead and submit the prompt. [10:24] The first thing that takes place in this analysis [10:26] is PAT searches the web and our vault of unstructured data [10:29] to better understand what's happening in the world today, [10:31] contextualized against history. [10:34] Web search itself is table stakes [10:36] when it comes to these modern chat applications. [10:38] But the real differentiator here [10:39] is the breadth of unstructured content [10:41] that we subscribe to that PAT is able to search over. [10:44] We have a database containing millions of documents [10:46] from all around the world that includes content [10:48] such as broker pieces, earnings transcripts, [10:51] internal emails, and more. [10:52] And this database is updating in near real time, [10:55] with thousands of new pieces coming in each day. [10:57] And this ties back to the point I was making on the previous [10:59] slide: for PAT to really provide leverage, it has to access everything that [11:03] its user has access to, such that it can try and emulate what its users actually do. [11:09] Once this context is gathered, the next thing PAT does is search our time [11:13] series database for the data required for the analysis. [11:16] This is a database that contains tens of millions of series that we've been modeling internally [11:20] for 50 years, and this database contains data from the outside world — like the price of oil — [11:25] and also internally derived concepts, [11:27] such as what we think inflation will be 12 months out. [11:30] The search agents use traditional [11:32] search techniques like RAG, re-ranking, et cetera, [11:35] but the thing we found to be a huge difference-maker [11:38] was layering on an element of human-like inspection. [11:40] What I mean by that is: when a human researcher [11:42] is looking for data, they don't just anchor [11:44] to what the name of the time series is. [11:46] They'll look at the frequency, [11:48] the currency of the series, and then most importantly, [11:50] whether the values in the series align with their priors. [11:53] So embedding this sort of reasoning into our search [11:55] agent is something that got us up from roughly [11:57] 50% accuracy all the way to 90%. [12:01] Now, after PAT has context and data at hand, [12:05] it comes back to the user with clarifying questions [12:07] and potentially ideas for additional angles to explore. [12:10] During PAT's development, we came to the view [12:12] that the plan really is the analysis. [12:14] If we can create a high-quality, detailed plan, [12:17] we felt confident that we could consistently take this plan, [12:20] intelligently execute it, and produce our desired outputs. [12:23] Santi will be diving into this a bit more later. [12:25] So while agents asking clarifying questions [12:27] is pretty standard in chatbots nowadays, [12:29] the thing we really focused on [12:30] was the substance of those questions. [12:32] We devoted lots of time and energy [12:34] into developing the context and benchmarks [12:36] that helped shape this capability. [12:38] We taught PAT what makes a good research question [12:40] versus a bad one, so this back-and-forth helps humans — [12:42] who tend to under-invest in planning — [12:44] flesh out what we consider to be [12:45] a high-quality research plan. [12:49] Now, after the ambiguous points are all resolved, [12:51] PAT enters its planning phase. [12:53] During the planning phase, the things it's doing are: A, [12:56] coming up with all of the data frames [12:57] that will be produced in the analysis; [12:59] coming up with the schemas of all of those data frames; [13:02] and then most importantly, [13:03] coming up with how all those data frames connect. [13:05] This planning phase is relatively expensive [13:08] from a time perspective, [13:10] but it's a cost we pay deliberately [13:12] because of what it lets us do during execution. [13:15] So now we have the plan locked in, [13:17] and the first step of plan execution is generating the code. [13:21] Given we have such a detailed plan, [13:23] we're able to generate the code [13:25] for each data frame in our analysis [13:27] in parallel using sub-agents. [13:28] And this works because each sub-agent knows [13:30] what data frames it depends on, [13:32] knows the schemas of those data frames, [13:34] and also knows what the schema of the data frame [13:36] it's producing should be. [13:37] So this lets an analysis [13:40] with three data frames or a medium-sized one [13:42] with something like 30 data frames [13:43] take roughly the same amount of time [13:45] to generate code in both scenarios. [13:48] Once we finish generating the code, [13:49] we execute the Python functions [13:51] with an agent overseeing this execution [13:53] and stepping in if it sees things like runtime errors [13:56] or nonsensical values. [13:57] And before we proceed from execution, [13:59] I want to call out the fact that the time series outputs [14:02] from these analyses land in the same database [14:04] that we actually pulled our inputs from. [14:06] And I think this is important for a couple of reasons. [14:08] One: it shows that any output from a PAT analysis [14:11] is indistinguishable from any of the human-uploaded series [14:13] that we've been producing for many years. [14:15] And more importantly, any output from a PAT analysis [14:18] can serve as an input to a subsequent one. [14:20] So this creates an environment [14:22] where humans and agents can very easily compound [14:24] and leverage each other's work. [14:27] Now, after execution completes, [14:30] just like you'd want your junior analyst [14:31] to double-check their work before coming back to you, [14:33] we want PAT to do the same. [14:34] So at this point in the analysis, [14:36] PAT will look at the data that's been computed [14:38] and the visualizations it's produced [14:40] and make sure that the numbers seem sensible [14:42] and the charts look clean. [14:43] If it sees something that looks a bit off, [14:45] PAT will take a step back, diagnose the issue, [14:48] refine the analysis, and make sure it's satisfied [14:51] with its result before coming back to the user. [14:54] And then the result itself is this interactive report [14:57] where the visualizations look just like [14:59] the ones investors at Bridgewater are producing. [15:01] PAT is using the same in-house charting library [15:04] and leveraging the same existing text deck [15:06] that we've been developing internally for decades. [15:08] So you can see here how you can zoom in, [15:10] zoom out of these charts, [15:11] and you can even send the data from this interactive report [15:13] to our internal charting tool, [15:15] where you can make further modifications on the fly. [15:18] Before handing it over to Santi, I want to speak a bit to how PAT gets better [15:22] as you use it. [15:24] There are two primary ways in which this happens. [15:26] The first is the autonomous one that Brendan alluded to earlier, where we have agents reviewing [15:30] completed conversations looking for ways in which PAT can get smarter. [15:34] And the second one — and the one we'll be showing here — is the more explicit option, where a [15:38] user can kick off this learning process within the context of an analysis if they think there [15:42] is something to be learned from their interaction with PAT. [15:45] So right here, we just have the user asking for a different set of visualizations. [15:49] Note the user didn't say anything was wrong — they just wanted a different perspective that [15:53] they thought was important to answering the question at hand. [15:56] If they think that PAT should have produced or suggested this set of visualizations from [16:00] the jump, they can click the Teach button, which will then spawn an agent to go through [16:04] the conversation looking for things like behavioral mistakes, context gaps, or user steering that [16:09] can be front-run. [16:11] The user is then able to modify this or send it as-is, and when they submit it, what happens is: [16:16] first, an agent on the back end will create a benchmark that we expect to fail. This shows [16:20] that we can reproduce this poor behavior. It will then iterate on our context repositories [16:25] or the harness itself until that benchmark passes. And then after confirming that by making [16:29] this benchmark pass, we didn't cause the rest of our suite to fail, we get a Slack message [16:33] with the pull request, including the changes the agent wants to make to PAT. And the thing [16:37] this does is that the next time a human comes to PAT with a similar question, we expect them [16:41] to get the better version of PAT right out of the box. So now I'd like to hand it over [16:45] to Santi for the technical overview. [16:48] [APPLAUSE] [16:48] Hello, everyone. [16:51] Thanks, Michael. [16:52] I'm Santi, the technical lead for the Pocket Analyst Tool. [16:54] I'm sure many of you in the crowd [16:56] are building coding agent products just like we are. [16:58] And it's really hard to build one. [17:00] Coding agents are really fickle and unpredictable, [17:03] they often make mistakes. [17:04] And when you're really unlucky, [17:05] they'll go off the rails and try to nuke your data [17:07] and all the rest of it. [17:09] And so it's already hard to build a good product [17:11] that people like, but then it's really hard to build a product [17:13] they want to embed into their daily workflows. [17:16] At a hedge fund, we're trying to trade billions of dollars, [17:19] and so we can't have just vibe-coded analysis [17:21] be the underpinning of how these analyses go. [17:24] My background is in compiler theory [17:27] and programming language design. [17:28] Compilers have a very similar footprint of requirements: [17:33] they're fully deterministic, fully correct, [17:36] and reliable. [17:37] You can't have an off-by-one error [17:38] when you're flying a plane, for example. [17:40] And there's a similar shape here. [17:42] A compiler takes user code and compiles it down to something [17:45] like JavaScript, and a coding agent takes a user prompt or plan [17:48] and compiles it down to Python. [17:51] We really like this approach, and I don't have a lot of time [17:54] today, [17:54] but we're going to focus on this as a learning that maybe you [17:57] might be able to take home to your own work. [17:59] We're going to start with the chat agent. [18:01] The goal here is for the chat agent and the user [18:04] to come to a common understanding of what they're [18:06] trying to accomplish. [18:08] The chat agent is implemented in LangGraph. [18:10] We primarily use it for persistent state. [18:12] It has out-of-the-box cancellations and continuations. [18:16] We used to manage that stuff ourselves [18:18] with a much worse effect. [18:20] The chat agent has access to tool calls. [18:22] Michael called some of these out. [18:23] So there's data series search, unstructured search, [18:26] and each of these would be a tool call themselves. [18:28] And then once the chat agent knows all the data [18:30] it needs for its analysis, [18:31] it's going to make a plan and invoke a tool call [18:34] to a sub-agent, which is our coding agent. [18:36] And that's going to produce a Python-Pandas analysis. [18:39] So why would you separate your two agents? [18:42] Early on, we decided that our investors are not programmers [18:45] by trade — they care about investment. [18:47] So we decided to keep the chat purely [18:49] about investment content. [18:51] And the result is that we have a product where coding [18:53] is a pure implementation detail. [18:55] From the chat, [18:57] you can't tell that there's code under the hood. [19:00] Other happy accidents: you get clean context, [19:03] so each agent becomes specialized [19:04] at its job and naturally improves. [19:07] And we get to tailor the chat experience a lot. [19:10] What we're going to talk about now [19:12] is that our investment domain context is really high quality. [19:16] We teach the chat agent how to talk [19:19] like a Bridgewater investor. [19:21] There's a lot of jargon to teach it. [19:23] And so the user and the agent both talk to each other [19:25] like coworkers at Bridgewater. [19:28] We also let our investors contribute — [19:30] Michael was showing that — contribute like a developer [19:32] on the codebase. [19:33] And this is a pretty good point. [19:36] Your user is better at writing context than you are, [19:38] most likely. [19:39] And so having low ego about it and letting them contribute [19:41] directly is a good way to win. [19:44] The last point I make about the chat: we teach the chat [19:47] agent not just context — which you end up with this nebulous [19:50] context that is very high-information but doesn't really [19:52] feel like a workflow. [19:54] Instead, we have step-by-step guides for the [19:57] agent on how to handle certain types of analyses. [19:59] And it feels much more like a product at that point. [20:01] Dependable workflows. [20:04] The rest of the talk is about my personal favorite part, [20:06] which is the coding agent. [20:08] This is a high-level architecture diagram [20:10] of the coding agent. [20:11] Everything you see here is actually just Python code. [20:13] It's influenced by LangGraph, [20:15] but there's no agentic orchestration. [20:17] Everyone's taking photos. That's great. [20:20] We're going to start with the left, [20:21] which is the analysis plan that the chat agent makes. [20:27] The analysis plan is broken up into tasks. [20:30] Each task maps approximately to one Python function [20:33] that's going to calculate a data frame. [20:35] Here's an example schema. [20:36] It gets a name, a description of what to calculate, [20:40] and then structural and semantic information [20:43] about the data frame that should come out. [20:45] We expect every task to deterministically compile [20:49] via LLM to a piece of code. [20:51] So two LLMs operating on the same task [20:53] should produce code that, when run, is semantically equivalent — [20:56] the same output values, exactly the same. [20:59] The result is that our analysis plan [21:01] isn't just a to-do list like you'd see in Claude Code. [21:03] Instead, we think of it [21:05] as a natural language Python project. [21:06] And because we have so much detail, [21:08] now we're going to go into code gen [21:10] and we can apply some fancy techniques. [21:13] The first thing: we split it into tasks [21:16] and then do parallel LLM generation. [21:19] And because our plan is so detailed, [21:22] a visualization task at the end of the plan [21:24] already knows everything it needs [21:25] to consume from code generation that hasn't yet been completed [21:28] for loading data, say. [21:31] And when we compare this to Claude Code, [21:33] you can see that on average — for the same context and same plan — we're about [21:38] four times faster at generating code. But then we have this hyper-scaling, so a 20-task [21:42] plan takes the same amount of time as a three-task plan. So now we have code and we're [21:47] going to execute it. You'd want to just execute the code naively, but sadly, LLMs today [21:53] aren't perfect on our tasks, so they don't normally one-shot it. Instead, what we do is [21:58] take the task that came in from the plan and the code that was generated from [22:01] the task, then run the code, compare it to the task, see if it's correct, [22:06] and if it's not, edit the code and keep going until we're done. [22:10] The first thing we do on the code is static analysis, then figure out the DAG, [22:15] and we apply our validation agents in parallel. [22:18] Here, there are two tasks being validated at the same time. [22:22] So a five-task plan comes down to three layers, and a 20-task plan might be four [22:26] or five layers of validation. [22:28] The main point I want you to take away from this part of the slides is that [22:32] we enforce correctness in the architecture. [22:35] Again, no agentic orchestration. [22:37] This is regular Python code, so the guardrails are really hard, and the agents cannot forget [22:41] to validate. [22:42] They are forced to validate. [22:44] The result is that when we run our test suite on any plan, 95% of [22:49] the time, the code that comes out is exactly the same for two different agents. [22:53] So it's essentially a deterministic coding agent. [22:57] And then because we have such a reproducible agent, [23:00] as we're scaling and hill climbing [23:02] and evaluating, we have something much more dependable [23:04] than vibes-based or LLM-as-judge evals. [23:10] Cool. [23:10] One more topic I'm going to touch on, [23:13] which is the execution layer. [23:15] Normally, coding agents invoke their code themselves. [23:17] They generate code, and then call it themselves [23:19] via terminal. [23:20] There are a couple of trade-offs here. [23:22] That's high latency with the tool calls, [23:23] and as you've all experienced, [23:25] they'll sometimes get lost along the way. [23:28] So instead, we run the code for the LLMs. [23:32] We do a classical static analysis pipeline [23:35] where we inject caching annotations into the Python code [23:37] to avoid re-execution and run it through a custom framework. [23:42] This is an example benchmark we have [23:44] for Claude Code invoking its own code versus Pocket Analyst. [23:48] We're faster [23:50] because we never double-load data [23:51] or double-execute intermediates. [23:54] But the actual win is not on the first time you run the code, [23:56] it's the second time. [23:57] Oh, there we go. [23:59] This is a benchmark where we take the last chart in a plan [24:03] and just change the name. [24:04] Claude Code is going to go and rerun all the code — [24:07] basically the same amount of time, [24:08] though it is faster at editing the code. [24:10] But Pocket Analyst basically has instantaneous code execution [24:12] for the second round. [24:13] And this means that when you're working on the product [24:15] as an investor, you can make small tweaks [24:17] to your investment analysis without [24:19] the overhead of a regular iteration. [24:25] OK, we're out of time. [24:26] We had many learnings, but unfortunately [24:27] we can only cover these. [24:29] The first takeaway: we really believe [24:32] in specializing our agents. [24:33] We don't really believe in generic, powerful agents. [24:37] They make really cool demos. [24:38] I'm sure many of us have given them. [24:40] But it's really hard to make that a daily workflow [24:42] that you can depend on. [24:44] Instead, we take often very narrow workflows [24:46] and benchmark them very heavily, [24:48] and then we hill climb those benchmarks. [24:52] You can then compound the agents after the fact, [24:53] but it's harder to go back the other way. [24:56] And this last thing is kind of a thought exercise — [24:58] something I hope is exciting and someone might take away: [25:01] think of agentic coding as a compiler problem, [25:03] not an agentic problem. [25:06] Compilers have been around for decades [25:08] and they have a ton of techniques [25:09] for how to generate code more reliably, correctly, [25:11] and deterministically. [25:13] We'd love to chat about this. [25:16] With that, I'd like to shout out our direct team. [25:19] There were many others, but this is the direct team. [25:22] Thank you. [25:27] We're going to be outside for the AMA. [25:29] We would really love to chat and talk about it [25:32] and see if you're excited by the problems too. [25:34] See you all around tonight. [25:36] Thank you so much. [25:38] [APPLAUSE]