MeridianDocsSign in
Internals

Architecture

How the frontend, backend, agent, model providers and Shadow fit together, and how one turn of the conversation flows.

Architecture: the frontend and CLI talk to the Rust backend, which runs the agent and calls model providers through Shadow

Shadow is Meridian's privacy layer. Every model call passes through it: your company name, people, emails and secrets are swapped for consistent stand-ins on the way out, and the real values are restored in the answer. See Shadow privacy layer.

FolderResponsibility
backend/coreBusiness rules: loads content/, generates roadmaps, levels and badges. No other IO
backend/llmOne streaming, tool-using interface over every model provider; retries; the Shadow wrapper
backend/agentTool definitions, the system prompt, the tool loop (stops when a card needs you), the offline guide, the card protocol
backend/serverHTTP API, sessions, SQLite storage, streaming chat, uploads, audit room, ledger
cliThe meridian command
frontendNext.js app: these docs at /, the product at /app. It proxies /api to the backend so cookies stay same-origin
contentFrameworks, policy templates and training courses, as plain JSON and Markdown

A turn, step by step

  1. The browser POSTs a message, or an answer to a card, to /api/threads/:id/messages and reads the streamed response.
  2. The backend applies the card answer. That may run an approved action, such as completing a task. It then stores your message.
  3. It builds the system prompt from a fresh programme snapshot and replays the conversation as history.
  4. The agent streams the model through Shadow. Text, tool status and cards are forwarded to the browser as they happen.
  5. Tool calls run against the database. A tool that asks you something ends the turn.
  6. The agent's reply is saved and the stream closes. Everything meaningful is written to the ledger.

Go deeper