Observability
Observability is not optional. Every workflow that ships does so with tracing, correction logging, and a changelog entry on day one. This is the bar from Principles #7. The reason is structural: Brain learns from corrections, and the correction loop is dead without instrumentation. Observability is the substrate that makes the iterative approach work over a year, not just a month.The three layers
Brain’s observability stack has three layers, and each serves a different question.Layer 1 — Tracing (primary tool: Langfuse, self-hosted)
Question it answers: what happened on this run, step by step? For every workflow execution, Langfuse captures:- Every LLM call (prompts, model, parameters, tokens, latency)
- Every tool call (inputs, outputs, errors)
- Every retrieval (query, results, sources)
- Every approval gate (who, when, decision)
- The full causal chain from trigger to final output
Layer 2 — Correction logging (application code)
Question it answers: what did the human change about the AI’s draft, and why? This is the most important data Brain produces. It’s not a vendor product — it’s a first-class table in Brain’s Supabase. For every AI-drafted record that a human reviews:- Missing BOM items (Brain’s draft missed a trim)
- Wrong garment category (jacket vs. coat vs. blazer)
- Incorrect button count (image analysis miscounted)
- Wrong fabric interpretation (polyester vs. cotton blend)
- Missing hidden trims (interlining, fusing)
- Incorrect client PIC (wrong person inferred from email signature)
- Wrong style reference (parsed from wrong field)
- Duplicate style confusion (near-match handled poorly)
Layer 3 — Eval datasets (added at Phase 2-3)
Question it answers: is the current version of Brain better or worse than the previous version on a measurable subset of fields? This is where Braintrust gets added, but not on day one. Braintrust is an eval platform — it runs structured tests against your model using labeled examples. On day one, we have zero labeled examples and zero eval datasets. Adding Braintrust now means buying a tool that sits empty. We add Braintrust at month 2-3 when:- The correction log has enough examples to build datasets from
- We have measurable accuracy targets (e.g., “BOM line completeness ≥ 90%”)
- We need CI gates that prevent prompt or model regressions
Workflow debugging tools
- LangGraph Studio — visual debugger for Tier 2 workflows. Free, local, already wired into the deer-flow runtime. Engineers use it during development.
- Langfuse self-hosted UI — runtime trace viewer for production runs.
What we explicitly don’t use
- LangSmith — SaaS, sees all data. Use during very-early prototype if needed, but flip to Langfuse before Mai sees the system.
- Laminar — wired into deer-flow but ecosystem is thinner; skip unless specific need arises.
- Generic LLM-only observability tools (Helicone, etc.) — proxy-level visibility doesn’t capture the workflow state we need.
What ships on day one
For the first workflow (Tech Pack → BOM):- Langfuse self-hosted instance, configured and validating traces
- LangGraph Studio for dev work
correctionstable in Brain’s Supabase with the schema above- Application code that writes a correction row on every human edit of a BOM draft
- Changelog entry in this documentation
What we measure
Workflow metrics
AI quality metrics
Business metrics
Related
- Principles — why every shipped feature requires observability
- Roadmap — when Braintrust gets added
- Tech Pack → BOM — first workflow to feed the correction log