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.
One-command local path
Section titled “One-command local path”export PRAMEN_POSTGRES_DSN=postgres://pramen:pramen@localhost:5432/pramen_devexport PRAMEN_LEDGER_PATH="$PRAMEN_POSTGRES_DSN"./scripts/dbt-quickstart.shThat applies generated DDL, runs examples/dbt/pipeline.yaml,
and dbt builds the example project with the maintained package.
Generate DDL and sources
Section titled “Generate DDL and sources”pramen dbt ddl examples/dbt/pipeline.yaml | psql "$PRAMEN_POSTGRES_DSN"pramen dbt sources examples/dbt/pipeline.yaml --out examples/dbt/models/sources.ymlpramen run examples/dbt/pipeline.yamlcd examples/dbt && dbt deps && dbt buildpramen dbt check examples/dbt/pipeline.yaml --manifest target/manifest.jsonDelivery contract in dbt
Section titled “Delivery contract in dbt”| 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.
Cost and review marts
Section titled “Cost and review marts”Install the package from integrations/dbt/pramen/:
pramen_enrichment_cost— tokens by provider / model / daypramen_reuse— dispatched vs reused completionspramen_review_backlog— pendingonInvalid: reviewrowspramen_load_freshness— checkpoint completion lag
Join landing rows to the ledger with output.provenance: [workKey, …] and
the pramen_provenance_join macro.