When to use the Data Analyst Agent
The Data Analyst Agent is ideal when you need to:- Query databases: Write and execute SQL queries against your connected data sources
- Analyze data: Explore patterns, calculate metrics, and investigate trends in your data
- Create visualizations: Generate professional charts and graphs using seaborn
- Answer data questions: Get quick, accurate answers to questions about your data
- Generate insights: Discover patterns, anomalies, and actionable findings
Accessing the Data Analyst Agent
From the web app
- Go to the Devin home page
- Click the agent picker dropdown
- Select Data Analyst from the dropdown menu
- Start your session with a data-related question or task
From Slack
You can start a Data Analyst session directly from Slack using either method: Using the slash command:!dana macro:
Prerequisites
Before using the Data Analyst Agent, you’ll need to connect at least one data source via MCP (Model Context Protocol). Common integrations include:- Database MCPs: Redshift, PostgreSQL, Snowflake, BigQuery, and other SQL databases
- Analytics MCPs: Datadog, Metabase, and other observability platforms
Set up MCP integrations
Learn how to connect databases and other data sources via MCP
How it works
Database Knowledge
The Data Analyst Agent maintains a Database Knowledge note that contains schema documentation for your connected databases. This knowledge is automatically referenced before running queries, allowing the agent to quickly identify the right tables and columns.Example prompts
Here are some effective ways to use the Data Analyst Agent across different query types:Simple lookups
- “How many active users did we have last week?”
- “What’s our daily revenue trend for the past month?”
- “Which customers have the highest usage?”
Aggregations and metrics
- “What’s the average session duration by plan tier for the past 30 days?”
- “Show me total revenue grouped by region and product line for Q4”
- “Calculate the 95th percentile response time for each API endpoint this week”
Joins and cross-table analysis
- “Join our users table with the orders table and show the top 20 customers by lifetime value”
- “Correlate signup source with 30-day retention — which acquisition channels have the best retention rates?”
- “Combine session data with billing records to find accounts with high usage but low spend”
Filtering and segmentation
- “Show me only enterprise customers who signed up after January 2025 and have more than 100 sessions”
- “Filter error logs to 5xx errors from the payments service in the last 48 hours”
- “Break down consumption by enterprise vs. self-serve customers, excluding trial accounts”
Time-series analysis
- “Plot weekly active users over the past 6 months — highlight any weeks with more than 10% change”
- “Show me a month-over-month comparison of signup rates for 2025 vs. 2024”
- “What’s the daily trend for API calls over the past 90 days? Overlay a 7-day moving average”
Investigations and anomaly detection
- “Why did signups drop last Tuesday? Check if there were any related incidents or deployments”
- “Are there any anomalies in our error rates this week?”
- “Compare this month’s metrics to the same period last year and flag significant deviations”
Multi-step analysis
- “Analyze user retention by cohort for Q4, then identify which cohorts have the steepest drop-off and suggest possible causes”
- “Find the top 10 users by session count, show their activity over time, and flag any that look like potential churns”
Supported data sources
The Data Analyst Agent connects to your data through MCP (Model Context Protocol) integrations. You can connect multiple data sources and query across them. Below are some of the most common data sources available in the MCP Marketplace — this is not an exhaustive list.SQL databases
| Data source | MCP name | Setup |
|---|---|---|
| Amazon Redshift | Redshift | Connection string + credentials |
| PostgreSQL | PostgreSQL | Connection string |
| Snowflake | Snowflake | Account + credentials |
| Google BigQuery | BigQuery | OAuth or service account |
| MySQL | MySQL | Connection string |
| SQL Server | SQL Server | Connection string |
| Neon | Neon | OAuth |
| Supabase | Supabase | Personal access token |
| Cloud SQL (PostgreSQL, MySQL, SQL Server) | Cloud SQL | OAuth |
Analytics and observability platforms
| Data source | MCP name | Setup |
|---|---|---|
| Datadog | Datadog | API key + app key |
| Metabase | Metabase | OAuth |
| Grafana | Grafana | URL + service account token |
| Sentry | Sentry | OAuth |
Connecting a data source
- Navigate to Settings > MCP Marketplace
- Find your data source and click Enable
- Provide any required credentials (connection strings, API keys, or OAuth)
- Start a Data Analyst session — the agent will automatically discover your connected data sources
Set up MCP integrations
Full setup instructions for each data source
You can connect multiple data sources simultaneously. The Data Analyst Agent will use the appropriate MCP tools based on your query context.
Best practices
Be specific about metrics
Instead of asking vague questions, define exactly what you want to measure:Specify time periods
Always include the time range you’re interested in. The agent defaults to UTC when interpreting relative dates.Request specific output formats
Tell the agent how you want to see results — as a table, chart, or summary:Define business logic upfront
If your metrics have specific definitions, state them in your prompt to avoid ambiguity:Ask for comparisons and context
Adding comparison periods or benchmarks makes results more actionable:Iterate on results
You can ask follow-up questions in the same session to drill deeper:- Start broad: “What are our top 10 customers by revenue this quarter?”
- Drill down: “For the top 3, show me their monthly revenue trend over the past year”
- Investigate: “Customer X had a revenue spike in March — what drove that?”
Validate the SQL
The agent always includes the SQL query it used. Review it to ensure the logic matches your expectations, especially for complex analyses involving joins, filters, or aggregations.Output formats
The Data Analyst Agent returns results in several formats depending on the type of analysis:Tables
For data lookups and aggregations, results are returned as formatted tables:Charts and visualizations
When you request visual analysis or the data is best understood graphically, the agent generates charts using seaborn. Common chart types include:- Line charts — time-series trends, comparisons over time
- Bar charts — categorical comparisons, rankings
- Heatmaps — correlation matrices, activity patterns
- Scatter plots — relationship analysis between two metrics
Summaries and insights
For investigation-style prompts, the agent provides a structured response that includes:- Analysis summary — a plain-language answer to your question
- SQL query — the exact query used, so you can verify the logic
- Key numbers — the most important metrics highlighted
- Data insights — patterns, anomalies, or notable findings
- Metabase link — if your organization has Metabase connected via MCP, the agent may include a link to an interactive dashboard for further exploration
Knowledge management
The Data Analyst Agent can persist learnings across sessions using the knowledge system. When it discovers:- New schema information or table relationships
- Business logic or metric definitions
- Data quality patterns or caveats
Learn more about Knowledge
Understand how Devin’s knowledge system works
Differences from standard Devin
| Capability | Data Analyst Agent | Standard Devin |
|---|---|---|
| SQL query execution | Optimized | Supported |
| Data visualizations | Built-in seaborn support | Manual setup |
| Database schema awareness | Pre-loaded knowledge | On-demand exploration |
| Response style | Concise, metrics-focused | Detailed explanations |
| Code changes | Not primary focus | Full support |
| MCP integrations | Required | Optional |
