Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/gemini-extension-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Gemini Extension

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., gemini-v1.0.0)'
required: true
type: string

env:
EXTENSION_VERSION: ${{ github.event.inputs.tag || github.ref_name }}

jobs:
release-gemini-extension:
name: Release Gemini Extension
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Build Gemini Extension
run: |
cd integrations/gemini
npm ci
npm run build
npm run package
env:
HUSKY: 0

- name: Create Gemini Extension Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.EXTENSION_VERSION }}
name: "Gemini Extension ${{ env.EXTENSION_VERSION }}"
files: integrations/gemini/release/**
body: |
## Rill Gemini Extension Release

This release contains the Rill integration for Google Gemini.

### Installation
```bash
gemini extensions install https://github.com/rilldata/rill --ref=${{ env.EXTENSION_VERSION }}
```

See the [README](https://github.com/rilldata/rill/blob/main/integrations/gemini/README.md) for setup instructions.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
notification_title: "Gemini Extension Release - ${{ env.EXTENSION_VERSION }}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ANNOUNCE_DD }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ web-common/tests/projects
web-local/tests/data

.env
.example.env
*.sql
*.bin
*.csv
Expand Down
5 changes: 5 additions & 0 deletions integrations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rill Integration

## Google Gemini Integration

Enhance your Rill Data experience with the Gemini integration, enabling advanced data analysis. Explore the [Gemini README](gemini/README.md) for detailed information on installation, configuration, and usage.
95 changes: 95 additions & 0 deletions integrations/gemini/GEMINI.md
Copy link
Contributor

@ericpgreen2 ericpgreen2 Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this language seems to be addressed to the end user (e.g. "By connecting to your Rill projects, the Gemini agent can..."), not the Gemini agent. I'd expect that the document would be exclusively addressed to the Gemini agent.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
## Rill Gemini Integration

You are an expert data analyst with access to Rill's metrics views through specialized tools. You can autonomously explore data, generate insights, and create text-based visualizations. When users ask about their data, you should use the available Rill tools to query metrics views and provide comprehensive analysis.

## Chart Generation

When users request data visualization, do not build web pages or React apps. Instead, create text-based visualizations using Unicode characters and formatting. Use these techniques:

Bar Charts using block characters:

Q1 ████████░░ 411

Q2 ██████████ 514

Q3 ██████░░░░ 300

Q4 ████████░░ 400

Horizontal progress bars: Project Progress:

Frontend ▓▓▓▓▓▓▓▓░░ 80%

Backend ▓▓▓▓▓▓░░░░ 60%

Testing ▓▓░░░░░░░░ 20%

Using different block densities: Trends:

Jan ▁▂▃▄▅▆▇█ High

Feb ▁▂▃▄▅░░░ Medium

Mar ▁▂░░░░░░ Low

Sparklines with Unicode Basic sparklines:

Stock prices: ▁▂▃▅▂▇▆▃▅▇

Website traffic: ▁▁▂▃▅▄▆▇▆▅▄▂▁

CPU usage: ▂▄▆█▇▅▃▂▄▆█▇▄▂

Trend indicators:

AAPL ▲ +2.3%

GOOG ▼ -1.2%

MSFT ► +0.5%

TSLA ▼ -3.1%

Simple trend arrows: Sales ↗️ (+15%) Costs ↘️ (-8%) Profit ⤴️ (+28%)

Pivot tables using text formatting:

| Region | Q1 Sales | Q2 Sales | Q3 Sales | Q4 Sales |
| ------ | -------- | -------- | -------- | -------- |
| North | $120,000 | $130,000 | $125,000 | $140,000 |
| South | $100,000 | $110,000 | $115,000 | $120,000 |
| East | $90,000 | $95,000 | $100,000 | $105,000 |
| West | $110,000 | $115,000 | $120,000 | $130,000 |

Line Charts characters:

```
Value
^
| /--------------- (Value)
| /
3 | /
| /
2 | /
| /
1 | /
| /
0 |______/
+---+---+---+---+---+---+---+---+---+---+---> Timeseries
0 1 2 3 4 5 6 7 8 9 10
```

## Analysis Guidelines

### When Users Encounter Issues

- **Access denied errors**: Inform users to ensure their Rill access token has appropriate permissions
- **No data found**: Guide users to verify their project contains metrics views with available data
- **Incomplete analysis**: Ask users for more specific context about which metrics to focus on

### Your Analysis Process

- **Be thorough**: Use available Rill tools to explore data comprehensively
- **Provide context**: Always explain what the data shows and why it matters
- **Cite your sources**: Reference specific metrics views and time ranges used
- **Offer insights**: Go beyond raw numbers to identify trends, patterns, and actionable findings
63 changes: 63 additions & 0 deletions integrations/gemini/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Gemini CLI Extension for Rill Data

Professional data analysis and report generation using Rill's metrics layer.

## Overview

Check out [Rill's Docs](https://docs.rilldata.com) for more information about Rill.

## Installation

Install the extension via GitHub using a specific release tag:

```bash
gemini extensions install https://github.com/rilldata/rill --ref=gemini-v1.0.0
```

> **Note**: Since this is a monorepo, you must specify a Gemini-specific release tag (prefixed with `gemini-v`) to ensure Gemini CLI picks up the correct extension files. See [Releases](https://github.com/rilldata/rill/releases) for available versions.

For the latest version, check the [releases page](https://github.com/rilldata/rill/releases) and use the most recent `gemini-v*` tag.

Install Rill CLI if you haven't already:

```bash
curl https://rill.sh | sh
```

## Configuration

After installation, configure the extension with your Rill credentials. The extension will prompt you for the following information during setup:

- **Organization**: Your Rill organization name
- **Project**: Your Rill project name
- **Access Token**: Your Rill access token

To generate a Rill authentication token, run:

```bash
rill token issue --display-name "Gemini Extension"
```

> **Tip**: You can find your organization and project names in the Rill Cloud UI URL: `https://ui.rilldata.com/{organization}/{project}`

The extension configuration is handled automatically through Gemini's settings interface - no manual environment file setup is required.

## Development

### Local Development

To test changes locally:

1. Make your changes to the extension files
2. Install the extension from your local development branch:
```bash
npm run -w integrations/gemini link
```
3. Test the extension in Gemini:
```bash
npm run -w integrations/gemini unlink
```

### Releasing

This extension is distributed through [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases)
39 changes: 39 additions & 0 deletions integrations/gemini/gemini-extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "rill",
"description": "Professional data analysis using Rill's metrics layer",
"version": "0.1.0",
"displayName": "Rill Analytics",
"contextFileName": "GEMINI.md",
"mcpServers": {
"rill": {
"httpUrl": "https://api.rilldata.com/v1/orgs/${RILL_ORG}/projects/${RILL_PROJECT}/runtime/mcp",
"headers": {
"Authorization": "Bearer ${RILL_ACCESS_TOKEN}",
"Content-Type": "application/json"
},
"env": {
"RILL_ORG": "${RILL_ORG}",
"RILL_PROJECT": "${RILL_PROJECT}",
"RILL_ACCESS_TOKEN": "${RILL_ACCESS_TOKEN}"
}
}
},
"settings": [
{
"name": "Organization",
"description": "Your Rill organization name",
"envVar": "RILL_ORG"
},
{
"name": "Project",
"description": "Your Rill project name",
"envVar": "RILL_PROJECT"
},
{
"name": "Access Token",
"description": "Your Rill access token",
"envVar": "RILL_ACCESS_TOKEN",
"sensitive": true
}
]
}
23 changes: 23 additions & 0 deletions integrations/gemini/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "rill",
"version": "0.1.0",
"description": "Data analysis using Rill's metrics layer",
"license": "Apache-2.0",
"type": "module",
"author": {
"name": "Rill Data",
"email": "[email protected]",
"url": "https://rilldata.com"
},
"scripts": {
"build": "echo 'No build required'",
"link": "gemini extensions link .",
"unlink": "gemini extensions uninstall rill",
"format": "prettier --write \"**/*.{ts,js,json,md}\""
},
"repository": {
"type": "git",
"url": "https://github.com/rilldata/rill",
"directory": "integrations/gemini"
}
}
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"workspaces": [
"docs",
"integrations/gemini",
"web-admin",
"web-common",
"web-integration",
Expand Down
11 changes: 9 additions & 2 deletions runtime/ai/analyst_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ func (t *AnalystAgent) CheckAccess(ctx context.Context) bool {
return false
}

// Only allow for rill user agents since it's not useful in MCP contexts.
if !strings.HasPrefix(s.CatalogSession().UserAgent, "rill") {
// Allow for rill user agents and rill integrations
// Check if the user agent indicates this is a Rill client or integration
agent := s.CatalogSession().UserAgent
isRillClient := strings.HasPrefix(agent, "rill")

// Allow rill-gemini-extension specifically for Gemini integration
isGeminiIntegration := strings.Contains(agent, "rill-gemini-extension")

if !isRillClient && !isGeminiIntegration {
return false
}

Expand Down
Loading