Skip to content

An AI-powered analytics platform that transforms how you interact with Tableau Cloud. Chat with your dashboards, discover visualizations through natural language, and get instant insights from your data using Google Gemini AI.

Notifications You must be signed in to change notification settings

shalwin04/ai-insights-copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Tableau AI Copilot

Your intelligent AI assistant for Tableau Cloud - powered by Google Gemini and LangGraph agents

An AI-powered analytics platform that transforms how you interact with Tableau Cloud. Chat with your dashboards, discover visualizations through natural language, and get instant insights from your data using Google Gemini AI.

Live Demo GitHub YouTube

Version Tableau Gemini Node TypeScript


πŸ”— Quick Links

🎯 What Makes This Special?

Tableau AI Copilot bridges the gap between Tableau's powerful visualizations and natural language interaction. Instead of browsing through workbooks and views manually, simply ask questions and let AI find, display, and explain your dashboards.

Key Innovation:

  • πŸ€– AI-Powered Discovery: Semantic search across all your Tableau workbooks, views, and data sources
  • πŸ’¬ Natural Language Chat: "Show me sales dashboard" β†’ Instantly displays the right Tableau visualization
  • 🎨 Embedded Visualizations: View and interact with Tableau dashboards directly in the chat interface
  • πŸ”’ Secure Authentication: JWT-based authentication using Tableau Connected Apps

✨ Features

πŸ“Š Tableau Integration

  • Connected Apps JWT Authentication: Secure, server-side authentication with Tableau Cloud
  • Semantic Workbook Discovery: AI-powered search across workbooks, views, and data sources
  • Embedded Tableau Embedding API v3: Interactive dashboards rendered directly in the chat
  • Real-Time Indexing: Automatic workbook metadata indexing for instant discovery
  • Multi-Project Support: Search across all your Tableau projects and folders

πŸ€– Intelligent AI Agents (LangGraph)

  • Router Agent: Classifies user intent (Tableau discovery, data analysis, visualization)
  • Tableau Discovery Agent: Semantic search for Tableau content with OpenAI embeddings
  • Data Retriever Agent: Finds relevant datasets from Google Drive and other sources
  • Analyzer Agent: Plans and executes data analysis workflows
  • Summarizer Agent: Generates natural language insights and recommendations

πŸ“ˆ Data Analytics

  • Multi-Source Data Integration: Google Drive, CSV uploads, Excel files
  • Semantic Search: Vector-based search using OpenAI embeddings
  • Automated Workflows: Create pipelines from data ingestion to insights
  • Real-Time Insights: Live progress updates as agents analyze your data

πŸ’¬ Natural Language Interface

  • Chat with Tableau dashboards using plain English
  • Context-aware conversations with memory
  • Real-time agent progress indicators
  • Session history persistence

🎨 Beautiful User Interface

  • Modern React UI with Tailwind CSS and shadcn/ui
  • Responsive design with dark mode support
  • Real-time WebSocket updates
  • Interactive data canvas for pinning insights

πŸ—οΈ Architecture

Frontend (React + TypeScript)
    ↓ REST API + WebSocket
Backend (Node.js + Express)
    ↓ LangGraph Multi-Agent Workflow
AI Agents (Router β†’ Tableau Discovery β†’ Analyzer β†’ Summarizer)
    ↓ Google Gemini Pro + OpenAI Embeddings
Tableau Cloud (REST API v3.22 + Embedding API v3)
    ↓ Connected Apps JWT Auth
Vector Search (ChromaDB - Optional)
External Data Sources (Google Drive, Files)

Key Technologies:

  • AI/ML: LangChain.js, LangGraph, Google Gemini Pro, OpenAI Embeddings
  • Tableau: REST API v3.22, Embedding API v3, Connected Apps (Direct Trust)
  • Backend: Node.js, Express, TypeScript, Socket.IO
  • Frontend: React, TypeScript, Tailwind CSS, shadcn/ui, Framer Motion
  • Auth: OAuth 2.0 (Google), Tableau JWT (Connected Apps)
  • Vector DB: ChromaDB (optional for enhanced search)

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • OpenAI API key (for embeddings)
  • Google Gemini API key
  • Tableau Cloud account with Connected Apps enabled
  • Google Cloud Console project (for Google Drive integration)

