Skip to main content

Git-native data modeling for dbt users

Project description

DataLex by DuckCode AI Labs

DataLex

AI-first dbt adoption, contracts, diagrams, and manifest publishing.

DataLex is a local-first OSS workflow for teams that already use dbt. It scans your existing dbt project, lets AI propose business domains and contracts from dbt evidence, and writes reviewed DataLex artifacts back to Git.

DataLex does not replace dbt. dbt remains the source of truth for SQL, model YAML, semantic metrics, tests, exposures, and enforced physical contracts. DataLex adds the business/domain layer above dbt.

PyPI MIT License Discord Community

Install from PyPI

Use this path when you want DataLex on your machine or inside an existing dbt repo.

python3 -m pip install -U 'datalex-cli[serve]'
datalex --version
datalex serve

Open http://localhost:3030.

To open DataLex directly on an existing dbt repo:

cd ~/path/to/your-dbt-project
datalex serve --project-dir .

For warehouse drivers, add the matching extra:

python3 -m pip install -U 'datalex-cli[serve,duckdb]'
python3 -m pip install -U 'datalex-cli[serve,postgres]'
python3 -m pip install -U 'datalex-cli[serve,snowflake]'
python3 -m pip install -U 'datalex-cli[serve,all]'

Requirements: Python 3.9+ and Git. The [serve] extra includes a portable Node runtime for the local UI.

Run with Docker

Use Docker when you do not want to install Python packages on the host.

git clone https://github.com/duckcode-ai/DataLex.git
cd DataLex
docker build -t datalex:local .
docker run --rm -p 3030:3001 datalex:local

To use Docker with an existing dbt repo:

cd ~/path/to/your-dbt-project
docker run --rm -p 3030:3001 \
  -v "$PWD":/workspace \
  -e REPO_ROOT=/workspace \
  -e DM_CLI=/app/datalex \
  datalex:local

In the UI, choose /workspace as the dbt project path.

Core workflow

Connect dbt repo -> AI Setup -> Readiness -> Generate -> Review -> Contracts -> Publish
  1. Connect your dbt repo.
  2. Set up AI with OpenAI, Claude, or Ollama.
  3. Scan readiness from dbt manifest, YAML, metrics, tests, exposures, owners, and contracts.
  4. Generate focused proposal packs for one domain, model group, or metric family.
  5. Review and certify proposals before anything becomes trusted.
  6. Publish datalex-manifest.json from certified contracts.

Generation requires a tested AI provider. Readiness works without AI, but DataLex will not create fake domains or placeholder contracts.

AI setup

DataLex uses your dbt evidence to generate proposals:

  • target/manifest.json
  • dbt model YAML
  • semantic models and metrics
  • tests and relationships
  • exposures
  • owners and descriptions
  • existing dbt contracts
  • existing DataLex artifacts

Provider settings are project-private and stored under:

<your-dbt-project>/.datalex/agent/provider-settings.json

They are not written under versioned DataLex/, and API responses redact secrets.

Ollama example

ollama pull gemma4:12b
ollama serve

In DataLex, open AI Setup, choose Ollama, set:

Base URL: http://localhost:11434
Model: gemma4:12b

Then click Save and Test.

What DataLex writes

New OSS artifacts use this domain-first layout:

DataLex/
  datalex.yaml
  domains/
    commerce.yaml
  commerce/
    conceptual/
    logical/
    physical/
    contracts/
    proposals/
    glossary/
    semantic/
  imported/
    dbt/
  generated/
    dbt/
  generated-sql/
  Skills/

DataLex still reads older layouts for compatibility, but new UI actions write lowercase canonical paths.

Only certified contracts and metric contracts enter datalex-manifest.json. Draft, reviewed, and rejected proposals stay out of the publish manifest.

Publish a manifest

datalex datalex manifest build DataLex --out DataLex/datalex-manifest.json

The manifest is the stable OSS handoff for downstream tools and future cloud flows. DQL is not required in the OSS repo. DataLex only shows DQL readiness when a project explicitly enables that integration.

Tutorials

Start here:

  1. Install and run DataLex
  2. Connect an existing dbt repo
  3. Configure AI with OpenAI, Claude, or Ollama
  4. Generate, review, and certify a proposal pack
  5. Publish the DataLex manifest
  6. Run DataLex with Docker

For the full flow in one place, read Getting started.

For contributors

git clone https://github.com/duckcode-ai/DataLex.git
cd DataLex
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[serve,duckdb]'
npm --prefix packages/api-server install
npm --prefix packages/web-app install
datalex serve

Useful checks:

npm --prefix packages/api-server test
npm --prefix packages/web-app run build
python3 -m pytest tests/datalex packages/readiness_engine/tests

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datalex_cli-1.11.0.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datalex_cli-1.11.0-py3-none-any.whl (6.1 MB view details)

Uploaded Python 3

File details

Details for the file datalex_cli-1.11.0.tar.gz.

File metadata

  • Download URL: datalex_cli-1.11.0.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datalex_cli-1.11.0.tar.gz
Algorithm Hash digest
SHA256 08cc22ce485834ae972b1836fd419fd66476d0859680b48478b4c933f949193d
MD5 63340258c0986930f97e0c98ac82789e
BLAKE2b-256 bcbd1682a24aa7ea2b412750f1ac08277f233d3ea93a3c890f387da606dc2bfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for datalex_cli-1.11.0.tar.gz:

Publisher: publish.yml on duckcode-ai/DataLex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datalex_cli-1.11.0-py3-none-any.whl.

File metadata

  • Download URL: datalex_cli-1.11.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datalex_cli-1.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73a1206db77f3d15ad4dea4210c68b726e29555bae36d3ddffaaac02d0269643
MD5 3c2e00d5ef947839d4b5290c60c8ce5e
BLAKE2b-256 09bf70cfb807a3773c24e37d393068adadab90827dcd68e9eddbcc057122b52d

See more details on using hashes here.

Provenance

The following attestation bundles were made for datalex_cli-1.11.0-py3-none-any.whl:

Publisher: publish.yml on duckcode-ai/DataLex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page