شعار Dbt Llm Agent

Dbt Llm Agent

المجتمع
pragunbhutani

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

الناشرpragunbhutani
المستودعdbt-llm-agent
اللغةPython
التفريعات
31
النجوم
180
الأدوات المتاحة
0
نوع نقل البياناتstdio
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Dbt Llm Agent إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 180، والنسخ المتفرعة: 31 في المستودع المرتبط.

Ragstar — AI Data Analyst for dbt Projects

License: MIT Python 3.10+ TypeScript Docker Compose

Ragstar is in public βeta. Expect rapid changes and occasional rough edges.


1. What is Ragstar?

Ragstar connects to your dbt project, builds a knowledge base from models & documentation, and lets everyone ask data-related questions in plain English via a beautiful web dashboard or Slack. Under the hood Ragstar combines:

  • PostgreSQL + pgvector for fast similarity search
  • Embeddings + LLMs (OpenAI, Anthropic, etc.) for reasoning
  • A modern Next.js frontend & Django backend

Screenshots

Dashboard

Dashboard

Integrations

Integrations

Settings

Settings


2. Quick start (🚀 2 commands)

bash
# ① 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

When the containers are healthy:

Run first-time Django tasks:

bash
# inside the running backend container
$ docker compose exec backend-django \
    uv run python manage.py migrate

🎉 That's it — open http://localhost:3000, sign up for a new account and you're ready to start using Ragstar.


3. Environment variables

Only a handful of variables are truly required for a local/dev install. The rest are advanced overrides.

Ragstar keeps the default stack as lightweight as possible.
For a local docker compose run you only need 3 variables – everything else has sane fall-backs.

3.1 Required for local/dev

VarExamplePurpose
NEXTAUTH_SECRETopenssl rand -base64 32Secret used by next-auth to sign session cookies
NEXTAUTH_URLhttp://localhost:3000Public URL where the frontend is reachable
NEXT_PUBLIC_API_URLhttp://localhost:8000Public URL of the Django API exposed to the browser

Create a .env file in the repo root and paste the three lines above (adjust URLs if you changed the ports).

3.2 Common overrides (optional)

VarDefaultWhen you might set it
INTERNAL_API_URLhttp://backend-django:8000Only needed when the frontend talks to the backend across Docker networks or remote hosts.
ENVIRONMENTlocalSwitch between local, development, production behaviour inside Django settings.
APP_HOST—Extra hostname to append to Django ALLOWED_HOSTS & CORS lists, e.g. your public Ngrok / Vercel host.
DATABASE_URLauto-generated by composePoint the backend & worker to your own Postgres instance.
CELERY_BROKER_URLredis://redis:6379/0Use an external Redis / RabbitMQ instead of the bundled one.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGIONnot setOnly required when you disable LocalStack and want to store secrets in real AWS Parameter Store.

3.3 LLM Provider API Keys

You need to provide API keys for all the LLM providers you plan on using.

bash
LLM_OPENAI_API_KEY=...
LLM_ANTHROPIC_API_KEY=...
LLM_GOOGLE_API_KEY=...

3.4 Postgres defaults (used by compose)

bash
POSTGRES_DB=ragstar
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432

Set a single EXTERNAL_POSTGRES_URL=<url> to BYO Postgres (with the pgvector extension).


4. First-run onboarding

After logging into the dashboard you'll be guided through these steps:

  1. Add a dbt project → Projects › New (dbt Cloud recommended — just paste the service token). GitHub or local zip upload also supported.
  2. Pick the dbt models you want to use for answering questions → choose which model to use for ∙ questions ∙ embeddings ∙ SQL verification.
  3. Configure Slack (optional)
    • Go to Integrations › Slack.
    • Follow the inline manifest to create a Slack app.
    • Paste Bot Token, Signing Secret, App Token.
  4. Ask questions! Use the chat on the dashboard or /ask in Slack.