1. Clone the Repository

git clone <repository-url>
cd googlecloud-ai-accelerate

2. Configure Backend

cd Backend
npm install

# Create .env file with Tableau credentials
cat > .env << EOF
# Server
PORT=3000
SESSION_SECRET=your-secure-random-secret
FRONTEND_URL=

# AI Services
OPENAI_API_KEY=your-openai-api-key
GOOGLE_AI_API_KEY=your-gemini-api-key

# Tableau Cloud Connected Apps (Direct Trust)
TABLEAU_SERVER_URL=
TABLEAU_SITE_NAME=your-site-name
TABLEAU_USERNAME=your-tableau-username
TABLEAU_CLIENT_ID=your-connected-app-client-id
TABLEAU_SECRET_ID=your-connected-app-secret-id
TABLEAU_CLIENT_SECRET=your-connected-app-secret-value

# Optional: ChromaDB (for enhanced vector search)
CHROMA_ENABLED=false
CHROMA_URL=http://localhost:8000
EOF

Setting Up Tableau Connected Apps

  1. Go to Tableau Cloud β†’ Settings β†’ Connected Apps
  2. Create a new Connected App with Direct Trust
  3. Enable scopes: tableau:content:read, tableau:workbooks:read, tableau:views:embed
  4. Copy the Client ID, Secret ID, and Secret Value to your .env file

3. Configure Frontend

cd ../Frontend
npm install

# Create .env file
cat > .env << EOF
VITE_API_URL=http://localhost:3000
VITE_GOOGLE_CLIENT_ID=your-google-client-id
EOF

4. Start the Application

Terminal 1 (Backend):

cd Backend
npm run dev

Terminal 2 (Frontend):

cd Frontend
npm run dev

5. Open in Browser

http://localhost:5173

🎯 Usage

1. Connect to Tableau Cloud

  1. Open the application
  2. Navigate to the Tableau page (sidebar)
  3. Click "Connect to Tableau Cloud"
  4. Your workbooks will be automatically indexed

2. Browse Tableau Workbooks

  • View all your workbooks organized by project
  • Expand workbooks to see individual views
  • Click "Show Visualization" to embed dashboards
  • Interact with visualizations directly in the browser

3. Chat with Your Tableau Data

Ask natural language questions:

Tableau Discovery:

  • "Show me the sales dashboard"
  • "Find visualizations about revenue"
  • "What Tableau reports do I have for Q4?"
  • "Display the executive summary workbook"

Data Analysis:

  • "Analyze trends in my sales data"
  • "What are the key insights from Q4?"
  • "Compare revenue across regions"
  • "Summarize my customer data"

4. Watch the AI Agents Work

The interface shows real-time progress:

  1. πŸ€– Router analyzes your intent
  2. πŸ“Š Tableau Discovery searches for relevant dashboards
  3. πŸ” Retriever finds additional data if needed
  4. πŸ“ˆ Analyzer generates insights
  5. ✍️ Summarizer creates natural language summaries

πŸ“– Documentation

πŸ“Š API Endpoints

Tableau Endpoints

Endpoint Method Description
/api/tableau/auth/connect POST Connect with server-side credentials
/api/tableau/auth/status GET Check Tableau authentication status
/api/tableau/auth/embedding-token GET Get JWT token for embedding
/api/tableau/workbooks GET List all workbooks
/api/tableau/views GET List all views
/api/tableau/views/:id/embed-url GET Get embed URL for a view

Core Endpoints

Endpoint Method Description
/api/auth/google GET Initiate Google OAuth
/api/drive/files GET List Google Drive files
/api/chat/message POST Send chat message to AI agents
/api/workflows GET List automated workflows

πŸ§ͺ Testing

Test Tableau Integration

