How dayoawe1/sales-forecasting-assistant works
This repository delivers a weekly sales-forecasting pipeline and a question-answering assistant over its forecasts. Airflow schedules raw-data loading, Snowflake staging, feature creation, model quality evaluation, forecasting, and assistant-index refresh. Users then query forecasts through an LLM that can run guarded read-only SQL or retrieve generated summaries. The graph preserves the documented backtest/model-comparison capability, but its implementation is not shown in the sampled sources. Edges are limited to documented workflow and visible calls; unsampled staging SQL details are not inferred.
Main entry points: sales_forecasting_dag.py Weekly Airflow DAG · index.py Summary embedding and search · assistant.py Question-answering agent · run_staging.py Staging runner
Components 15
Forecast workflow
- Weekly Airflow DAG
dags/sales_forecasting_dag.py
Data preparation
- Raw CSV loader
src/ingest/load_raw.py - Staging runner
src/transform/run_staging.py - Staging transforms
sql/03_staging.sql - Feature builder
src/features/build_features.py
Forecast modeling
- Model evaluation and forecasts
src/models/train_forecast.py - Model backtest comparisons
notebooks/03_models.ipynb
Insights assistant
- Forecast summaries
src/rag/summaries.py - Summary embedding and search
src/rag/index.py - Question-answering agent
src/rag/assistant.py - Assistant evaluation
src/rag/evaluate_assistant.py - Local vector and document files
Other components
- Business user
- Snowflake
- OpenAI API
Connections 23
- Weekly Airflow DAG → Raw CSV loader: schedules loading
dags/sales_forecasting_dag.py - Weekly Airflow DAG → Staging runner: schedules staging
dags/sales_forecasting_dag.py - Weekly Airflow DAG → Feature builder: schedules features
dags/sales_forecasting_dag.py - Weekly Airflow DAG → Model evaluation and forecasts: schedules evaluation
dags/sales_forecasting_dag.py - Weekly Airflow DAG → Model evaluation and forecasts: schedules forecast
dags/sales_forecasting_dag.py - Weekly Airflow DAG → Summary embedding and search: schedules refresh
dags/sales_forecasting_dag.py - Raw CSV loader → Snowflake: writes raw tables
src/ingest/load_raw.py - Staging runner → Staging transforms: executes SQL
src/transform/run_staging.py - Staging runner → Snowflake: runs statements
src/transform/run_staging.py - Feature builder → Snowflake: reads staging; writes features
src/features/build_features.py - Model evaluation and forecasts → Snowflake: reads features; writes results
src/models/train_forecast.py - Model backtest comparisons → Snowflake: records comparisons
- Forecast summaries → Snowflake: reads and writes summaries
src/rag/summaries.py - Summary embedding and search → Forecast summaries: builds summaries
src/rag/index.py - Summary embedding and search → Snowflake: reads summaries
src/rag/index.py - Summary embedding and search → OpenAI API: requests embeddings
src/rag/index.py - Summary embedding and search → Local vector and document files: stores vectors and docs
src/rag/index.py - Question-answering agent → OpenAI API: requests responses
src/rag/assistant.py - Question-answering agent → Snowflake: runs guarded SQL
src/rag/assistant.py - Question-answering agent → Summary embedding and search: searches summaries
src/rag/assistant.py - Business user → Question-answering agent: asks questions
README.md - Assistant evaluation → Question-answering agent: evaluates answers
src/rag/evaluate_assistant.py - Assistant evaluation → Snowflake: queries ground truth
src/rag/evaluate_assistant.py