Other integrations (Metabase, Snowflake, MCP) are available under Integrations but currently βeta / experimental. MCP server is temporarily disabled while we stabilise streaming support.


5 Managing the stack

Common operations are wrapped in one-liners:

bash
# shell into backend or frontend
$ docker compose exec backend-django bash
$ docker compose exec frontend-nextjs sh

# tail logs
$ docker compose logs -f backend-django

# stop / remove containers
docker compose down          # keep volumes
docker compose down -v       # destroy DB

6. Local dev without Docker (advanced)

  1. Install Python 3.10+, Node 18+, uv, pnpm, and Postgres16+ with pgvector.
  2. uv venv && source .venv/bin/activate && uv pip install -e backend_django/
  3. pnpm install --filter frontend_nextjs
  4. Start services in two terminals:
    • Backend — cd backend_django && uv run python manage.py runserver 0.0.0.0:8000
    • Frontend — cd frontend_nextjs && pnpm dev
  5. Export the same env vars listed above.

Docker is strongly recommended unless you're hacking on the codebase itself.


7. Contributing

We 💛 community PRs. Please file an issue first for major changes. Make sure ruff, black, mypy, and eslint pass before opening a pull request.



8. MCP Server Integration (Self-Hosted Only)

Ragstar includes a Model Context Protocol (MCP) server that allows LLM clients like Claude.ai to directly access your dbt knowledge base. The MCP server provides secure, OAuth-authenticated access to your dbt models and project information.

⚠️ Important: The MCP server can only be used with self-hosted/open source deployments of Ragstar. This is due to the 1:1 relationship between an MCP client and server — each client needs its own dedicated server instance.

8.1 What is the MCP Server?

The MCP server acts as a bridge between LLM clients (like Claude.ai) and your Ragstar knowledge base. It provides:

  • Secure OAuth 2.0 authentication with PKCE
  • Organization-scoped access to dbt models and projects
  • Real-time data access without manual imports
  • Semantic search capabilities across your dbt documentation
  • Detailed model information including SQL, lineage, and metadata

8.2 Available MCP Tools

The MCP server exposes these tools to LLM clients:

  • 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

8.3 Setting Up the MCP Server

Prerequisites

  1. Self-hosted Ragstar running with Docker Compose
  2. dbt project connected and models loaded in your knowledge base
  3. LLM client that supports MCP (e.g., Claude.ai, ChatGPT with MCP support)

Configuration

The MCP server runs on port 8080 by default. Add these environment variables to your .env file:

bash
# MCP Server Configuration
MCP_AUTHORIZATION_BASE_URL=http://localhost:8000  # Your Django backend URL
DJANGO_BACKEND_URL=http://localhost:8000          # Backend URL for MCP server
ALLOWED_ORIGINS=*                                 # Or specific origins for security

Starting the MCP Server

The MCP server is included in the Docker Compose stack:

bash
# Start all services including MCP server
docker compose up -d

# Check MCP server health
curl http://localhost:8080/health

8.4 OAuth 2.0 Flow Explanation

The MCP server implements a complete OAuth 2.0 authorization flow with organization-scoped access. Here's how it works:

Flow Overview

Key Components

  1. OAuth Metadata Discovery: MCP server exposes RFC 8414 compliant metadata endpoints
  2. PKCE Security: Uses Proof Key for Code Exchange for enhanced security
  3. Auto-Registration: Automatically registers new OAuth clients (like Claude.ai)
  4. Organization Scoping: All data access is automatically scoped to the user's organization
  5. JWT Tokens: Secure, stateless authentication using JSON Web Tokens

Security Features

  • 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

8.5 Connecting Claude.ai to Your MCP Server

Step 1: Configure MCP in Claude.ai

  1. Go to Claude.ai settings
  2. Find the "MCP Servers" or "Model Context Protocol" section
  3. Add a new server with these details:
    • Server URL: http://localhost:8080 (or your public URL)
    • OAuth: Enable OAuth 2.0 authentication
    • Auto-discovery: Enable to automatically discover capabilities

