# A Battle Tested Blueprint for Building AI Agents

Source: https://www.youtube.com/watch?v=e9EBl_PK4bw
Recap page: https://rapidrecap.app/video/e9EBl_PK4bw
Generated: 2026-03-04T14:03:43.202+00:00

---
## Quick Overview

The blueprint for building AI agents involves a three-layer architecture (Data Source, Processing/Memory, and Presentation/Delivery) that emphasizes finding the simplest solution first, only adding complexity like multi-agent systems when demonstrably necessary, while utilizing secure orchestration like Arcade for managing OAuth flows and tool access across layers.

**Key Points:**
- The Three-Layer Agent Architecture separates concerns into Data Source (Layer 1), Processing/Memory (Layer 2), and Presentation/Delivery (Layer 3).
- The core principle, derived from an Anthropic blog post, is to start simple and only increase complexity (e.g., multi-agent systems) when complexity demonstrably improves outcomes (5:54).
- Layer 1 (Data Source) for the Clinical Trials Tracker connects directly via HTTPX to the public, no-auth ClinicalTrials.gov API using four tools like search_trials and check_for_updates (10:25).
- Layer 2 (Processing + Memory) uses Google Sheets as persistent watchlist memory and relies on the Arcade API to handle OAuth flows for services like Google Sheets (11:02).
- Layer 3 (Presentation/Delivery) handles outputs like sending digests via Gmail and creating Linear tickets, both orchestrated through Arcade (12:25).
- Arcade simplifies OAuth handling by abstracting away 200+ lines of authentication code into about 30 lines using a single API key and handling token refresh/error handling automatically (13:31).
- The system is designed so that layers remain independent, allowing components like the Data Source layer (ClinicalTrials.gov) to be swapped out without affecting the rest of the architecture (1:08, 11:44).

![Screenshot at 12:09: The three-layer architecture diagram showing the flow from the Presentation layer \(Dispatcher\) down to Data Source \(Scout\) and back up through Processing/Memory \(Claude/Memory Agent\) and finally to Presentation.](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-12-09.jpg)

**Context:** The speaker details a battle-tested, three-layer architectural blueprint for building reliable AI agent systems, contrasting a generic three-tier pattern with a specific implementation used for a 'Clinical Trials Tracker' application. This blueprint focuses on maintaining separation of concerns, utilizing specialized agents for different roles (Scout, Memory Agent, Analyst, Dispatcher), and leveraging an orchestration platform called Arcade to manage authentication and tool access across layers.

## Detailed Analysis

The video presents an architectural blueprint for building reliable AI agents, structured into three independent layers: Data Source (Layer 1), Processing + Memory (Layer 2), and Presentation/Delivery (Layer 3). The guiding principle is simplicity: only add complexity (like multi-agent coordination) when it demonstrably improves outcomes, following advice from an Anthropic publication (5:55). Layer 1, the Data Source, directly interacts with external APIs like ClinicalTrials.gov via HTTPX without needing Arcade for authorization, using four specific tools: search_trials, get_trial_details, get_trial_results, and check_for_updates (10:43). Layer 2, Processing + Memory, uses Google Sheets as persistent memory, where agents like the Memory Agent save/retrieve watchlists via the Arcade API, which handles OAuth automatically (11:02). Layer 3, Presentation/Delivery, handles user interaction, such as sending digests via Gmail or creating Linear tickets, orchestrated by a Dispatcher agent (12:25). The core value proposition of Arcade is demonstrated by simplifying OAuth: managing three separate configurations (Sheets, Gmail, Linear) that would otherwise require about 200 lines of custom code is reduced to about 30 lines using a single API key and automated token refresh/retry logic (13:31). The orchestration is handled by a 'Claude (Team Lead)' agent in Layer 2, which delegates tasks to specialized agents like the 'Scout' (Layer 1) for data retrieval and the 'Analyst' (Layer 1) for data formatting (15:14). The design emphasizes modularity, meaning any layer can be swapped out without disrupting the others, provided the interfaces remain consistent (1:08, 12:44).

### Three-Layer Agent Architecture

- Layer 1: Data Source (Direct HTTPS, no Arcade needed)
- Layer 2: Processing + Memory (Via Arcade, OAuth handled automatically)
- Layer 3: Presentation/Delivery (Via Arcade for Gmail, Linear)

### Layer 1

- Data Source (ClinicalTrials.gov API): Uses 4 tools for direct HTTPS calls: search_trials, get_trial_details, get_trial_results, check_for_updates
- 4 tools directly connect to ClinicalTrials.gov (10:51)

### Layer 2

- Processing + Memory: Uses Google Sheets as Watchlist Memory
- Memory Agent uses 3 tools via Arcade (save_to_watchlist, get_watchlist, update_watchlist) to interact with Arcade API (11:17)

### Layer 3

- Presentation/Delivery: Dispatcher uses 2 tools via Arcade + 1 local tool (generate_digest, send_digest_email, Linear.CreateIssue) to deliver results (12:25)

### Arcade's OAuth Simplification

- Reduces ~200 lines of auth code to ~30 lines by handling token storage, refresh, error handling, and auto-retry for multiple providers (13:31)

### Orchestration

- Claude (Team Lead) orchestrates all agents, delegating data retrieval to the Memory Agent (Layer 2) and analysis to the Analyst agent (Layer 1) (15:15)

### Key Takeaway

- Start simple; only add multi-agent complexity when demonstrably needed, leveraging Arcade for secure, authenticated tool access across layers (5:54)

![Screenshot at 00:40: The three-tier architecture formalized by John J. Donovan in 1992, showing Presentation, Application/Logic, and Data tiers.](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-00-40.jpg)
![Screenshot at 01:15: The modern evolution of the three-tier pattern into agent infrastructure, showing Presentation, Processing/Memory, and Data Source layers, with the Data Source layer now including RAG and vector databases \(2024-2026\).](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-01-15.jpg)
![Screenshot at 02:27: Layer 1: The Integration Problem, comparing M x N integrations \(without MCP\) to the simpler M + N implementations using an MCP.](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-02-27.jpg)
![Screenshot at 04:05: Layer 2: The Augmented LLM, showing the atomic unit of every agent system: LLM core interacting with Retrieval, Tools, and Memory.](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-04-05.jpg)
![Screenshot at 12:09: The finalized three-layer architecture diagram for the Clinical Trials Tracker, illustrating the flow of control and data between the specialized agents in each layer.](https://ss.rapidrecap.app/screens/e9EBl_PK4bw/00-12-09.jpg)
