Skip to content

Mohit1053/Cement-Concall-RAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏭 Cement Industry Concall Analysis with RAG

Python LangChain ChromaDB Streamlit License

Complete RAG-powered system for downloading, indexing, and analyzing cement industry conference call transcripts.

Features β€’ Installation β€’ Usage β€’ RAG Pipeline β€’ Companies


🎯 Overview

This project provides an end-to-end solution for:

  1. Downloading conference call transcripts from multiple sources
  2. Processing and indexing transcripts using vector embeddings
  3. Analyzing business insights using RAG (Retrieval Augmented Generation)
  4. Querying through a user-friendly Streamlit interface

✨ Features

Feature Description
πŸ“₯ Auto Downloader Downloads concall transcripts from Market
πŸ” Vector Search ChromaDB-powered semantic search
πŸ€– RAG Analysis LangChain-based intelligent Q&A
πŸ“Š Business Insights Pre-built analysis tasks for growth, costs, market dynamics
πŸ–₯️ Streamlit UI Interactive web interface for queries
πŸ“‘ Multi-Company Covers 13 major cement companies

🏒 Companies Covered

  • ACC Limited
  • Ambuja Cements
  • Birla Corporation
  • Dalmia Bharat Ltd
  • Grasim Industries
  • India Cements
  • J K Cement
  • JK Lakshmi Cement
  • Nuvoco Vistas
  • Shree Cement
  • Star Cement
  • The Ramco Cements
  • UltraTech Cement

πŸ“¦ Installation

Prerequisites

  • Python 3.9+
  • OpenAI API Key (for embeddings and LLM)

Setup

# Clone the repository
git clone https://github.com/Mohit1053/Cement-Concall-RAG.git
cd Cement-Concall-RAG

# Create virtual environment
python -m venv .venv
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -r requirements.txt

# Set OpenAI API Key
export OPENAI_API_KEY="your-api-key"  # Linux/Mac
set OPENAI_API_KEY=your-api-key  # Windows

πŸ“‚ Project Structure

Cement_Concall_Project/
β”œβ”€β”€ πŸ“ concall_downloader/           # Transcript download scripts
β”‚   β”œβ”€β”€ download_concalls_final.py   # Main downloader
β”‚   β”œβ”€β”€ extract_concall_urls_2years.py
β”‚   β”œβ”€β”€ filter_concalls_2years.py
β”‚   β”œβ”€β”€ retry_failed_downloads.py
β”‚   └── config.py                    # Credentials (gitignored)
β”œβ”€β”€ πŸ“ Cement_Concall_Transcripts/   # Downloaded transcripts (56 files)
β”‚   β”œβ”€β”€ ACC Limited/
β”‚   β”œβ”€β”€ Ambuja Cements/
β”‚   β”œβ”€β”€ UltraTech Cement/
β”‚   └── ... (13 companies)
β”œβ”€β”€ πŸ“ rag_pipeline/                 # RAG system
β”‚   β”œβ”€β”€ πŸ“ core/
β”‚   β”‚   β”œβ”€β”€ vector_store.py          # ChromaDB operations
β”‚   β”‚   β”œβ”€β”€ text_processor.py        # Text chunking
β”‚   β”‚   └── entity_extraction.py     # Named entity extraction
β”‚   β”œβ”€β”€ πŸ“ tasks/                    # Business analysis tasks
β”‚   β”‚   β”œβ”€β”€ growth_analysis.py
β”‚   β”‚   β”œβ”€β”€ profitability_analysis.py
β”‚   β”‚   β”œβ”€β”€ cost_analysis.py
β”‚   β”‚   └── market_dynamics.py
β”‚   β”œβ”€β”€ πŸ“ data/vector_db_all/       # Vector database (4,185 chunks)
β”‚   β”œβ”€β”€ πŸ“ scripts/                  # Utility scripts
β”‚   β”œβ”€β”€ πŸ“ ui/                       # Streamlit interface
β”‚   └── πŸ“ tests/                    # Test scripts
β”œβ”€β”€ πŸ“œ rag_structure_setup.py        # RAG setup script
β”œβ”€β”€ πŸ“œ rag_requirements.txt          # RAG dependencies
└── πŸ“Š Cement_Companies_Concalls_*.xlsx  # Master data file

πŸš€ Usage

Step 1: Download Transcripts

cd concall_downloader
python download_concalls_final.py

Step 2: Build Vector Index

cd rag_pipeline
python scripts/build_index.py

Step 3: Launch Streamlit UI

cd rag_pipeline/ui
streamlit run app.py

Step 4: Query via Code

from rag_pipeline.core.vector_store import VectorStore

# Initialize
vs = VectorStore("data/vector_db_all")

# Query
results = vs.query("What is UltraTech's capacity expansion plan?", k=5)
for doc in results:
    print(doc.page_content)

πŸ”§ RAG Pipeline

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   PDF/Docx      │───▢│  Text Chunking   │───▢│   Embeddings    β”‚
β”‚  Transcripts    β”‚    β”‚  (1000 tokens)   β”‚    β”‚   (OpenAI)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”‚
                                                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Response     │◀───│   LLM (GPT-4)    │◀───│   ChromaDB      β”‚
β”‚                 β”‚    β”‚   Generation     β”‚    β”‚   Retrieval     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pre-built Analysis Tasks

Task Description
πŸ“ˆ Growth Analysis Revenue growth, volume trends, market share
πŸ’° Profitability EBITDA margins, cost optimization, pricing power
🏭 Cost Analysis Fuel costs, logistics, power & fuel mix
πŸ“Š Market Dynamics Demand outlook, competitive landscape

πŸ“Š Sample Queries

1. "What is Shree Cement's capacity utilization rate?"
2. "Compare EBITDA margins across all companies"
3. "What are the key concerns about fuel costs?"
4. "Which companies are expanding in South India?"
5. "What is the demand outlook for FY25?"

πŸ“ˆ Data Statistics

Metric Value
Companies 13
Transcripts 56
Vector Chunks 4,185
Time Period 2 Years

⚠️ Disclaimer

This tool is for educational and research purposes only. Concall transcripts are property of respective companies.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built for Cement Industry Research πŸ—οΈ

About

RAG-powered system for downloading, indexing, and analyzing cement industry conference call transcripts with LangChain and ChromaDB

Topics

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors