Skip to content

ElasticRun/chat-data-genie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Chat with Databricks Genie

A Google Chat bot integration with Databricks Genie for natural language queries on your data.

Features

  • 🤖 Natural language queries to SQL conversion
  • 📋 Formatted table responses in chat
  • 🔄 Async processing for complex queries
  • 💬 Support for both DM and Space conversations
  • 🔐 Secure authentication with service accounts
  • ⚡ Real-time and async response handling
  • 🔎 Can show the SQL query used (optional)

Upcoming Features

  • 🔀 Switch between Genie spaces with Chat commands
  • 📁 Export large data volume response directly to a Google Sheet

Architecture

┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│  Google Chat │───>│  Apps Script │───>│  Databricks  │
│              │<───│    ChatBot   │<───│    Genie     │
└──────────────┘    └──────────────┘    └──────────────┘

Setup

  1. Configure Databricks Genie Space:
const CONFIG = {
  DATABRICKS: {
    INSTANCES: [
      {
        name: 'Primary Instance',
        baseUrl: 'https://your-instance.cloud.databricks.com',
        genieSpaceId: 'your-space-id'
      }
    ]
  }
}
  1. Set up Google Service Account:
  • Create service account in Google Cloud Console
  • Download JSON credentials
  • Update CONFIG.GOOGLE_SERVICE_ACCOUNT with credentials
  1. Deploy as Google Chat App:
  • Create new deployment in Apps Script
  • Configure OAuth consent screen
  • Enable Google Chat API
  • Add bot to spaces/DMs

Usage

Ask questions in natural language:

Chat Input: Get monthly sales for the last 3 months
Chat Response: 
🤖 Response: This report summarizes the total sales amount for each month over the last three months, organized by month and year.

📋 Results:
┌───────┬──────┬────────────────────┐
│ month │ year │ total_sales_amount │
├───────┼──────┼────────────────────┤
│ 5     │ 2025 │ 12000.00           │
│ 4     │ 2025 │ 11000.00           │
│ 3     │ 2025 │ 10000.00           │
└───────┴──────┴────────────────────┘

Configuration

Setting Description Default
SYNC_TIMEOUT Max sync processing time 25s
MESSAGE_POLL_INTERVAL Status check frequency 3s
ASYNC_TIMEOUT Max async processing time 1h

License

MIT License

Authors

  • Chintan Shah - Initial work

Status

Active development - Currently in beta testing

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors