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.

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_completedevents 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:
| Provider | Environment Variable | Recommended Model |
|---|---|---|
| Google Gemini | GEMINI_API_KEY | gemini-2.0-flash |
| OpenAI | OPENAI_API_KEY | gpt-4o-mini |
| Anthropic | ANTHROPIC_API_KEY | claude-3-5-sonnet-latest |
| Groq | GROQ_API_KEY | llama-3.3-70b-versatile |
| OpenRouter | OPENROUTER_API_KEY | Any hosted model |
| NVIDIA NIM | NVIDIA_API_KEY | Hosted NIM models |
diy-analytics detects active keys automatically. If more than one is set, it defaults to the fastest configured provider.
Privacy and security
- Read-only. The AI assistant cannot alter database records, update configurations, or delete telemetry.
- No raw PII transmission.
diy-analyticsdoesn't collect personally identifiable information, so no visitor data is ever sent to model providers.