Google Drive Integration - Getting Started

Learn how to integrate Demeterics into your workflows with step-by-step guides and API examples.

Google Drive Integration - Getting Started

This guide will help you connect Google Drive to Demeterics and create your first custom prompt for AI Chat.


Overview

Demeterics integrates with Google Drive to let you create, edit, and manage AI prompts (.dmt files) directly from your Drive. This enables:

  • Prompt versioning - Use Google Drive's built-in version history
  • Team collaboration - Share prompts with teammates using standard Drive sharing
  • Multiple variants - Store US, EU, APAC versions in a single file
  • A/B testing - Randomly select variants to test what works best

Privacy-First Permissions

Demeterics uses restricted Google Drive scopes:

What we CAN do What we CANNOT do
Access files you create with Demeterics See your other Google Drive files
Access files you explicitly open with Demeterics List or search your Drive contents
Create new .dmt files in your Drive Access your documents, photos, or other files

Step 1: Connect Google Drive

  1. Go to https://demeterics.ai/drive/install
  2. Click "Connect Google Drive"
  3. Sign in with your Google account (if not already signed in)
  4. Review the permissions and click "Allow"

You'll see a confirmation that Google Drive is connected.


Step 2: Create Your First Prompt

Option A: Create from Demeterics

  1. After connecting, you'll be redirected to the Prompt Editor
  2. Enter a name for your prompt (e.g., "Customer Support Agent")
  3. Write your system prompt in the editor
  4. Click "Save to Drive"

Your prompt is now saved as a .dmt file in your Google Drive.

Option B: Create from Google Drive

  1. Open Google Drive
  2. Click "+ New" button
  3. Select "More → Demeterics Prompt"
  4. The Demeterics editor opens in a new tab
  5. Write your prompt and save

Step 3: Add Variants (Optional)

Variants let you store multiple versions of the same prompt:

  1. In the editor, click the "+" button next to the variant tabs
  2. Enter a variant name (e.g., "US", "EU", "Formal", "Casual")
  3. Choose whether to copy content from the current variant
  4. Edit the new variant's content
  5. Save to Drive

Setting the default variant:

  • Click the dropdown menu (⋮) on any variant tab
  • Select "Set as default"

Step 4: Use in AI Chat

Now let's use your prompt in an AI Chat agent:

Create or Edit an Agent

  1. Go to your AI Chat agent: https://demeterics.ai/ai-chat/DEM-XXXXXXX
  2. Navigate to Prompts section
  3. Click on an existing prompt or create a new one

Select Prompt Source

In the prompt editor, you'll see two options:

Source Description
Custom Write prompt directly in Demeterics (current experience)
Prompt Drive Select a .dmt file from your Google Drive

Using Prompt Drive

  1. Select "Prompt Drive" as the source
  2. Choose your prompt file from the dropdown (e.g., "Customer Support Agent")
  3. Select a variant:
    • Auto - Randomly selects a variant for A/B testing
    • Specific variant - Always uses the selected variant (A, B, US, EU, etc.)
  4. Save the agent configuration

Step 5: Test Your Agent

  1. Go to https://demeterics.ai/ai-chat/test/DEM-XXXXXXX
  2. Start a conversation
  3. The AI will use your prompt from Google Drive

Tip: If using "Auto" variant selection, check the interaction logs to see which variant was used.


Managing Your Prompts

Edit a Prompt

From Demeterics:

  1. Go to your agent's prompt settings
  2. Click the edit icon next to the Prompt Drive file

From Google Drive:

  1. Find your .dmt file in Google Drive
  2. Double-click to open in Demeterics editor
  3. Make changes and save

Sync Behavior

When you edit a prompt in the Demeterics editor:

  1. Changes are saved to Google Drive (source of truth)
  2. A synced copy is stored in Demeterics for fast access by api.demeterics.com
  3. Your AI Chat agents automatically use the latest version

Version History

Google Drive maintains version history for your .dmt files:

  1. Right-click the file in Google Drive
  2. Select "Manage versions"
  3. View or restore previous versions

File Format Reference

.dmt files are JSON with the following structure:

{
  "version": "1.0",
  "type": "prompt",
  "name": "Customer Support Agent",
  "description": "System prompt for support chatbot",
  "default_variant": "US",
  "variants": {
    "US": {
      "content": "# Customer Support Agent\n\nYou are a helpful support agent...",
      "notes": "For US customers"
    },
    "EU": {
      "content": "# Customer Support Agent\n\nYou are a GDPR-compliant agent...",
      "notes": "GDPR-compliant version"
    }
  }
}

Troubleshooting

"Google Drive not connected"

  1. Go to https://demeterics.ai/drive/install
  2. Click "Connect Google Drive"
  3. Complete the OAuth flow

"Prompt not found"

  • Ensure the .dmt file exists in your Google Drive
  • Check that you have access to the file
  • Try disconnecting and reconnecting Google Drive

"Failed to save"

  • Check your internet connection
  • Ensure you have write access to the file
  • Try refreshing the page and saving again

Keyboard Shortcuts {#keyboard-shortcuts}

The Demeterics Drive editor supports these keyboard shortcuts:

Shortcut Action
Ctrl+S (Windows) / Cmd+S (Mac) Save to Google Drive
Escape Close dropdown menus

Auto-save: The editor automatically saves your changes every 30 seconds when modifications are detected.


Editor Features

The editor includes a familiar menu bar:

  • File - New, copy, share, and manage files
  • Edit - Add, rename, duplicate, and delete sections
  • View - Toggle preview mode and full-width editing
  • Marketplace - Browse and import pre-built promptlets
  • Help - Access documentation and support

Section-Based Editing

Each prompt can contain multiple sections:

  1. Click "+ Add Section" to create a new section
  2. Give each section a descriptive title
  3. Write content using Markdown formatting
  4. Drag sections to reorder them

Preview Mode

Toggle between:

  • Edit mode - Write and format your prompt
  • Preview mode - See how the formatted prompt looks

Best Practices

  1. Use descriptive names - "Customer Support - Holiday Season" instead of "Prompt 1"
  2. Add variant notes - Document what each variant is for
  3. Set a default variant - Ensure there's always a fallback
  4. Use folders - Organize prompts in a "Demeterics" folder in your Drive
  5. Share with team - Use Drive's sharing for collaboration
  6. Use sections - Break prompts into logical sections (personality, instructions, knowledge)

Next Steps