cd Backend
npm run test:tableau

Test AI Workflow

npm run test:workflow

Manual Testing

# Connect to Tableau
curl -X POST http://localhost:3000/api/tableau/auth/connect

# Get workbooks
curl http://localhost:3000/api/tableau/workbooks \
  --cookie "connect.sid=your-session"

# Chat with Tableau
curl -X POST http://localhost:3000/api/chat/message \
  -H "Content-Type: application/json" \
  -d '{"message": "Show me sales dashboard"}' \
  --cookie "connect.sid=your-session"

🎨 Features Showcase

Semantic Search for Tableau

Uses OpenAI embeddings to create vector representations of:

  • Workbook names and descriptions
  • View names and content URLs
  • Data source metadata
  • Project names and tags

Embedded Visualizations

Tableau Embedding API v3 with:

  • JWT token authentication
  • Interactive filters and parameters
  • Full toolbar support (refresh, download, maximize)
  • Responsive sizing

Multi-Agent Workflow

LangGraph orchestrates:

  1. Intent classification
  2. Parallel data retrieval (Tableau + files)
  3. Context-aware analysis
  4. Natural language summarization

πŸ› Troubleshooting

Tableau Connection Issues

# Verify credentials
curl -X POST http://localhost:3000/api/tableau/auth/connect

# Check environment variables
echo $TABLEAU_CLIENT_ID

Common Issues:

  • Invalid Connected App credentials β†’ Verify Client ID and Secret in Tableau Cloud
  • Token expired β†’ Server automatically refreshes tokens
  • Missing scopes β†’ Ensure Connected App has read and embed permissions

Embedding Authentication Errors

If visualizations show "Sign in required":

  1. Check that /api/tableau/auth/embedding-token returns a valid JWT
  2. Verify Connected App has tableau:views:embed scope
  3. Ensure TABLEAU_USERNAME matches your Tableau Cloud username

OpenAI/Gemini API Errors

  • Verify API keys in .env
  • Check API credits and rate limits
  • Gemini Pro requires billing enabled on Google Cloud

πŸ—‚οΈ Project Structure

tableau-ai-copilot/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ agents/           # LangGraph AI agents
β”‚   β”‚   β”‚   β”œβ”€β”€ tableauAgent.ts         # Tableau integration
β”‚   β”‚   β”‚   β”œβ”€β”€ tableauDiscovery.ts     # Semantic search
β”‚   β”‚   β”‚   └── workflow.ts             # Multi-agent orchestration
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ tableau.ts              # Tableau REST API client
β”‚   β”‚   β”‚   └── tableauJWT.ts           # JWT token generation
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   └── tableau.ts              # Tableau API endpoints
β”‚   β”‚   └── config/
β”‚   β”‚       └── tableau.ts              # Tableau configuration
β”‚   └── package.json
β”‚
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ features/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TableauViz.tsx           # Embedding component
β”‚   β”‚   β”‚   β”‚   └── TableauWorkbookBrowser.tsx  # Workbook browser
β”‚   β”‚   β”‚   └── pages/
β”‚   β”‚   β”‚       └── TableauPage.tsx          # Main Tableau UI
β”‚   β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   β”‚   └── TableauContext.tsx           # Tableau state management
β”‚   β”‚   └── lib/
β”‚   β”‚       └── api.ts                       # API client
β”‚   └── package.json
β”‚
└── README.md

πŸ™ Acknowledgments

  • Tableau for the powerful analytics platform and Embedding API
  • Google for Gemini Pro AI and Cloud infrastructure
  • LangChain.js for agent orchestration framework
  • OpenAI for embeddings API
  • shadcn/ui for beautiful UI components

Tech Stack: TypeScript Β· React Β· Node.js Β· Google Gemini Β· Tableau Cloud Β· LangGraph Β· OpenAI

About

An AI-powered analytics platform that transforms how you interact with Tableau Cloud. Chat with your dashboards, discover visualizations through natural language, and get instant insights from your data using Google Gemini AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages