Skip to main content
ENSK
PracticeElektrikProJARVISBlog
Reference · Stack

Six layers. Every pick defended.

The defaults Sebrona runs at each of six layers, with the ADR rationale behind every pick. Every cell has an ADR in the engagement repo; every swap is documented. Bookmarkable, forwardable. The §06 prose on the home page carries the same six layers in narrative form; this is the version you forward to your CTO and security team.

Last reviewed · 2026-05-24Next review · 2026-08-24Reviewer: Miroslav Striško
Layer by layer

The default at each floor, and why.

L5 · INTERFACE
Web · React/TS·Mobile · React Native·Chat · copilot·Dashboards · embeds

React + TypeScript on the web, React Native for the mobile clients. The component primitives are shared across both. We don’t double-build the design system.

Why:React + RN share the same component primitives so we don't double-build the design system. tRPC types reach the props on both clients; one schema change, one type error to fix.

L4 · API GATEWAY
tRPC + Zod·REST · OpenAPI·Webhooks·Auth · RLS

tRPC + Zod is the default. One contract from DB row to React prop. We drop to REST when an external consumer needs OpenAPI; the validation discipline is the same either way.

Why:tRPC + Zod gives one validated contract from DB row to React prop with no codegen step. We drop to REST + OpenAPI only when an external consumer demands it; the Zod schemas double as the OpenAPI generator input.

L3 · ORCHESTRATION
LangGraph · MCP servers·Langfuse · OTel·Promptfoo · Inspect AI·n8n · queues

LangGraph for stateful agent flows we run from spec to cutover; LiteLLM as the router behind the routing.policy.yaml signed off in week 1. Tool surfaces standardise on Model Context Protocol. Same server contract for Claude, local models, and the IDE. n8n behind a queue for analyst-facing automations the client will edit themselves. Langfuse for trace-level observability and prompt-version diffs; Promptfoo as the CI gate. Eval harness and prompt-and-model registry live in this layer, not as an afterthought.

Why:LangGraph for stateful agent flows that need explicit graph control. MCP for tool surfaces because one server contract reaches Claude, local OSS, and the IDE. Langfuse for prompt-version diffs and trace-level observability; Promptfoo as the CI gate so a red eval blocks merge.

L2 · MODEL LAYER
Claude · GPT·Local OSS·Cohere rerank-3·Voyage-3 · BGE-M3

Routing policy decides which model sees which prompt. Hosted frontier when reasoning load is high and data is non-sensitive; local open-weight when sovereignty wins, at the cost of GPU capex and a real gap on the hardest prompts.

Why:Hosted Claude or GPT when reasoning load is high and the data is non-sensitive. Local OSS (Qwen 3, Mistral Small 3.2, both Apache-2.0) when sovereignty wins, accepting the GPU capex and the real gap on the hardest prompts. Voyage-3 + BGE-M3 sit at the top of the MTEB retrieval leaderboard in 2026; we default to Voyage-3 hosted for English/code corpora and self-host BGE-M3 on sovereignty-strict ones. Cohere rerank-3 on top-50.

L1 · DATA
Postgres·pgvector·Object store·Event stream

One database until we prove we need two. pgvector keeps retrieval next to the row it grounds; we’ll move to a dedicated vector store only when scale forces it, and we’ll write the ADR explaining why.

Why:Postgres + pgvector first because the retrieval index sits next to the data it grounds. One schema, zero cross-store consistency code. A dedicated vector store earns its row in the diagram only when QPS or recall forces the move; the ADR captures the threshold and the date we crossed it.

L0 · INFRA
Cloudflare · EU·Supabase · Frankfurt·OTel + SLOs·Vault · KMS

EU data boundary by default, on-prem when the regulator requires it. Secrets in a KMS, never in env files. SLOs and error budgets agreed in week one. What we won’t measure, we won’t bill for.

Why:EU data boundary by default. On-prem when the regulator requires it. KMS for secrets, never env files. SLOs and error budgets agreed in week one so the on-call obligation is bounded by something both sides signed.

Discipline

Discipline that runs through every layer.

Type safety across the whole stack (tRPC + Zod, no untyped JSON across a network hop). Eval harness on every prompt route, CI-gated via Promptfoo or Inspect AI. Prompt-and-model registry. Every route pinned to a version, one-command rollback. OpenTelemetry traces from edge to model and back, with token and cost as span attributes. Default-deny data policies, PII redaction at the network boundary, egress allowlist. ADRs in-repo for every architectural decision worth defending. Preview to main on Cloudflare Pages in under six minutes; rollback is `git revert`; database migrations are reversible or they don't ship.

Want this stack for a real engagement?

You've read the defaults. The first call is about three things: which cells your team swaps for an incumbent, which ADRs we co-author in week one, and what your evals already cover. Bring the questions. We answer on the call.