A Google Chat bot integration with Databricks Genie for natural language queries on your data.
- 🤖 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)
- 🔀 Switch between Genie spaces with Chat commands
- 📁 Export large data volume response directly to a Google Sheet
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Google Chat │───>│ Apps Script │───>│ Databricks │
│ │<───│ ChatBot │<───│ Genie │
└──────────────┘ └──────────────┘ └──────────────┘
- Configure Databricks Genie Space:
const CONFIG = {
DATABRICKS: {
INSTANCES: [
{
name: 'Primary Instance',
baseUrl: 'https://your-instance.cloud.databricks.com',
genieSpaceId: 'your-space-id'
}
]
}
}- Set up Google Service Account:
- Create service account in Google Cloud Console
- Download JSON credentials
- Update
CONFIG.GOOGLE_SERVICE_ACCOUNTwith credentials
- Deploy as Google Chat App:
- Create new deployment in Apps Script
- Configure OAuth consent screen
- Enable Google Chat API
- Add bot to spaces/DMs
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 │
└───────┴──────┴────────────────────┘
| Setting | Description | Default |
|---|---|---|
| SYNC_TIMEOUT | Max sync processing time | 25s |
| MESSAGE_POLL_INTERVAL | Status check frequency | 3s |
| ASYNC_TIMEOUT | Max async processing time | 1h |
- Chintan Shah - Initial work
Active development - Currently in beta testing