@@ -226,44 +226,80 @@ cd frontend && npm install && npm run build
226226
227227``` mermaid
228228flowchart TB
229- subgraph SDK["SDK Layer"]
229+ %% ── Styles ──────────────────────────────────────────────────────────
230+ classDef sdk fill:#4f46e5,stroke:#3730a3,color:#fff,stroke-width:2px
231+ classDef api fill:#059669,stroke:#047857,color:#fff,stroke-width:2px
232+ classDef store fill:#b45309,stroke:#92400e,color:#fff,stroke-width:2px
233+ classDef ui fill:#7c3aed,stroke:#6d28d9,color:#fff,stroke-width:2px
234+ classDef intel fill:#dc2626,stroke:#b91c1c,color:#fff,stroke-width:2px
235+ classDef ext fill:none,stroke:#64748b,stroke-dasharray:5 5,color:#64748b
236+
237+ AGENT["🤖 Your Agent"]:::ext
238+
239+ %% ── Instrumentation Layer ────────────────────────────────────────────
240+ subgraph SDK[" 🔌 SDK — Instrumentation Layer "]
230241 direction LR
231- DEC["@trace decorator"]
232- CTX["trace_session()"]
233- AP["Auto-Patch"]
234- AD["Framework Adapters"]
242+ DEC["@trace<br/> decorator"]:::sdk
243+ CTX["TraceContext<br/>session mgmt"]:::sdk
244+ AP["Auto-Patch<br/>zero-config"]:::sdk
245+ AD["Adapters<br/>LangChain · Pydantic-AI<br/>CrewAI · AutoGen · LlamaIndex"]:::sdk
235246 end
236247
237- subgraph API["API Layer — FastAPI"]
248+ %% ── Collector & Intelligence ─────────────────────────────────────────
249+ subgraph INTEL[" 🧠 Collector & Intelligence "]
238250 direction LR
239- R1["Sessions"]
240- R2["Traces"]
241- R3["Replay"]
242- R4["Search"]
243- R5["Analytics"]
244- SSE["SSE Stream"]
251+ BUF["Event Buffer<br/>Redis / In-Mem"]:::intel
252+ PAT["Pattern Detector<br/>loop · drift · anomaly"]:::intel
253+ FMEM["Failure Memory<br/>embedding search"]:::intel
254+ ALERT["Alert Engine<br/>guardrail · policy"]:::intel
255+ RPLAY["Replay Engine<br/>checkpoints · deltas"]:::intel
245256 end
246257
247- subgraph STORE["Storage Layer"]
258+ %% ── API Layer ────────────────────────────────────────────────────────
259+ subgraph API[" 🌐 API — FastAPI + SSE "]
248260 direction LR
249- S1["Sessions"]
250- S2["Events"]
251- S3["Checkpoints"]
252- S4["Snapshots"]
261+ R1["Session<br/>CRUD"]:::api
262+ R2["Trace<br/>query · filter"]:::api
263+ R3["Replay<br/>step · seek"]:::api
264+ R4["Search<br/>keyword · NL"]:::api
265+ R5["Analytics<br/>cost · patterns"]:::api
266+ R6["Compare<br/>side-by-side"]:::api
267+ SSE["SSE Stream<br/>live events"]:::api
253268 end
254269
255- subgraph UI["Frontend — React + TypeScript"]
270+ %% ── Storage Layer ────────────────────────────────────────────────────
271+ subgraph STORE[" 💾 Storage — SQLite + Async "]
256272 direction LR
257- DT["Decision Tree"]
258- TI["Tool Inspector"]
259- SR["Session Replay"]
260- FC["Failure Clustering"]
261- MA["Multi-Agent View"]
273+ DB[("🗄️ SQLite<br/>WAL mode")]:::store
274+ S1["Sessions<br/>events · checkpoints"]:::store
275+ S2["Analytics DB<br/>aggregations"]:::store
276+ S3["Embeddings<br/>vector search"]:::store
262277 end
263278
264- SDK -- "HTTP / WebSocket" --> API
265- API -- "SQLite / PostgreSQL" --> STORE
266- UI -- "REST + SSE" --> API
279+ %% ── Frontend Layer ──────────────────────────────────────────────────
280+ subgraph UI[" 🖥️ Frontend — React + TypeScript + Vite "]
281+ direction LR
282+ U1["Decision<br/>Tree"]:::ui
283+ U2["Trace<br/>Timeline"]:::ui
284+ U3["Tool<br/>Inspector"]:::ui
285+ U4["Session<br/>Replay"]:::ui
286+ U5["Search<br/>cross-session"]:::ui
287+ U6["Analytics<br/>Dashboard"]:::ui
288+ U7["Session<br/>Comparison"]:::ui
289+ end
290+
291+ %% ── Data Flow ───────────────────────────────────────────────────────
292+ AGENT ==>|"instrument"| SDK
293+ SDK -->|"emit events"| BUF
294+ BUF --> PAT & FMEM & ALERT
295+ BUF -->|"persist"| S1
296+ S1 --> DB
297+ DB --> S2 & S3
298+
299+ SDK -.->|"ingest"| R1
300+ R1 & R2 & R3 & R4 & R5 & R6 <-->|"async queries"| S1
301+ SSE -->|"stream"| UI
302+ RPLAY -->|"checkpoint restore"| R3
267303```
268304
269305See [ ARCHITECTURE.md] ( ./ARCHITECTURE.md ) for full module breakdown.
0 commit comments