> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 架构文档

本目录是 retaintive 系统的**封面级展示** — 回答"我们做了个什么系统"。给新成员 / 产品 / AI agent 快速建立心智模型。

> **不是工程实操层。** 字段细节 / 隔离设计 / pattern 选型 → 见 [系统设计](/system-design.md)。

***

## 4 类文档,按需选择

### 跨层 / 全景

- [**0-system-overview.md**](/architecture/0-system-overview.md) — repo / 存储 / 跨 repo 共享 / 环境
  回答"系统由哪些 repo / runtime / 存储组成?跨 repo 边界在哪?"

### 前端

- [**1-frontend.md**](/architecture/1-frontend.md) — Vue 3 SPA / 5 层架构 / 174 页面 / 38 query hook / 部署
  回答"前端代码怎么分层?数据怎么从浏览器走到 studio-api 再回来?怎么部署?"

### 后端

- [**2-backend.md**](/architecture/2-backend.md) — 后端 Pipeline 全景 / 5 Lambda / 共享写入层 / 7 AI prompt
  回答"通话 / 短信 / Lead 进系统后怎么处理?Phase 1 收口到哪一步?7 AI prompt 都在哪?"

### Prompt 架构

- [**3-prompt-architecture.md**](/architecture/3-prompt-architecture.md) — Prompt / Zod schema / domain registry / LLM call / deterministic guard 职责边界
  回答"prompt 里应该写什么?definition 从哪来?final output contract 怎么给 AI?6 份 prompt draft 接入前怎么 review?"

***

## 怎么读

- **新成员 / 不熟悉 retaintive**: 从 [0-system-overview.md](/architecture/0-system-overview.md) 开始(repo / 存储边界)
- **改前端代码**: [1-frontend.md](/architecture/1-frontend.md) → Layer 2 五层架构定位代码位置
- **改后端 Lambda**: [2-backend.md](/architecture/2-backend.md) → Layer 3a Prompt 全景 + Layer 3b Before-After
- **改 AI prompt / review prompt draft**: [3-prompt-architecture.md](/architecture/3-prompt-architecture.md) → Prompt template + schema audit checklist
- **不知道某个文档放哪**: 工程实操 / 字段细节 → [system-design/](/system-design.md) ; 全景 / 概念 → 本目录
