The ai-analyst-agent helps users to interact with business data effortlessly using natural language. Generate SQL queries and visualizations without any prior SQL knowledge, while receiving AI-driven insights and recommendations to enhance decision-making.
claude install sorin177/ai-analyst-agentThe ai-analyst-agent helps users to interact with business data effortlessly using natural language. Generate SQL queries and visualizations without any prior SQL knowledge, while receiving AI-driven insights and recommendations to enhance decision-making.
[{"step":"Define your analysis goal and data source","action":"Specify the business question (e.g., 'Identify top-performing ad creatives') and the data you have access to (e.g., 'Google Ads API data for Q2 2024'). Use tools like Plai to export your ad data if needed.","tip":"Be specific about metrics (e.g., 'CTR > 5%') and timeframes (e.g., 'last 30 days'). Vague goals like 'analyze performance' will yield broad insights."},{"step":"Generate the SQL query","action":"Use the prompt template to ask the AI to write a SQL query that extracts the relevant data. For example: 'Generate a SQL query to find ad creatives with CTR > 5% in the last 30 days from my Google Ads data.'","tip":"If you don’t have SQL access, ask the AI to simulate the data structure (e.g., 'Assume I have a table called ad_creatives with columns: creative_id, clicks, impressions, spend')."},{"step":"Create a visualization","action":"Request the AI to generate visualization code (Python/JavaScript) based on the query results. For example: 'Create a line graph showing daily spend vs. conversions for the last 30 days.'","tip":"Specify the type of chart (e.g., 'bar chart for top 5 creatives by CTR') and any customizations (e.g., 'highlight creatives with CTR > 10% in green')."},{"step":"Interpret insights and recommendations","action":"Ask the AI to analyze the visualization and data to provide actionable insights and recommendations. For example: 'What are the top 3 underperforming ad groups, and what should I do next?'","tip":"Ask for trade-offs (e.g., 'Should I pause low-CTR creatives or optimize them?') and prioritize recommendations based on your business goals."},{"step":"Refine and iterate","action":"Use the AI’s output to refine your analysis. For example, if the initial insights are too broad, ask: 'Narrow this down to creatives with CTR < 3% and suggest specific A/B tests.'","tip":"Iterate by adjusting the SQL query or visualization parameters based on the AI’s feedback. For example, 'Show me the data segmented by device type.'"}]
Generate SQL queries from plain English questions
Create visualizations for business data
Receive actionable insights based on data analysis
Automate data reporting processes
claude install sorin177/ai-analyst-agentgit clone https://github.com/sorin177/ai-analyst-agentCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as an AI analyst agent. I have the following business data: [DATA_SOURCE_OR_DESCRIPTION]. My goal is to [SPECIFIC_ANALYSIS_GOAL, e.g., 'identify underperforming ad campaigns in Q3 2024']. Generate a SQL query to extract the relevant data, then create a visualization (e.g., bar chart, line graph) to highlight key insights. Finally, provide 2-3 actionable recommendations based on the findings. Format the output as: 1) SQL Query, 2) Visualization Code (use Python with matplotlib/seaborn or JavaScript with Chart.js), 3) Insights, 4) Recommendations.
### SQL Query
```sql
SELECT campaign_name, impressions, clicks, spend, conversions, ROUND((conversions / clicks) * 100, 2) AS conversion_rate
FROM ad_campaigns
WHERE campaign_status = 'active'
AND start_date BETWEEN '2024-07-01' AND '2024-09-30'
AND spend > 1000
ORDER BY conversion_rate ASC;
```
### Visualization Code (Python with matplotlib)
```python
import matplotlib.pyplot as plt
import pandas as pd
# Sample data (replace with actual query results)
data = {
'campaign_name': ['Summer Sale', 'Holiday Boost', 'New Product Launch', 'Back to School'],
'conversion_rate': [1.2, 0.8, 3.5, 2.1],
'spend': [5000, 8000, 12000, 6500]
}
df = pd.DataFrame(data)
plt.figure(figsize=(10, 6))
plt.bar(df['campaign_name'], df['conversion_rate'], color=['red' if x < 2 else 'green' for x in df['conversion_rate']])
plt.title('Conversion Rates by Campaign (Q3 2024)', fontsize=14)
plt.xlabel('Campaign Name', fontsize=12)
plt.ylabel('Conversion Rate (%)', fontsize=12)
plt.xticks(rotation=45)
plt.grid(axis='y', linestyle='--', alpha=0.7)
plt.tight_layout()
plt.show()
```
### Insights
1. **Underperformance Alert**: The 'Holiday Boost' campaign has the lowest conversion rate (0.8%) despite being the second-highest spend ($8,000). This suggests a misalignment between ad creative and audience targeting.
2. **High ROI Opportunity**: The 'New Product Launch' campaign stands out with a 3.5% conversion rate and $12,000 spend, indicating strong performance that could be scaled further.
3. **Budget Reallocation**: The 'Summer Sale' campaign ($5,000 spend) underperforms in conversion rate (1.2%) but may benefit from creative refreshes or audience segmentation.
### Recommendations
1. **Pause or Optimize 'Holiday Boost'**: Allocate $4,000 of its budget to the 'New Product Launch' campaign and reallocate the remaining $4,000 to test new creatives for 'Summer Sale' with a focus on mobile users.
2. **A/B Test Creatives**: Run a 2-week A/B test for 'Holiday Boost' using two new ad variants (video vs. carousel) to identify which format drives higher conversions.
3. **Scale 'New Product Launch'**: Increase the daily budget for 'New Product Launch' by 30% ($3,600/month) and expand targeting to lookalike audiences based on past converters.
*Note: Replace the sample data with your actual query results for precise insights.*Create and collaborate on interactive animations with powerful, user-friendly tools.
Your one-stop shop for church and ministry supplies.
Privacy analytics platform for B2B marketers
Analytics made easy. Insights, control, and security.
Enhance employee engagement through customizable peer recognition and instant feedback.
Dynamic Pricing Platform for Retailers & D2C Brands
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan