← Home
Technical Series 8 of 8 issues

Agent Design Fieldbook

An 8-layer architecture for production AI agents — from data layer to RAG. Real code, real failures, battle-tested patterns for engineers and technical founders.

01

The Foundation: Why Most AI Agents Fail in Production

Most AI agents are wrappers that crash in production; production agents are systems with 8 deterministic layers where the LLM is constrained, not trusted.

12 min read · ai, agents, engineering
02

The Data Layer: Your Agent Is Only As Good As Your Data

LLMs will hallucinate field names and values unless you explicitly define what's real through schemas, field registries, and validation boundaries.

11 min read · ai, agents, engineering
03

The Ingestion Layer: Getting Messy Data Into Your Clean Schema

Vendor data is chaos -- different units, formats, nulls, duplicates; ingestion is 80% of the work, and scripts beat pipelines for flexibility.

11 min read · ai, agents, engineering
04

The Intent Layer: Classify Before You Act

The first LLM call should classify what the user wants (search, compare, select), not execute it -- then route to specialized handlers that do one job well.

11 min read · ai, agents, engineering
05

The Filter Extraction Layer: From Natural Language to Query

LLMs are excellent at extracting filters from natural language, but terrible at enforcing boundaries -- inject your field registry, validate everything, and relax constraints when needed.

14 min read · ai, agents, engineering
06

The Memory Layer: Conversations That Persist

Agents need memory -- not just chat history, but structured context (what was fetched, what was selected, what tokens were used) persisted to database for multi-turn conversations.

15 min read · ai, agents, engineering
07

The Sort & Rank Layer: Ordering Results Intelligently

Sorting isn't just ORDER BY -- define what 'best' means for each field, handle JSONB with SQL expressions, and let the LLM infer user intent from keywords like 'cheapest' or 'best'.

11 min read · ai, agents, engineering
08

The Product Deep-Dive Layer: When Users Want More Than Specs

When users want to go deep on a product -- reading reviews, understanding thermal performance, checking compatibility -- RAG lets you search unstructured knowledge that doesn't fit in structured columns.

16 min read · ai, agents, engineering