Skip to content

Enrichment into dbt

Pramen is upstream of dbt: it lands governed, typed, AI-enriched rows into PostgreSQL; dbt builds marts on top. Canonical prose lives in docs/integrations/dbt.md.

Terminal window
export PRAMEN_POSTGRES_DSN=postgres://pramen:pramen@localhost:5432/pramen_dev
export PRAMEN_LEDGER_PATH="$PRAMEN_POSTGRES_DSN"
./scripts/dbt-quickstart.sh

That applies generated DDL, runs examples/dbt/pipeline.yaml, and dbt builds the example project with the maintained package.

Terminal window
pramen dbt ddl examples/dbt/pipeline.yaml | psql "$PRAMEN_POSTGRES_DSN"
pramen dbt sources examples/dbt/pipeline.yaml --out examples/dbt/models/sources.yml
pramen run examples/dbt/pipeline.yaml
cd examples/dbt && dbt deps && dbt build
pramen dbt check examples/dbt/pipeline.yaml --manifest target/manifest.json
Sink mode Replay dbt guidance
append At-least-once duplicates pramen_dedupe(relation, keys, order_by) in staging
upsert Idempotent on keys Generated unique index; no dedupe needed

The sink commit barrier means dbt never sees a partial load — always wait for pramen run to finish before dbt build.

Install the package from integrations/dbt/pramen/:

  • pramen_enrichment_cost — tokens by provider / model / day
  • pramen_reuse — dispatched vs reused completions
  • pramen_review_backlog — pending onInvalid: review rows
  • pramen_load_freshness — checkpoint completion lag

Join landing rows to the ledger with output.provenance: [workKey, …] and the pramen_provenance_join macro.