Step 2: Authorize the Connection

  1. Claude.ai will redirect you to your Ragstar login page
  2. Sign in with your Ragstar account
  3. You'll be redirected back to Claude.ai with authorization
  4. The connection will be linked to your organization

Step 3: Start Using MCP Tools

You can now ask Claude.ai to:

  • "List all my dbt models"
  • "Search for revenue-related models"
  • "Show me details about the customer_metrics model"
  • "What dbt projects do I have connected?"

8.6 Example MCP Interactions

Listing Models

You: "What dbt models do I have available?"
Claude: [Calls list_dbt_models tool]
Claude: "You have 23 dbt models across 2 projects:
- analytics_prod: 15 models (staging, marts schemas)
- marketing_analytics: 8 models (staging, reporting schemas)
..."

Searching Models

You: "Find models related to customer revenue"
Claude: [Calls search_dbt_models with "customer revenue"]
Claude: "I found 3 relevant models:
- customer_revenue_monthly (similarity: 0.95)
- customer_ltv_calculation (similarity: 0.87)
- revenue_attribution (similarity: 0.82)
..."

Getting Model Details

You: "Show me the SQL for customer_revenue_monthly"
Claude: [Calls get_model_details for "customer_revenue_monthly"]
Claude: "Here's the customer_revenue_monthly model:
- Schema: marts
- Materialization: table
- SQL: SELECT customer_id, DATE_TRUNC('month', order_date) as month, SUM(amount) as revenue FROM..."

8.7 Troubleshooting MCP Connection

Common Issues

  1. Authentication Fails: Check that your Ragstar backend is accessible and you're logged in
  2. No Models Found: Ensure your dbt project is connected and models are loaded
  3. Permission Errors: Verify the user has access to the organization's dbt projects
  4. Network Issues: Check firewall settings and port accessibility

Debug Commands

bash
# Check MCP server health
curl http://localhost:8080/health

# Test OAuth metadata
curl http://localhost:8080/.well-known/oauth-authorization-server

# View MCP server logs
docker compose logs -f mcp-server

8.8 Production Deployment

For production use:

  1. Use HTTPS: Configure SSL certificates for secure connections
  2. Restrict Origins: Set specific allowed origins instead of *
  3. Monitor Usage: Track OAuth token usage and API calls
  4. Scale Considerations: Each client needs its own server instance

8.9 Limitations

  • 1:1 Client-Server Relationship: Each MCP client needs its own server instance
  • Organization Scoping: Users can only access their own organization's data
  • Token Expiry: Access tokens expire after 1 hour (refresh tokens after 7 days)
  • Self-Hosted Only: Not available in hosted/SaaS deployments

9. Contributing

We 💛 community PRs. Please file an issue first for major changes. Make sure ruff, black, mypy, and eslint pass before opening a pull request.


10. License

Ragstar is released under the MIT License — see LICENSE.

استخدم MCP الخاص بـ Dbt Llm Agent مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Dbt Llm Agent، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف Dbt Llm Agent كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Dbt Llm Agent.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "dbt-llm-agent": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Dbt Llm Agent، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Dbt Llm Agent.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Dbt Llm Agent لمساعدتي في هذه المهمة؟
Dbt Llm Agent
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Dbt Llm Agent.

الأسئلة الشائعة

ما استخدامات خادم MCP Dbt Llm Agent؟

Dbt Llm Agent هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Dbt Llm Agent مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Dbt Llm Agent مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Dbt Llm Agent مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Dbt Llm Agent، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Dbt Llm Agent بـ TypingMind؟

يعمل Dbt Llm Agent عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Dbt Llm Agent في TypingMind؟

يتيح Dbt Llm Agent إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Dbt Llm Agent؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Dbt Llm Agent يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