Skip to main content

DB schema extraction to semantic layer for self-service analytics with local LLMs

Project description

Schemalytics

Semantic Layer for Self-Service Analytics

Schemalytics transforms your database into an LLM-ready semantic layer that enables self-service analytics. It analyzes your schema, generates dimensional models, and creates comprehensive metadata that LLMs can use to write accurate SQL queries—all running locally with complete privacy.

The tool generates a complete dbt project as the implementation layer, following dimensional modeling best practices with medallion architecture (Bronze → Silver → Gold).

Key features:

  • Semantic layer generation - LLM-ready metadata with metrics, relationships, and query patterns
  • Self-service analytics - Enable natural language queries against your data
  • Privacy-first - Runs on local LLMs (Ollama), no data leaves your machine
  • Interactive refinement - Perfect your data model through natural language feedback
  • Industry templates - Pre-configured patterns for e-commerce, SaaS, fintech, and more

Quick Start

1. Install prerequisites

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5-coder:7b

# Install Schemalytics  
pip install schemalytics

2. Generate semantic layer + dbt project

schemalytics generate \
  -c postgresql://localhost/mydb \
  -o ./dbt_project

3. Interactive refinement

  • AI generates initial plan with concrete specifications
  • You refine with natural language ("make revenue weekly", "add customer LTV")
  • Approve when ready

4. Use for self-service analytics

cd dbt_project

# Configure your database connection
# See: https://docs.getdbt.com/docs/core/connect-data-platform/profiles.yml

# Build models
dbt run

# Your semantic layer is in semantic_layer.yml
# LLMs can now understand your data model and generate accurate queries

What You Get

  • Semantic layer (semantic_layer.yml) - Complete metadata for LLM-powered analytics
  • Bronze models - Raw data staging layer
  • Silver models - Facts and dimensions (star schema)
  • Gold models - Pre-aggregated metrics for performance
  • Documentation - Auto-generated schema.yml files with tests

License

Apache 2.0 • Built by NiChr0

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

schemalytics-0.1.1.tar.gz (101.1 kB view details)

Uploaded Source

Built Distribution

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

schemalytics-0.1.1-py3-none-any.whl (104.0 kB view details)

Uploaded Python 3

File details

Details for the file schemalytics-0.1.1.tar.gz.

File metadata

  • Download URL: schemalytics-0.1.1.tar.gz
  • Upload date:
  • Size: 101.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for schemalytics-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b444ccb3abd5d82f0fa1e00bfa1948407672be86cff72246210335fde98011fd
MD5 29543e366f6949829291684c0450222f
BLAKE2b-256 14b8ac5e0294faa70f834008aa738b1739942029299725e9cf4932194ded06c7

See more details on using hashes here.

File details

Details for the file schemalytics-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: schemalytics-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 104.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for schemalytics-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57177fb571bd466433203eea6f904488529687c439da945cee8ce04d039ebe04
MD5 d5f4d4a9a11c80899331aa493241a5d2
BLAKE2b-256 0bf4f125cdf1a9fd3e0224ec188be333b031f9949947f405115cd1b66026c8ff

See more details on using hashes here.

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