In-App AI Copilot

Ask questions about your analytics in plain English from the prompt bar at the bottom of the dashboard. Answers are computed in real time, directly against your PostgreSQL database.

Ask about your site with AI Assistant


How it works

The copilot converts natural language questions into secure, optimized database queries, interprets the results, and returns a contextual summary — no manual filtering required.

Example prompts

  • "What was our total pageview volume over the last 7 days compared to the previous week?"
  • "Which country generated the highest number of signup_completed events yesterday?"
  • "What is our current bounce rate on mobile devices versus desktop?"
  • "Did we experience any spike in JavaScript errors after yesterday's deployment?"
  • "What were the top 5 referring domains for traffic from Hacker News?"

Supported providers

The copilot works with any major LLM provider through the Vercel AI SDK. Add a key to your environment variables (.env.local or Vercel Environment Variables) to activate it:

ProviderEnvironment VariableRecommended Model
Google GeminiGEMINI_API_KEYgemini-2.0-flash
OpenAIOPENAI_API_KEYgpt-4o-mini
AnthropicANTHROPIC_API_KEYclaude-3-5-sonnet-latest
GroqGROQ_API_KEYllama-3.3-70b-versatile
OpenRouterOPENROUTER_API_KEYAny hosted model
NVIDIA NIMNVIDIA_API_KEYHosted NIM models

Privacy and security

  • Read-only. The AI assistant cannot alter database records, update configurations, or delete telemetry.
  • No raw PII transmission. diy-analytics doesn't collect personally identifiable information, so no visitor data is ever sent to model providers.

Next steps