# Pleach > A typed agent runtime where every tool call and subagent spawn rolls up to the turn — joinable to billing or compliance in one GROUP BY. Pleach is a fair-source agent-runtime ecosystem published under the `@pleach/*` scope on npm. The runtime contract is language-agnostic; the TypeScript distribution at `@pleach/core` is the reference implementation, with an independent Go implementation keeping the wire shapes honest. Every LLM call inside an agent is classifiable, auditable, and replayable — sessions, checkpointing, reactive channels, family-locked model routing, and an append-only per-call audit ledger. Pleach composes underneath an existing Anthropic Enterprise or OpenAI Enterprise contract: per-axis rollup inside one Workspace or Project (external customers in a SaaS, or employees / teams / cost-centers when used internally), a hash-chained `AuditableCall` row in your own Postgres, and replay-deterministic regression across model snapshots. The vendor contract keeps doing its job; `tenantId` on the row is the opaque axis you wire to billing or audit. `@pleach/core@1.x` ships under FSL-1.1-Apache-2.0 (the Functional Source License) — source-available with automatic conversion to Apache-2.0 two years after each release. ## Start here - [Pleach](https://getpleach.com/docs): A typed agent runtime where every tool call and subagent spawn rolls up to the turn — joinable to billing or compliance in one GROUP BY. - [Overview](https://getpleach.com/docs/overview): The conceptual map — what Pleach is, what a turn looks like, what gets recorded, and which door to open next. - [Getting started](https://getpleach.com/docs/getting-started): From npm install to a streaming chat handler — one wizard or two snippets. - [@pleach/recipes changelog](https://getpleach.com/docs/changelog/recipes): Release history for @pleach/recipes — site-docs entries that materially touched the recipes surface, newest-first. Canonical runtime history lives upstream. ## Project layout - [Project layout](https://getpleach.com/docs/project-layout): Pleach doesn't prescribe a layout. The runtime is constructed in user code; adapters are constructor args. A working default plus per-use-case shapes. - [Agent shapes](https://getpleach.com/docs/agent-shapes): Reference agent designs Pleach is built for — each pairs a recurring production pattern with the runtime primitive that handles it and the team shape it shows up in. - [Reference apps](https://getpleach.com/docs/reference-apps): Two runnable examples that ship inside the @pleach/core npm package — minimal-agent for first-turn baselines, host-adapter for legacy-orchestrator integrations. - [Comparison](https://getpleach.com/docs/comparison): How @pleach/core compares to the AI SDK, LangChain, LlamaIndex, Mastra, and to agent harnesses like Claude Code, Goose, OpenHands, AutoGen, and CrewAI. - [Concept clusters](https://getpleach.com/docs/concept-clusters): Seven cluster triplets organize the runtime — session/turn/row on top, then execution-graph, routing, audit-ledger, lifecycle, and persistence one click in. ## Use cases - [Customer support agent](https://getpleach.com/docs/customer-support-agent): A multi-turn support agent with tool-backed lookups, human escalation, and a per-customer audit trail you can hand to a regulator without grep. - [Deep research agent](https://getpleach.com/docs/research-agent): An anchor agent that dispatches bounded subagents, with depth-tracked fanout and a turn-rooted tree you can read top-down from the ledger. - [@pleach/coding-agent changelog](https://getpleach.com/docs/changelog/coding-agent): Release history for @pleach/coding-agent — site-docs entries that materially touched the @pleach/coding-agent surface, newest-first. Canonical runtime history lives upstream. - [Internal knowledge agent](https://getpleach.com/docs/internal-knowledge-agent): A retrieval-grounded agent over your private docs — with per-chunk provenance in the audit ledger and a "no chunk, no answer" safety policy. - [Multi-tenant SaaS agent](https://getpleach.com/docs/multi-tenant-saas-agent): The multi-tenant SaaS agent shape — recurring per-tenant pattern, the primitives that handle it, the ops surface around it. - [Regulated-domain agent](https://getpleach.com/docs/regulated-domain-agent): An agent built for HIPAA, SOC 2, PCI, FedRAMP, or 21 CFR Part 11. Constrained routing, PII gate, append-only ledger keyed for the regulator's query. - [Region-pinned agent](https://getpleach.com/docs/region-pinned-agent): An agent that pins region, family, and model per call class — with parity-validation suites and deterministic failover discipline a procurement reviewer can read. - [Cloud-routed agent](https://getpleach.com/docs/cloud-routed-agent): An agent reaching Anthropic, OpenAI, or Google models through AWS Bedrock, Azure OpenAI Service, or Vertex AI — IAM-federated, VPC-bound, region-enforced. - [Swarm agent](https://getpleach.com/docs/swarm-agent): An agent that spawns subagents at scale — deep sequential loops, parallel fan-out, supervisor/worker topologies, recursive delegation — with cost ceilings and a session-tree audit walk. ## Architecture - [Architecture](https://getpleach.com/docs/architecture): The substrate view of @pleach/core — six pieces, one stage lattice, and the boundary rules CI enforces. Each piece links to its deep-dive page. - [Language-agnostic contract](https://getpleach.com/docs/language-agnostic-contract): Which shapes are the contract — the wire shapes, checkpoint envelope, audit row, sync vectors, event log — versus implementation details. What an independent client must implement. - [Packages](https://getpleach.com/docs/packages): The @pleach/* package matrix — what each SKU does and how they compose. ## Core primitives - [@pleach/core changelog](https://getpleach.com/docs/changelog/core): Release history for @pleach/core — site-docs entries that materially touched the @pleach/core surface, newest-first. Canonical runtime history lives upstream. - [SessionRuntime](https://getpleach.com/docs/session-runtime): The main entry point — construct a runtime, create sessions, execute messages, and consume the stream. - [TurnOrchestrator (formerly OrchestratorClient)](https://getpleach.com/docs/orchestrator-client): Per-turn handle threaded through the stream body — six typed facets (config, history, context, tools, model, prompts) plus the graph snapshot. - [Providers](https://getpleach.com/docs/providers): Wire an LLM provider into the runtime — Vercel AI SDK, Anthropic SDK, or your own — through the `AgentProvider` interface. - [@pleach/tools changelog](https://getpleach.com/docs/changelog/tools): Release history for @pleach/tools — site-docs entries that materially touched the @pleach/tools surface, newest-first. Canonical runtime history lives upstream. - [Prompts](https://getpleach.com/docs/prompts): Compose system prompts from typed contributions — namespaced ids, static vs runtime-aware split, budgeted composition, and the replay-safety invariant. - [Prompt builder](https://getpleach.com/docs/prompt-builder): `composeBudgetedPrompt` — the deterministic composer that turns resolved contributions into the final system prompt with quantized budget math. - [Facet accessors](https://getpleach.com/docs/facets): runtime.* / TurnOrchestrator.* / graph.* — a discoverable, typed surface designed to be read by humans and LLM agents. Stable shape, audited for coverage. ## Composing agents - [Agents](https://getpleach.com/docs/agents): AgentRegistry — persistent per-spec profiles with a rolling 100-invocation window, derived stats, and a trend signal. - [Subagents](https://getpleach.com/docs/subagents): Spawn child runtimes from a tool call. Every child call lands on the ledger with parent_turn_id and subagent_depth — fan-out rolls back to the parent turn. - [Skills](https://getpleach.com/docs/skills): SkillLoader loads markdown skills from three sources, matches them by user intent, and injects the body into the system prompt as a contribution. - [Plans](https://getpleach.com/docs/plans): PlanManager — multi-step plans with stable step IDs, revision history, and a next-step picker that respects dependencies. - [Memory](https://getpleach.com/docs/memory): Background fact extraction from conversation transcripts, cross-agent consolidation, and a confidence-decay audit surface. ## Execution graph - [Graph](https://getpleach.com/docs/graph): The declarative topology that drives a turn — Annotation channel schema, StateGraph builder, Send fan-out, compile() runner, and the four-stage lattice gate that keeps every node attributable. - [Nodes](https://getpleach.com/docs/nodes): The node shape — an async function plus typed metadata declaring stage membership, seam consumption, and the channels read and written. - [Channels](https://getpleach.com/docs/channels): The six channel kinds — LastValue, BinaryOperatorAggregate, Topic, EphemeralValue, NamedBarrier, DataChannel — with their concurrent-write semantics and reducers. ## Routing - [Seams](https://getpleach.com/docs/seams): The per-call-class provider entry point — four seam factories, the singleton synthesize seam invariant, and the sync stream-observer verdict ladder. - [Call classes](https://getpleach.com/docs/call-classes): The four-class taxonomy every LLM call declares — utility, reasoning, converse, synthesize — with the lint that restricts the literal and the structural cap of one synthesize per turn. - [Family-locked routing](https://getpleach.com/docs/family-lock): One ProviderFamily and one Transport lock at session start, freezing tokenizer, prompt-cache key, tool-call dialect, and refusal pattern. The cascade walks in-family rungs only. - [Model resolution matrix](https://getpleach.com/docs/model-resolution-matrix): Which model fires for which call class, resolved per provider family at session start. ## Runtime lifecycle - [Session lifecycle](https://getpleach.com/docs/session-lifecycle): How a session is minted, persisted, resumed, aborted, time-traveled, and deleted — the unit of identity that outlives any single turn. - [Turn lifecycle](https://getpleach.com/docs/turn-lifecycle): What happens between runtime.executeMessage and the final SSE frame — the four-stage execution path, the events the client sees, and the rows the ledger writes. - [Event log](https://getpleach.com/docs/event-log): The broader stream of observable events — distinct from the audit ledger — with durable-flush retries, hydration from events, and named projections. - [Event-log projections](https://getpleach.com/docs/event-log-projections): GraphProjection — folding harness_event_log rows into typed runtime state. The contract is stable; the shipped projections are in soak. - [Stream events](https://getpleach.com/docs/stream-events): Every event type executeMessage yields — message deltas, tool lifecycle, jobs, interrupts, checkpoints, sync, errors. The full catalog with payload shapes. - [Interrupts](https://getpleach.com/docs/interrupts): Pause a turn for human approval — the `HumanInterrupt` envelope, response shapes, per-tool approval, and how interrupts compose with the stream. - [Async tasks](https://getpleach.com/docs/async-tasks): Long-running job dispatch + cancellation — the manager, the executor contract, and the per-thread reducer. ## State & persistence - [Storage](https://getpleach.com/docs/storage): MemoryAdapter, IndexedDBAdapter, SupabaseAdapter — pick the one that matches the environment and wire it into SessionRuntime. - [Cache & memoization](https://getpleach.com/docs/cache): Runtime-side cache for prepared LLM inputs — the CacheBackend contract, the always-on memory default, and the four fingerprint gaps that keep hits correct across modes. - [Checkpointing](https://getpleach.com/docs/checkpointing): Snapshot sessions, restore to any prior point, and time-travel through stuck conversations — the per-channel checkpoint API. - [Sync](https://getpleach.com/docs/sync): Version-vector sync across clients — conflict detection at write time, durable outbox, hybrid logical clock, and the SyncCoordinator API. - [Schema](https://getpleach.com/docs/schema): The 12 SQL files that ship in `@pleach/core/schema/postgres` — what each table holds, the RLS template, and how to apply them. - [Time travel](https://getpleach.com/docs/time-travel): Event-granular session forking and state reconstruction — the read/write API over the checkpointer's history. - [Prompt caching](https://getpleach.com/docs/prompt-caching): The storage surface caching writes through — backend contract, entry shape, and the per-call failure-mode policy. ## Safety & determinism - [Safety policies](https://getpleach.com/docs/safety): SafetyContribution is structurally distinct from PromptContribution — registered policies stay inert until an operator opts in. - [Scrubbers — redaction at write time](https://getpleach.com/docs/scrubbers): The Scrubber contract that gates event log writes through allowlisted redactors — SSN-US, Luhn, US-DL, KeyedRegex out of the box, plus the contributeScrubbers plugin hook. - [Fabrication detection](https://getpleach.com/docs/fabrication-detection): Multi-signal wipe pipeline — what `applyFabricationGuard` removes from a synthesized turn and the detectors it composes. - [Determinism](https://getpleach.com/docs/determinism): Why every primitive in `@pleach/core` is deterministic by contract — the replay story end-to-end, the invariants that hold it together, and the four ways it breaks. - [Fingerprint](https://getpleach.com/docs/fingerprint): The cache-key tuple — what's in it, what's deliberately excluded, why the split matters for caching, replay, and audit. ## Audit ledger - [Audit ledger](https://getpleach.com/docs/audit-ledger): The ProviderDecisionLedger write interface, the AuditableCall row it persists, the three compliance plug-points, and how to wire your own adapter. - [The AuditableCall row](https://getpleach.com/docs/auditable-call-row): The typed, append-only row shape that every LLM invocation writes to the audit ledger — identity, principal, call, decision, outcome, and typed payload slots. - [Tamper-evident hash chain](https://getpleach.com/docs/hash-chain): prev_hash + row_hash columns on the audit-ledger event log — what the chain proves, how rows get verified, and how the default-on writer-side stamping ships in the @pleach/core schema bundle. - [Attestation](https://getpleach.com/docs/attestation): Ed25519-signed envelopes over audit-ledger slices — a pluggable key-store substrate that sits on top of the canonical row hash and turns it into portable, third-party-verifiable evidence. - [Typed auditable-call records](https://getpleach.com/docs/typed-records): Five audit-ledger records promoted from untyped JSON to typed, stage-correlated slots — Interrupt, TokenCost, ToolSelection, PlanGeneration, SynthesisQuality. ## Observability - [Lineage](https://getpleach.com/docs/lineage): Read-side cross-session dependency graph — typed edges between sessions, artifact provenance, and a queryable session-to-session graph for observability. - [Observability](https://getpleach.com/docs/observability): Read-side wiring for OpenTelemetry, Datadog, Honeycomb, and Prometheus — span decorators, lifecycle-event streaming, and the patterns that don't fight the substrate's contracts. - [OTEL spans & exporter wiring](https://getpleach.com/docs/otel-observability): Four read-side span types — session.turn, llm.invocation, graph.stage, tool.execution — with parent-threading, auto-flush, the runtime.spans facet, and a minimal OTLP exporter wiring. - [Runtime inspector](https://getpleach.com/docs/runtime-inspector): `inspectRuntime()` — the typed read-only introspection surface for which `contribute*` hooks a constructed `SessionRuntime` actually has wired. ## Plugins & strategies - [Plugin contract](https://getpleach.com/docs/plugin-contract): The HarnessPlugin extension surface — what plugins can do, what they can't, and the structural invariants the substrate enforces against them. - [Plugin authoring standards](https://getpleach.com/docs/plugin-authoring-standards): Conventions for naming, versioning, file layout, peer dependencies, license, and deprecation of plugins built against @pleach/core. Lint-enforced where mechanical, doc-recommended where judgment matters. - [Plugin bundles](https://getpleach.com/docs/plugin-bundles): Thematic facet sub-paths for plugins that span multiple semantic domains — barrel imports, define-helpers, and composePlugin. The second DX layer above HarnessPlugin, peer-equivalent to definePleachPlugin. - [Runtime strategies](https://getpleach.com/docs/runtime-strategies): Typed strategy slots on SessionRuntimeConfig — single-shape, single-consumer fields the host fills with domain code. The companion surface to the plugin contract. - [streamSingleTurn](https://getpleach.com/docs/stream-single-turn): The canonical per-turn body — what runs between executeMessage and the final stream frame. Consumes the typed strategy slots and OrchestratorClient. ## Frontend integration - [@pleach/react changelog](https://getpleach.com/docs/changelog/react): Release history for @pleach/react — site-docs entries that materially touched the @pleach/react surface, newest-first. Canonical runtime history lives upstream. - [HarnessServer](https://getpleach.com/docs/server): Framework-agnostic HTTP handlers wrapping the runtime — mount the routes into Next.js, Express, Hono, or any HTTP layer. - [API routes](https://getpleach.com/docs/api-routes): The HTTP + SSE wire contract — eight routes that any runtime client speaks, with request/response shapes for each. - [Query](https://getpleach.com/docs/query): Server-only read API over persisted harness data — usage, transcripts, events, jobs, assets, tools, analytics. Uses a service-role Supabase client and bypasses RLS; never import into browser bundles. - [DevTools](https://getpleach.com/docs/devtools): `window.__HARNESS_DEVTOOLS__` — the browser-console surface for inspecting sessions, walking checkpoints, forcing syncs, and listing tools during development. ## Compose & migrate - [Adoption paths](https://getpleach.com/docs/adoption-paths): Two ways to adopt Pleach — brownfield (hook @pleach/observe into your existing agent loop) or greenfield (take @pleach/core as your substrate). - [Migrating from Anthropic Enterprise](https://getpleach.com/docs/migrating-from-anthropic-enterprise): Keep your Anthropic Enterprise contract. Pleach closes three downstream gaps: per-axis cost rollup, an audit row in your DB, replay-deterministic eval. - [Migrating from OpenAI Enterprise](https://getpleach.com/docs/migrating-from-openai-enterprise): Keep your OpenAI Enterprise contract. Pleach sits underneath — AuditableCall row in your Postgres, per-axis rollup inside a Project, replay-deterministic eval. - [Migrating from the Vercel AI SDK](https://getpleach.com/docs/migrating-from-ai-sdk): Move from `streamText` + `useChat` to a `SessionRuntime` — what maps cleanly, what doesn't, and how to keep the AI SDK as your provider. - [Migrating from LangChain](https://getpleach.com/docs/migrating-from-langchain): Move from `Runnable` chains, agents, and LangGraph to a `SessionRuntime` — what maps cleanly, where the models differ, and what to keep. - [Pleach + Anthropic SDK](https://getpleach.com/docs/with-anthropic-sdk): Coexist with the Anthropic SDK. Keep prompt caching, tools API, batches, files; add @pleach/core for AuditableCall, family-lock, replay. - [Pleach + OpenAI SDK](https://getpleach.com/docs/with-openai-sdk): Coexist with the OpenAI SDK. Keep Chat Completions, Responses API, structured outputs; add @pleach/core for AuditableCall, family-lock, replay. - [Pleach + Mastra](https://getpleach.com/docs/with-mastra): Coexist with Mastra — keep the workflow primitive, the hosted dashboard, vector DB, and evals; add `@pleach/core` for the audited LLM turn inside the step. Not a migration. - [Pleach + Inngest](https://getpleach.com/docs/with-inngest): Coexist with Inngest (or Trigger.dev / DBOS / Temporal) — keep durable steps, retries, and scheduling; add `@pleach/core` as the LLM-turn substrate inside the step. Not a migration. - [MCP integration](https://getpleach.com/docs/mcp-integration): Integrate MCP servers from `@pleach/core` today — the `defineTool` wrapper pattern. Distinct from the `@pleach/mcp` SKU (see [/docs/mcp]). - [@pleach/mcp changelog](https://getpleach.com/docs/changelog/mcp): Release history for @pleach/mcp — site-docs entries that materially touched the @pleach/mcp surface, newest-first. Canonical runtime history lives upstream. - [Host adapter](https://getpleach.com/docs/host-adapter): `setHarnessModuleLoader` — the dynamic-import seam hosts mid-migration use to wire their own implementations of capabilities the substrate hasn't fully absorbed yet. - [Eval and replay](https://getpleach.com/docs/eval-and-replay): Regression testing and deterministic replay against the @pleach/core substrate — fingerprint, audit ledger, checkpoints, runtimeMode. The DIY pattern. ## Operations - [Deployment](https://getpleach.com/docs/deployment): Production checklist — environments, schema migrations, observability, rollback strategy, and the Fluid Compute / serverless patterns. - [Platform & operations recipes](https://getpleach.com/docs/platform-recipes): End-to-end implementations for the platform-team patterns — long-running jobs, multi-step interrupts, per-call cost reporting, and OpenTelemetry wiring. - [CLI](https://getpleach.com/docs/cli): The pleach binary ships three subcommands — dev boots a self-contained local playground; init scaffolds a route, page, and plugin stub for your framework; schema copies the Postgres bundle. - [Multi-tenant deployments](https://getpleach.com/docs/multi-tenant): Operate a multi-tenant `@pleach/core` deployment — RLS in storage, `tenantId` in the fingerprint, per-tenant audit rollups, deployment checklist. The how-to guide. - [runtime.tenant facet](https://getpleach.com/docs/tenant-facet): The `runtime.tenant` primitive — `tenantId` + `subTenantId` accessors, `EventLogWriter` row stamping, RLS, `withTenantHeader`. The type-level surface. - [Performance](https://getpleach.com/docs/performance): Fingerprint dedup, prompt caching, batching, lazy module loading, and the hot-path optimizations that keep per-call overhead low. - [Security](https://getpleach.com/docs/security): Auth, RLS, secret handling, tenant isolation, and the surfaces that need attention before going to production. - [@pleach/compliance changelog](https://getpleach.com/docs/changelog/compliance): Release history for @pleach/compliance — site-docs entries that materially touched the @pleach/compliance surface, newest-first. Canonical runtime history lives upstream. - [Air-gapped deployment](https://getpleach.com/docs/air-gapped-deployment): What v1 ships that makes a contained, perimeter-bound deployment reachable, and what lands in v2+ to close the remaining gaps. - [Testing](https://getpleach.com/docs/testing): Mock mode, `MockToolExecutor`, deterministic seeds, and patterns for unit-testing agents that use `@pleach/core`. - [Error codes](https://getpleach.com/docs/error-codes): Structured 1xxx–9xxx error codes the runtime emits — what each range means, how to surface them, and what the recovery hint tells you. - [Troubleshooting](https://getpleach.com/docs/troubleshooting): Common symptoms, likely causes, and fixes — runtime construction, streaming, tools, sync, storage, and provider failures. ## Bundled packages - [@pleach/base-tools changelog](https://getpleach.com/docs/changelog/base-tools): Release history for @pleach/base-tools — site-docs entries that materially touched the @pleach/base-tools surface, newest-first. Canonical runtime history lives upstream. - [@pleach/eval changelog](https://getpleach.com/docs/changelog/eval): Release history for @pleach/eval — site-docs entries that materially touched the @pleach/eval surface, newest-first. Canonical runtime history lives upstream. - [@pleach/replay changelog](https://getpleach.com/docs/changelog/replay): Release history for @pleach/replay — site-docs entries that materially touched the @pleach/replay surface, newest-first. Canonical runtime history lives upstream. - [@pleach/gateway changelog](https://getpleach.com/docs/changelog/gateway): Release history for @pleach/gateway — site-docs entries that materially touched the @pleach/gateway surface, newest-first. Canonical runtime history lives upstream. - [@pleach/observe changelog](https://getpleach.com/docs/changelog/observe): Release history for @pleach/observe — site-docs entries that materially touched the @pleach/observe surface, newest-first. Canonical runtime history lives upstream. - [@pleach/sandbox changelog](https://getpleach.com/docs/changelog/sandbox): Release history for @pleach/sandbox — site-docs entries that materially touched the @pleach/sandbox surface, newest-first. Canonical runtime history lives upstream. - [@pleach/recipes](https://getpleach.com/docs/recipes-pleach-recipes): One-line factories that compose @pleach/core with sibling SKUs for the four most common consumer use cases — chatbot, RAG, observability, compliance — plus an instrumented coding agent. ## Transport adapters (not yet published — packages are private) - [@pleach/transport-azure-openai](https://getpleach.com/docs/transport-azure-openai): First-party Azure OpenAI Service transport for cloud-routed Pleach runtimes — managed-identity credentials, deployment-name routing, and Azure-specific cost-event emission. - [@pleach/transport-bedrock](https://getpleach.com/docs/transport-bedrock): First-party AWS Bedrock transport for cloud-routed Pleach runtimes — STS-federated credentials, region pinning, and Bedrock-specific cost-event emission. - [@pleach/transport-vertex](https://getpleach.com/docs/transport-vertex): First-party Google Vertex AI transport for cloud-routed Pleach runtimes — workload-identity credentials, region pinning, and Vertex-specific cost-event emission. ## Recipe walkthroughs - [simpleChatbot](https://getpleach.com/docs/recipes/simple-chatbot): One-line factory over @pleach/core for the minimal conversational agent. No sibling peers — supply your own provider adapter and the recipe handles session lifecycle, conversational state, and stream collection. - [ragChatbot](https://getpleach.com/docs/recipes/rag-chatbot): Chatbot plus a retrieval stage. You supply the Retriever — the recipe is storage-agnostic on purpose. Per turn, top-K chunks are spliced into the prompt as numbered context before delegating to simpleChatbot. - [observableChatbot](https://getpleach.com/docs/recipes/observable-chatbot): Chatbot whose ask() calls inherit a @pleach/observe sub-agent attribution scope. Every recordCall(...) downstream of the runtime turn carries [serviceName, ...] without threading a recorder argument through call sites. - [agentInstrumentation](https://getpleach.com/docs/recipes/agent-instrumentation): Instrument any @pleach/core agent with bare lifecycle subscriptions — runtime.events.on(kind, ...) for stage, turn, recovery, retry, and model.called signals — then bridge model.called straight to a destination with observeSink({ destinations }). No recipe wrapper, no recorder threaded through call sites. - [compliantChatbot](https://getpleach.com/docs/recipes/compliant-chatbot): Chatbot with PII / PHI scrubbing at the message-content boundary and, when a Supabase client is supplied, at the durable EventLogWriter boundary. Four named profiles map to curated scrubber bundles from @pleach/compliance. - [BYOK observability](https://getpleach.com/docs/recipes/byok-observability): How to drop @pleach/observe into an existing OpenAI / LangChain / hand-rolled agent loop and write one auditable row per LLM call to your own Postgres, Supabase, or OpenTelemetry collector. No @pleach/core commitment required. - [subagentSwarm](https://getpleach.com/docs/recipes/subagent-swarm): Bounded fan-out worker pool over any Chatbot. You supply the workers, the decompose function, and an optional reduce. The recipe enforces a maxFanOut concurrency cap and an optional per-root-turn USD cost ceiling — the application-layer defense for the runaway-loop case. - [verticalAgent](https://getpleach.com/docs/recipes/vertical-agent): Chatbot pre-wired with your domain plugin. You write the HarnessPlugin (citation extraction, entity recognition, post-tool-tier enrichment, custom event channels); the recipe wires it into createPleachRuntime so every ask() turn picks up your domain logic without manual plumbing. - [enterpriseAgent](https://getpleach.com/docs/recipes/enterprise-agent): Compliance scrubber + sub-agent attribution + procurement-visible permittedFamilies envelope, stacked into one factory. The frontier-lab direct-enterprise recipe — two of the three pillars wired in-process; the third (gateway-side family failover) reads the envelope at runtime. - [evalLab](https://getpleach.com/docs/recipes/eval-lab): Runtime + EvalSuite + (optional) ReplayClient trio wired for research reproducibility. The eval / research lab recipe — supply the model config, the eval suite cases, and a replay-cache backend, and re-derive the report months later without re-running the LLM. - [instrumentedCodingAgent](https://getpleach.com/docs/recipes/instrumented-coding-agent): Coding-agent runtime whose executeStep(...) calls inherit a @pleach/observe sub-agent attribution scope. Every recordCall(...) downstream of the step carries [subagent, ...] without threading a recorder argument. ## Reference - [Environment variables](https://getpleach.com/docs/env-vars): Single-page reference for every environment variable @pleach/core reads — runtime flags, storage adapters, provider credentials, and observability. - [Subpath exports](https://getpleach.com/docs/subpath-exports): Every named import path under @pleach/core, what ships from it, and whether it's load-bearing. - [Audit gates](https://getpleach.com/docs/audit-gates): The CI-time invariant checks that protect the `@pleach/*` substrate — package shape, plugin contracts, tool coverage, event-log integrity, multi-tenant scoping, and graph lattice. - [First-publish packaging contract](https://getpleach.com/docs/publishing-contract): Dual ESM/CJS emit, types-first exports ordering, tsup dir-style entries, tsc-built DTS, sourcemap-free tarballs, peer-dep tightening — the package-build conventions every @pleach/* SKU follows at 1.0. - [Versioning policy](https://getpleach.com/docs/versioning): Semver, deprecation, schema-bundle versioning, and `AUDIT_RECORD_VERSION_HISTORY`. - [Changelog](https://getpleach.com/docs/changelog): Site-content changes for getpleach.com, organized per @pleach/* SKU. Find the changelog for the package you're using, or read the combined chronological view. - [Contributing](https://getpleach.com/docs/contributing): How to file bugs, propose features, and submit PRs against `@pleach/core` and the sibling SKUs. - [Glossary](https://getpleach.com/docs/glossary): Canonical terms used across the @pleach/* runtime and its sibling packages. - [FAQ](https://getpleach.com/docs/faq): Questions that come up often — about the runtime model, licensing, integration, and what `@pleach/core` is and isn't. ## Machine-readable surface - [llms-full.txt](https://getpleach.com/llms-full.txt): The full markdown body of every docs page, concatenated for ingestion. - Per-page markdown: append `.md` to any docs URL (for example, https://getpleach.com/docs/getting-started.md) for the raw page source. Equivalent to requesting the same URL with `Accept: text/markdown`.