ServicesAboutNotesContact Get in touch →
EN FR
Note

Layered AI Stack for Analytics Engineering

The mental model of thinking about AI tools in layers — IDE, coding agent, orchestration, review — rather than choosing a single tool for everything

Planted
claude codedbtaiautomation

AI tooling for analytics engineering benefits from the same layered mental model as the modern data stack: ingestion, transformation, orchestration, serving. Each layer has a clear responsibility and a clear handoff to the next. The useful question is “which layer of my AI stack should handle this?” rather than “which AI tool should I use?”

The Four Layers

LayerRoleExample ToolsBest For
1 - IDE assistantReal-time completions, inline helpCursor, GitHub CopilotQuick edits, exploring unfamiliar code, single-file changes
2 - Coding agentMulti-file operations, iterative buildsClaude Code, DevinBuilding models end-to-end, refactoring, debugging
3 - OrchestrationScheduling, monitoring, non-coding automationOpenClawCron-based testing, alerting, background tasks
4 - Code reviewSecond opinion before mergingGemini Code Assist, PR reviewersCatching errors the tool that wrote the code won’t

Each layer fills a gap the others can’t. The IDE assistant is fast but shallow — it operates within a single file and doesn’t run commands. The coding agent is deep but session-bound — it works in bursts when you invoke it. The orchestration layer runs around the clock but isn’t built for precise code generation. The review layer provides a fresh perspective, uncorrupted by the assumptions the generating tool made.

Why Layers, Not a Single Tool

The temptation is to find one tool that does everything. In practice, the tools have fundamentally different interfaces and capabilities that make them suited to different types of work.

An IDE assistant like Cursor excels when you need speed: add a column, fix a filter, understand a CTE. You’re in the flow, the context is small, and the edit is surgical. Switching to a terminal-based coding agent for that kind of work adds friction without proportional value.

A coding agent like Claude Code excels when you need depth: build a model from scratch, refactor a lineage chain, generate tests and documentation in one session. The agent reads the full project structure, follows conventions from your CLAUDE.md, runs dbt compile to verify, and fixes errors in a feedback loop. An IDE autocomplete can’t do this — it doesn’t have the interface for running commands and iterating on output.

An orchestration layer like OpenClaw handles work that shouldn’t require your attention at all: running dbt test at 7 AM, alerting on failures, checking pipeline status. This isn’t a task you’d open an IDE for. It’s background infrastructure.

The review layer exists because the tool that wrote the code is the worst judge of its own mistakes. Claude Code catches many errors during its build-test-fix loop, but it won’t catch the subtle judgment calls — wrong join types, silently filtered rows, inappropriate assumptions about business logic. A dedicated review step, whether automated or human, provides the independent perspective that self-correction can’t.

How Layers Relate to AI Tool Tiers

The AI Tool Tiers for Data Engineering note categorizes AI tools by capability: autonomous agents, copilots, chat assistants, and platform-embedded AI. The layered stack model is different — it’s about how you compose tools in practice, not how you classify them in theory.

A tool can belong to one tier but serve a different layer depending on how you use it. Cursor uses Claude models under the hood (same tier-1 AI capability), but in a layered stack, it fills the IDE layer role because its interface is optimized for real-time inline editing, not multi-file agent work. The layer is defined by the workflow, not the underlying model.

The Handoff Problem

The biggest weakness of a layered approach is coordination between layers. Each tool starts with its own context. Claude Code doesn’t know what the orchestration layer found overnight. The IDE assistant doesn’t know which models the coding agent just refactored. There’s no shared memory.

The Cascading Agent Pattern is the closest thing to a solution: the orchestration layer triggers the coding layer with specific context about what it detected. But even that is a point-to-point handoff, not a unified context layer.

What holds a layered stack together today is shared files: CLAUDE.md for project conventions, dbt_project.yml for configuration, Git branches for code state, and Slack channels for communication. It’s not elegant, but it works because each tool can independently read the same project files and follow the same conventions.

When Layers Are Overkill

Not every analytics engineer needs four layers. A data engineer working on a single project with a stable codebase might need only layers 1 and 2. The orchestration layer matters most when you’re managing multiple projects or need round-the-clock monitoring. The review layer matters most when you’re deploying AI-generated code to production without a human code review step.

Start with the layer that addresses your biggest pain point. For most analytics engineers, that’s layer 2 (a coding agent for model generation and testing). Add layers when you feel the gap — when you catch yourself doing something manually that a different type of tool could handle.

The Decision Framework

The layered model provides a decision framework independent of specific tools. When a dbt test fails, the monitoring layer catches it, the coding layer fixes it, and the orchestration layer connects them. The layer determines which tool to reach for.

The modern data stack matured the same way: the question shifted from “Fivetran or custom scripts?” to “which tool fills the ingestion layer?” AI tooling for analytics engineering is at the same point. The specific tools will change; the layers are more durable.