Storage contract for the conversation domain, plus built-in adapters.
persistence/
├── persistence.ts the Persistence interface
├── contract-tests.ts shared behavioral tests every adapter must pass
└── adapters/
├── memory/ in-memory (tests, development)
└── sqlite/ bun:sqlite-backed (local deployments)
The Persistence contract covers:
- Conversations — create, get, list, finalize (end time), delete.
- Participants — add and list per conversation.
- Transcript — append (upsert) and list entries.
- Turns — append and list.
- Generations — upsert and list.
appendGenerationupserts by id so status updates (streaming → completed/cancelled) overwrite, and generation records carrykind/parentGenerationIdfor delegated sub-generations.
contract-tests.ts runs the same behavioral suite against every adapter, so
new storage backends (Postgres, Redis, …) are verified consistent with the
built-ins before they ship.
import { MemoryPersistence, SQLitePersistence } from "@moureau/pipeflow/persistence";
const pipeflow = new Pipeflow({
persistence: new SQLitePersistence({ filename: "./pipeflow.db" }),
});See the root README for the public API.