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

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.2.tar.gz (100.9 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.2-py3-none-any.whl (103.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: schemalytics-0.1.2.tar.gz
  • Upload date:
  • Size: 100.9 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.2.tar.gz
Algorithm Hash digest
SHA256 655e072665a3535bf0065ef074b7edc7a7821d4a4aef5a0141cca0ac70a84104
MD5 a3578fbe77891de48787d77f85242615
BLAKE2b-256 c287f1bbaf73527ecd39215cfffef7b62b9eaa8fabab94aa9250aeddcd0e2e4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: schemalytics-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 103.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80001e30cc8067ae01a7c4913c75ede6306feb080014ac188e6f52fc1a8ff3db
MD5 e6876a6e8eb0800b10ea78f1b4394c13
BLAKE2b-256 1ee5baf470994faeae595eac86ff19df816225bfa2bd7aa2b0ddbb0f5bd43c5e

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