Skip to content

Persistence

Felix is cloud-agnostic: Postgres, a cache, and an object store behind Protocols — not a single vendor SDK. Repo: felix-run/felix.

Data plane

Store Config Holds
Postgres + pgvector FELIX_DATABASE_URL Sessions, audit, manifests, approvals, plans, jobs, fibers, eval, memory vectors
Valkey / Redis FELIX_REDIS_URL Taskiq broker, rate-limit / short-lived cache, queue-tool lists
Object store FELIX_OBJECT_STORE=fs|s3|gcs|memory Artifacts, optional policy bundles / bulk blobs

Migrations: Alembic via felix migrate (or make migrate). Local Compose uses pgvector + Valkey; fs object store needs no MinIO. Cloud notes: deploy, deploy/aws/, deploy/gcp/.

Tenant isolation

Tenant-owned tables lead with tenant_id in the primary key. Every store query filters on tenant. Thread ids are {tenant_id}:{suffix} — caller suffixes containing : or # are rejected so the prefix cannot be smuggled.

Session events

PostgresSessionStore (felix.session.store) appends to session_events (monotonic seq, kind discriminators, message-shaped payload). Patterns never talk SQL directly — they use Session + SessionStrategy.

Strategies: full_replay, windowed:N, summarizing:N, semantic:N, compacting, plus any registered with register_session_strategy. memory.checkpointer chooses where that log lives — postgres (default), none (no session state), or a registered backend.

Relational highlights

Table / area Notes
audit_events Append-only; API buffers, worker flushes; optional warehouse spill
manifests + manifest_active Append-only versions + active/canary pointer
approvals Signature-indexed pending/approved/denied (+ TTL / one-shot)
plans Deep / plan tools; TTL expiry
jobs Cron schedules; (tenant_id, name) PK
fibers Durable sleep/step/resume state
eval_* Datasets, items, runs
memory_vectors pgvector HNSW; kinds fact / preference / episode / procedural

Object store

Used for artifact spill when spec.artifacts.enabled and output exceeds threshold_chars. Keys are tenant-scoped; fetch_artifact reads windows back. Retention sweeps prune old objects. Small VMs: FELIX_OBJECT_STORE=fs under FELIX_DATA_DIR. Helm: enable persistence so /data survives restarts.

Analytics warehouse (optional)

Postgres remains system of record. Optional append-only spill (FELIX_WAREHOUSE=duckdb|clickhouse|doris|none) for audit/eval analytics — worker exports after Postgres write. Lean default is none.

felix doctor checks database URL, object store, auth, and consumer secret readiness without mutating state.