Dbt LLM Agent

LLM based AI Agent to automate Data Analysis for dbt projects with remote MCP server

Data SciencePythonMIT

Abstract

Dbt LLM Agent is an open-source Data Science project. LLM based AI Agent to automate Data Analysis for dbt projects with remote MCP server. It is built using Python. Key capabilities include: PKCE (Proof Key for Code Exchange): Prevents authorization code interception attacks; Organization Isolation: Users can only access their organization's data; Token Validation: All API calls require valid JWT tokens. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Data Science mini project or final-year project.

1. Introduction

LLM based AI Agent to automate Data Analysis for dbt projects with remote MCP server

2. Objective

LLM based AI Agent to automate Data Analysis for dbt projects with remote MCP server

This project demonstrates how Python can be applied to a real-world Data Science problem.

3. Key Features / Modules

  • PKCE (Proof Key for Code Exchange): Prevents authorization code interception attacks
  • Organization Isolation: Users can only access their organization's data
  • Token Validation: All API calls require valid JWT tokens
  • Automatic Expiry: Access tokens expire after 1 hour, refresh tokens after 7 days

4. Technology Stack

Python
  • list_dbt_models — Browse and filter dbt models by project, schema, or materialization
  • search_dbt_models — Semantic search for relevant models using natural language
  • get_model_details — Get detailed information about specific models including SQL and lineage
  • get_project_summary — Overview of connected dbt projects and their structure
  • OAuth Metadata Discovery: MCP server exposes RFC 8414 compliant metadata endpoints
  • PKCE Security: Uses Proof Key for Code Exchange for enhanced security
  • Auto-Registration: Automatically registers new OAuth clients (like Claude.ai)
  • Organization Scoping: All data access is automatically scoped to the user's organization

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later
  • pip / virtualenv for dependencies
  • VS Code, PyCharm or Jupyter Notebook
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/pragunbhutani/dbt-llm-agent.git
cd dbt-llm-agent
  1. Frontend: http://localhost:3000 (Next.js)
  2. API: http://localhost:8000 (Django/DRF)
  3. Flower: http://localhost:5555 (background tasks)
  4. Use HTTPS: Configure SSL certificates for secure connections
  5. Restrict Origins: Set specific allowed origins instead of
  6. Monitor Usage: Track OAuth token usage and API calls
  7. Scale Considerations: Each client needs its own server instance
# ① clone & prepare env file
$ git clone https://github.com/pragunbhutani/ragstar.git && cd ragstar
$ cp .env.example .env && ${EDITOR:-vi} .env  # ⇒ edit just the vars shown below

# ② build & run everything
$ docker compose up --build -d
# inside the running backend container
$ docker compose exec backend-django \
    uv run python manage.py migrate

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Turn the analysis into an interactive dashboard
  • Automate data refresh with a scheduled job
  • Add a predictive model on top of the analysis

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. What is the source of the dataset and how was missing data handled?
  2. Which exploratory analysis steps revealed the most useful insight?
  3. Why were these particular charts chosen to present the data?
  4. Which statistical or ML technique supports the conclusions?
  5. How could the analysis be automated or refreshed with new data?

9. Source Code & License

This project is developed by pragunbhutani and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Data Science project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Data Science Internship