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