# Triplex > The database that remembers why: an embedded fact database for TypeScript back-office systems. Every write records who made it, which versioned rules governed it, and when it was true, so audit questions and open work become queries. Triplex is pre-1.0; install with `npm install @triplex-build/triplex effect@4.1.1`. Triplex requires Effect 4 (`effect@4.1.1`; Effect 3 is not compatible), is ESM-only, and targets Node.js 22+ plus modern browsers and edge runtimes for the core. In-memory and SQLite storage are supported, PostgreSQL is a production candidate, and Cloudflare and FoundationDB are experimental and frozen. Coding agents modeling a back-office domain should read the modeling guide first and write through the schema-bound `Database` client (`@triplex-build/triplex/database`), which pins and enforces the live release on every command. Every page is available as Markdown by appending `.md` to its URL. Code on the homepage and in the modeling guide is type-checked and executed in CI. ## Overview - [Homepage](https://triplex.build/index.md): An embedded fact database for TypeScript back-office systems. Every write records who made it, which versioned rules governed it, and when it was true. ## Start - [Database client](https://triplex.build/database.md): Schema-bound Effect commands and typed reads over any Triples backend. - [Getting started](https://triplex.build/getting-started.md): Start with the Database client from `@triplex-build/triplex/database`. - [Modeling a back-office domain](https://triplex.build/agents.md): A prescriptive guide for coding agents modeling a back-office domain with Triplex. It maps domain concepts to primitives and lists the rules every command should follow. - [Playground](https://triplex.build/playground.md): Run an in-memory Triplex database, Datalog queries, and transactions in your browser. - [Core concepts](https://triplex.build/concepts.md): Triplex stores facts, not mutable rows. - [Current state](https://triplex.build/current-state.md): This document is the concise maturity contract for Triplex as of November 2026. ## Learn - [Datalog](https://triplex.build/datalog.md): For application queries, start with the Database client: `db.query` checks attributes against the release and decodes results with your Schema projection. - [Configuration releases and rollback](https://triplex.build/configuration-versioning.md): This walkthrough defines a typed course schema, publishes two immutable releases, promotes them through refs, pins operational writes to the actual returned snapshot IDs, inspects history, and rolls `live` back. - [Derivations](https://triplex.build/derivations.md): Use Live queries to observe complete query snapshots across commits and expiry. - [Live queries](https://triplex.build/live-queries.md): Observe complete Datalog snapshots at exact commit positions and valid-time boundaries. - [Derivation runner](https://triplex.build/runner.md): Durable derivation diffs, retries and temporal replay through scoped Effect handlers. - [Explain a fact with `why`](https://triplex.build/why.md): Explain facts, entity state and derivation candidates at an exact recorded cut. - [Source provenance](https://triplex.build/provenance.md): Triplex began as the database subsystem of an earlier private application repository. ## Reference - [Typed configuration](https://triplex.build/configuration.md): Triplex configuration is immutable, typed, and content-addressed. - [Operational Primitives](https://triplex.build/operational-primitives.md): Triplex is a durable substrate for applications that need temporal facts, derivations, and audit. - [Sensitive values](https://triplex.build/sensitive-values.md): Status: **pre-1.0, opt-in.** This page is the design record and reference for sensitive attribute values: what they are, which guarantees Triplex gives, and what remains host work. - [Commit validators](https://triplex.build/commit-validators.md): Status: implemented and covered by shared conformance on KV, SQLite, PostgreSQL, and the experimental Cloudflare backend. - [Configuration-derived HTTP API](https://triplex.build/http-api.md): `@triplex-build/triplex/http` turns a persisted `ConfigSnapshot` into runtime request/response schemas, an Effect `HttpApi`, OpenAPI 3.1, and REST handlers. - [Performance](https://triplex.build/performance.md): Triplex is pre-1.0 and does not yet publish a production performance guarantee. ## Operate - [CLI and dashboard](https://triplex.build/tools.md): Triplex includes two operator tools: a published JSON-first CLI for repeatable commands and a browser dashboard for interactive exploration. - [MCP server](https://triplex.build/mcp.md): `triplex mcp` exposes one database per process through MCP over stdio, using Effect's MCP server. - [Triplex data explorer](https://triplex.build/explorer.md): Explore a live in-memory Triplex database in an Airtable-like grid, JSON editor, and transaction diff viewer. - [Host integration](https://triplex.build/host-integration.md): Triplex can provide the fact, temporal-query, configuration, derivation, and audit substrate for an application that also owns relational operational records. - [Troubleshooting and FAQ](https://triplex.build/troubleshooting.md): Answers to common failures, including npm 404s, missing Effect services, empty queries, 100-row pages, which clock to set, duplicate command IDs, unenforced or failing constraints, and stale projections. - [Error diagnostics](https://triplex.build/errors.md): Stable diagnostic codes, recovery hints, paths, and retry rules for public Triplex errors. - [Releasing Triplex](https://triplex.build/releasing.md): Triplex publishes one npm package, `@triplex-build/triplex`, through Changesets and GitHub Actions. ## Backend blueprints - [Your database. Triplex's memory.](https://triplex.build/backends.md): Explore how SQLite, FoundationDB, Datomic, and XTDB primitives can support a Triplex storage layer, with implementation paths and explicit maturity labels. - [Building Triplex on SQLite](https://triplex.build/sqlite.md): A working blueprint for an embedded Triplex storage layer using SQLite rows, indexes, and atomic SQL transactions. - [Building Triplex on FoundationDB](https://triplex.build/foundationdb.md): An experimental Triplex storage blueprint that maps ordered byte keys and atomic FoundationDB transactions to the existing hexastore runtime. - [Building Triplex on Datomic](https://triplex.build/datomic.md): A proposed Triplex adapter blueprint using Datomic assertion entities, immutable database values, and atomic compare-and-swap submission. - [Building Triplex on XTDB](https://triplex.build/xtdb.md): A proposed Triplex adapter blueprint for XTDB's current SQL and bitemporal primitives, including non-interactive writes and stable read boundaries. ## Project - [A fact is a triple](https://triplex.build/blog/remembers-why/01-a-fact-is-a-triple.md): Part 1 of The Database That Remembers Why. Build a Map-backed fact store with Effect, query by pattern, and watch an update destroy evidence. - [Nothing is overwritten](https://triplex.build/blog/remembers-why/02-nothing-is-overwritten.md): Part 2 of The Database That Remembers Why. Correct a fact without deleting the evidence, using assertions, retractions, and an atomic transaction log. - [Two clocks, two questions](https://triplex.build/blog/remembers-why/03-two-clocks-two-questions.md): Part 3 of The Database That Remembers Why. Ask whether Maria was trained on March 2, as known then and as known now, with independent valid and recorded times. - [Someone did this](https://triplex.build/blog/remembers-why/04-someone-did-this.md): Part 4 of The Database That Remembers Why. Commit a command, actor, rule context, facts, and receipt together so a retry cannot become another business event. - [A shape is not an invariant](https://triplex.build/blog/remembers-why/05-a-shape-is-not-an-invariant.md): Part 5 of The Database That Remembers Why. Decode facts with Effect Schema, then check entity shape, uniqueness, and temporal boundaries before a transaction commits. - [Custom runtimes](https://triplex.build/custom-runtimes.md): `@triplex-build/triplex/runtime` is the public adapter-authoring surface in this source checkout. - [Triplex roadmap](https://triplex.build/roadmap.md): This document outlines strategic enhancements to make `@triplex-build/triplex` a world-class, open-source triple store and Datalog engine. ## Optional - [Blog](https://triplex.build/blog/index.md): Building Triplex in public, one working piece and one broken assumption at a time. - [The Database That Remembers Why](https://triplex.build/blog/remembers-why/index.md): Build a tiny bitemporal fact store with Effect TypeScript in twelve parts, discovering each feature when the previous version fails. - [Datalog pagination and performance](https://triplex.build/datalog-performance.md): `Triples.query` and `Triples.queryPage` return at most 100 bindings by default. - [RFC: the schema-bound `Database` service](https://triplex.build/rfcs/database-client.md): Status: proposed, P2.5; implementation waits for owner approval in D3. - [RFC: valid intervals and transaction provenance in Datalog](https://triplex.build/rfcs/datalog-time.md): Status: proposed, awaiting owner approval of P4.1 and D2 (P1.3). - [RFC: journal-driven live queries](https://triplex.build/rfcs/live-queries.md): Status: proposed for P4.3, awaiting owner approval before P4.4. - [RFC: durable derivation runner](https://triplex.build/rfcs/runner.md): Status: accepted; implemented as `@triplex-build/triplex/runner`. - [TX1.4 investigation: database-owned invariant scope authority](https://triplex.build/rfcs/tx1-invariant-scope-investigation.md): Status: **synthetic mechanism evidence and proposed design; no public scope API, registry, migration or allocator change**. - [TX1.3: late allocation needs a transaction protocol decision](https://triplex.build/rfcs/tx1-late-allocation.md): Update after owner direction: The owner selected staged ordered publication with database-owned invariant scopes. - [TX1.3 investigation: staged ordered publication](https://triplex.build/rfcs/tx1-ordered-publication-investigation.md): Status: **experimental evidence and proposed profile; no production allocator change**. - [TX1.4: scope claims need an ordered-publication protocol](https://triplex.build/rfcs/tx1-scoped-concurrency.md): Update after owner direction: The owner selected database-owned invariant scopes and staged ordered publication. - [RFC: host-sealed values and erasure](https://triplex.build/rfcs/tx3-host-sealed-values.md): Status: proposed; owner decision required before implementation. - [RFC: one explanation operation, `why`](https://triplex.build/rfcs/why.md): Status: proposed for owner approval before P3.2.