Skip to main content
This documentation describes the integration of MindsDB with Gong, a conversation intelligence platform that captures, analyzes, and provides insights from customer conversations. The integration allows MindsDB to access call recordings, transcripts, analytics, and other conversation data from Gong and enhance it with AI capabilities.

Prerequisites

Before proceeding, ensure the following prerequisites are met:
  1. Install MindsDB locally via Docker or Docker Desktop.
  2. To connect Gong to MindsDB, install the required dependencies following this instruction.
  3. Obtain a Gong API key from your Gong API settings page.

Connection

Establish a connection to Gong from MindsDB by executing the following SQL command and providing its handler name as an engine.
CREATE DATABASE gong_datasource
WITH
    ENGINE = 'gong',
    PARAMETERS = {
        "api_key": "your_gong_api_key_here"
    };

Using Basic Authentication

CREATE DATABASE gong_datasource
WITH
    ENGINE = 'gong',
    PARAMETERS = {
        "access_key": "your_access_key",
        "secret_key": "your_secret_key"
    };
Required connection parameters include the following: Authentication (choose one method):
  • api_key: Bearer token for authentication (recommended)
  • access_key + secret_key: Basic authentication credentials (alternative method)
Optional connection parameters include the following:
  • base_url: Gong API base URL. This parameter defaults to https://api.gong.io.
  • timeout: Request timeout in seconds. This parameter defaults to 30.
If both authentication methods are provided, basic auth (access_key + secret_key) takes precedence.

Usage

The following usage examples utilize gong_datasource as the datasource name, which is defined in the CREATE DATABASE command.

Available Tables

The Gong handler provides access to the following tables:
  • calls - Access call recordings and metadata
  • users - Get user information and permissions
  • analytics - Access AI-generated conversation insights
  • transcripts - Get full conversation transcripts

Basic Queries

Retrieve recent calls with date filters (recommended for best performance):
SELECT * 
FROM gong_datasource.calls 
WHERE date >= '2024-01-01' AND date < '2024-02-01'
ORDER BY date DESC
LIMIT 20;
Get all users in your organization:
SELECT user_id, name, email, role, status 
FROM gong_datasource.users 
LIMIT 100;
Get analytics for calls with high sentiment scores:
SELECT call_id, sentiment_score, key_phrases, topics 
FROM gong_datasource.analytics 
WHERE sentiment_score > 0.7 
  AND date >= '2024-01-01'
LIMIT 50;
Get transcripts for a specific call:
SELECT speaker, timestamp, text 
FROM gong_datasource.transcripts 
WHERE call_id = '12345'
ORDER BY timestamp;

Advanced Queries with JOINs

Get calls with their sentiment analysis:
SELECT 
    c.title,
    c.date,
    c.duration,
    a.sentiment_score,
    a.key_phrases
FROM gong_datasource.calls c
JOIN gong_datasource.analytics a ON c.call_id = a.call_id
WHERE c.date >= '2024-01-01' AND c.date < '2024-02-01'
ORDER BY a.sentiment_score DESC
LIMIT 25;
Find calls where specific keywords were mentioned:
SELECT 
    c.title,
    c.date,
    t.speaker,
    t.text
FROM gong_datasource.calls c
JOIN gong_datasource.transcripts t ON c.call_id = t.call_id
WHERE c.date >= '2024-01-01'
  AND t.text LIKE '%pricing%'
LIMIT 50;
Get user performance with call sentiment:
SELECT 
    u.name,
    u.email,
    c.call_id,
    c.title,
    a.sentiment_score
FROM gong_datasource.users u
JOIN gong_datasource.calls c ON u.user_id = c.user_id
JOIN gong_datasource.analytics a ON c.call_id = a.call_id
WHERE c.date >= '2024-01-01'
  AND a.sentiment_score > 0.8
LIMIT 100;

Data Schema

calls Table

ColumnDescription
call_idUnique identifier for the call (Primary Key)
titleCall title or description
dateCall date and time (ISO-8601 format)
durationCall duration in seconds
recording_urlURL to the call recording
call_typeType of call (e.g., “sales”, “demo”)
user_idID of the user who made the call
participantsComma-separated list of participants
statusCall status

users Table

ColumnDescription
user_idUnique identifier for the user (Primary Key)
nameUser’s full name
emailUser’s email address
roleUser’s role in the organization
permissionsComma-separated list of user permissions
statusUser status

analytics Table

ColumnDescription
call_idReference to the call (Primary Key, Foreign Key to calls.call_id)
sentiment_scoreSentiment analysis score
topic_scoreTopic detection score
key_phrasesComma-separated list of key phrases
topicsComma-separated list of detected topics
emotionsComma-separated list of detected emotions
confidence_scoreConfidence score for the analysis

transcripts Table

ColumnDescription
segment_idUnique identifier for the transcript segment (Primary Key)
call_idReference to the call (Foreign Key to calls.call_id)
speakerName of the speaker
timestampTimestamp of the transcript segment (ISO-8601 format)
textTranscribed text
confidenceConfidence score for the transcription

Troubleshooting

Authentication Error
  • Symptoms: Failure to connect MindsDB with Gong.
  • Checklist:
    1. Verify that your Gong API key is valid and not expired.
    2. Ensure you have the necessary permissions in Gong to access the API.
    3. Check that your API key has access to the specific data you’re querying.
    4. If using basic authentication, verify both access_key and secret_key are correct.
Empty Results or Missing Data
  • Symptoms: Queries return no results or incomplete data.
  • Checklist:
    1. Verify that date filters are included in your query (required for calls, analytics, transcripts).
    2. Check that the date range includes data (analytics and transcripts have ~1 hour lag).
    3. Ensure call_id exists when querying transcripts for a specific call.
    4. Verify that your Gong account has data for the requested time period.
Slow Query Performance
  • Symptoms: Queries take a long time to execute.
  • Checklist:
    1. Add date filters to limit the data range (essential for large datasets).
    2. Use LIMIT to restrict the number of results.
    3. Filter by call_id when querying transcripts.
    4. Avoid querying transcripts without filters (can return thousands of rows per call).