Spaces:
Sleeping
Sleeping
Download agents/analytics_pipeline.py from mgbam/BizIntel_AI: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/spaces/mgbam/BizIntel_AI/resolve/38a93577ecde2f2d79195ff9ca31ad44c7c26c4a/agents/analytics_pipeline.py
- Command line
-
hf download hf://spaces/mgbam/BizIntel_AI@38a93577ecde2f2d79195ff9ca31ad44c7c26c4a/agents/analytics_pipeline.py
-
curl -L -o analytics_pipeline.py https://huggingface.co/spaces/mgbam/BizIntel_AI/resolve/38a93577ecde2f2d79195ff9ca31ad44c7c26c4a/agents/analytics_pipeline.py
1.72 kB
| from google.adk.agents import LlmAgent | |
| from tools import csv_parser, plot_generator, forecaster | |
| trend_detector_agent = LlmAgent( | |
| name="trend_detector_agent", | |
| model="gemini-2.5-pro-exp-03-25", | |
| description="Detects trends and anomalies in business data.", | |
| instruction=""" | |
| Analyze the input table. Identify major trends, seasonal patterns, | |
| and anomalies (spikes or drops). Return a concise summary. | |
| """, | |
| tools=[csv_parser.parse_csv_tool, plot_generator.plot_sales_tool] | |
| ) | |
| forecast_agent = LlmAgent( | |
| name="forecast_agent", | |
| model="gemini-2.5-pro-exp-03-25", | |
| description="Forecasts future metrics from time series data.", | |
| instruction=""" | |
| Forecast next 3 months of sales based on historical patterns. | |
| Use the forecast tool to generate a visual chart. | |
| """, | |
| tools=[forecaster.forecast_tool] | |
| ) | |
| strategy_agent = LlmAgent( | |
| name="strategy_agent", | |
| model="gemini-2.5-pro-exp-03-25", | |
| description="Recommends strategic business decisions.", | |
| instruction=""" | |
| Based on trends and forecasts, suggest optimization strategies | |
| across marketing, operations, and finance (ROI, CAC, churn). | |
| """ | |
| ) | |
| analytics_coordinator = LlmAgent( | |
| name="analytics_coordinator", | |
| model="gemini-2.5-pro-exp-03-25", | |
| description="Coordinates full BI pipeline: trends, forecast, strategy.", | |
| instruction=""" | |
| Run the following: | |
| 1. Analyze the CSV with trend_detector_agent | |
| 2. Forecast future metrics using forecast_agent | |
| 3. Recommend business strategies using strategy_agent | |
| Return a full dashboard-style summary. | |
| """, | |
| sub_agents=[trend_detector_agent, forecast_agent, strategy_agent] | |
| ) | |