Skip to main content
TENET’s storage adapter pattern lets all modules work against different backends without changing their code. Locally, everything writes to .tenet/ files and SQLite. In production, the same operations go to Postgres with workspace isolation.

Interface

Implementations

LocalStorage (default)

File-based storage in .tenet/ directory. Uses SQLite for queries and cosine similarity for vector search. This is what runs when you use tenet on your machine.

CloudStorage

Postgres-backed storage for multi-user deployments. All operations scoped by workspaceId. Uses pgvector for similarity search.

Factory

How Modules Use It

Memory, training buffer, and policy head all accept an optional storage parameter. When not provided, they use LocalStorage (backward compatible):