https://github.com/jasoncobra3/finops-copilot
An end-to-end AI-powered FinOps platform that ingests cloud billing data, analyzes cost trends, answers natural-language questions using a RAG pipeline (LangChain + FAISS + sentence-transformers + Groq), and provides actionable cost optimization recommendations. Includes a FastAPI backend and Streamlit dashboard UI - fully containerized with Docker
https://github.com/jasoncobra3/finops-copilot
ai-assistant cloud-cost-optimization cloud-enginee cost-analytics data-analysis devops docker faiss faiss-vector-database fastapi finops groq langchain llm pandas rag rag-pipeline sentence-transformers sqlite3 streamlit
Last synced: 5 days ago
JSON representation
An end-to-end AI-powered FinOps platform that ingests cloud billing data, analyzes cost trends, answers natural-language questions using a RAG pipeline (LangChain + FAISS + sentence-transformers + Groq), and provides actionable cost optimization recommendations. Includes a FastAPI backend and Streamlit dashboard UI - fully containerized with Docker
- Host: GitHub
- URL: https://github.com/jasoncobra3/finops-copilot
- Owner: jasoncobra3
- Created: 2025-09-18T03:24:33.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-09-24T19:15:19.000Z (7 months ago)
- Last Synced: 2025-09-25T10:36:39.651Z (7 months ago)
- Topics: ai-assistant, cloud-cost-optimization, cloud-enginee, cost-analytics, data-analysis, devops, docker, faiss, faiss-vector-database, fastapi, finops, groq, langchain, llm, pandas, rag, rag-pipeline, sentence-transformers, sqlite3, streamlit
- Language: Python
- Homepage:
- Size: 2.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฉ๏ธ AI-driven Cloud Cost Copilot (FinOps Assistant)
---
## ๐ Overview
**The FinOps Assistant is an AI-driven cloud cost analytics platform designed to help organizations monitor, analyze, and optimize their cloud spending.**
It provides:
- End-to-end pipeline: ETL โ KPIs โ RAG โ Recommendations โ API โ UI
- KPI dashboards to analyze cost trends
- Natural-language Q&A over your cost data and FinOps documentation
- Actionable recommendations to reduce costs
[](https://deepwiki.com/jasoncobra3/FinOps-Copilot)
---
## ๐งฉ Features
- Cost Analysis โ Monthly spend trends, top cost drivers, cost anomalies
- RAG Q&A โ Ask natural questions like โWhy did compute cost increase in May?โ
- Recommendations โ Detect idle resources, tagging gaps, sudden spikes
- UI + API โ Interactive Streamlit dashboard + FastAPI backend
- Evaluation Suite โ Measure retrieval quality (Recall@k) + answer quality
---
## ๐ง Architecture

---
## ๐๏ธ Directory Structure
```
โโโ app/
โ โโโ main.py # FastAPI backend entrypoint
โ โโโ models.py # SQLAlchemy schema (billing, resources)
โ โโโ analytics.py # KPI & trend calculations
โ โโโ rag.py # RAG pipeline setup (retriever + LLM)
โ โโโ etl.py # ETL piepline to validate data
| โโโ reccomendations.py # Suggestions Generation
| โโโ rag_qa.py # LangChain QA chain logic
โ โโโ validators.py # input validation, prompt-injection guard
|
โโโ docs/ # Project documentation
โ โโโ finops.md # Refernce Docs for LLM
โ โโโ PRD.pdf # Product requirement Document
โ โโโ Technical Design doc.pdf
โ โโโ Assets/
|
โโโ UI/
โ โโโ app.py # Streamlit frontend dashboard
โโโ scripts/
โ โโโ ingest_billing.py
โ โโโ seed _resources.py
โ โโโ build_faiss_index.py
โ โโโ update_assignments.py
| โโโ manage_data.py
โ โโโ ...
|
โโโ tests/ # Testing Files for evaluation
โ โโโ conftest.py
โ โโโ evaluate_rag.py
โ โโโ test_analytics.py
โ โโโ test_reccomendations.py
| โโโ test_reccomendations_api.py
โ โโโ rag_eval_results.json
|
|
โโโ data/ # SQLite DB (billing.db) & Data Files
โโโ requirements.txt
โโโ Dockerfile
โโโ docker-compose.yml
โโโ .dockerignore
โโโ .env.example
โโโ README.md
```
---
## โ๏ธ Tech Stack
| Layer | Technology | Purpose |
| ------------- | ------------------------------------------------------------- | ----------------------------- |
| ETL & DB |Python, SQLAlchemy, SQLite | Data ingestion + schema |
| Analytics | Pandas, SQL | KPI & cost trend calculations |
| RAG Pipeline | sentence-transformers, FAISS, LangChain, Groq LLM | Natural-language Q\&A |
| API Layer | FastAPI | Serve KPIs and Q\&A endpoints |
| Frontend | Streamlit | Interactive dashboard UI |
| Deployment | Docker, Docker Compose | Containerization |
| Observability | LangSmith | Logging + traces |
| Security | Prompt-injection guards, keyword filters | Secure LLM input |
---
## ๐งช Setup & Running Locally
1. **Clone repo**
```bash
git clone https://github.com/jasoncobra3/FinOps-Copilot.git
cd FinOps-Copilot
2. **Create environment**
```bash
python -m venv .venv
source venv/bin/activate # or venv\\Scripts\\activate (Windows)
3. **Install dependencies:**
```bash
pip install -r requirements.tx
4. **Initialize DB**
```bash
python -m app.models
5. **Generate Sammple Data**
```bash
python scripts/generate_sample_data.py
7. **Ingest sample data**
```bash
python scripts/ingest.py --input data/sample_billing.csv
python scripts/seed_resources.py
python scripts/update_assignments.py ##generate randomness in data
9. **Build RAG index**
```bash
python scripts/build_faiss_index.py
10. **Run FAstAPI Backend**
```bash
uvicorn app.main:app --reload
- FastAPI - http://localhost:8000
12. **Run Streamlit Frontend**
```bash
streamlit run UI/app.py
- Streamlit - http://localhost:8501
---
## ๐ Evaluation
**Run RAG retrieval evaluation**
```bash
python tests/eval_rag.py
```
- Outputs Recall@1/3/5 scores in CSV
- Also includes answer quality scores (1โ5 rubric)
---
## ๐ง Design Decisions & Trade-offs
- SQLite chosen for local simplicity, can migrate to PostgreSQL later
- FAISS is fast and lightweight for demo scale (vs hosted vector DBs)
- LangChain simplifies orchestration but adds abstraction โ documented clearly
- Streamlit is quick to build for MVP, though not production-grade
- Groq LLM chosen to avoid dependency on paid APIs
---
## ๐ Future Work
- Migrate to PostgreSQL for multi-user deployments
- Add real billing data ingestion from cloud APIs
- Implement cost optimization engine (idle resource detection, right-sizing)
- Add user auth + role-based access control
- Enhance Streamlit UI (filters, charts, reports)
- Deploy on Railway or Render with CI/CD
---
## ๐ธ Screenshots
| Dashboard KPI View| Month DropDown | Reccommendations |
|----------------|------------|---------------|
|  |  | |
| Underutilized resources| AI RAG Chatbot | Response With Resource group |
|----------------|------------|----------------|
||  |  |
---
## ๐ Contributing
**Feel free to fork, star, or submit a pull request to contribute improvements!**