https://github.com/yashdew3/agentic-ai-chat-analyzer
๐ฌ Analyze agent conversations using LLMs to generate smart summaries, sentiment insights, and article links โ powered by FastAPI + Streamlit + HuggingFace ๐
https://github.com/yashdew3/agentic-ai-chat-analyzer
agentic-ai chat-analysis data-pipeline docker fastapi huggingface huggingface-transformers llm nlp portfolio-website sentiment-analysis streamlit summarization
Last synced: 2 months ago
JSON representation
๐ฌ Analyze agent conversations using LLMs to generate smart summaries, sentiment insights, and article links โ powered by FastAPI + Streamlit + HuggingFace ๐
- Host: GitHub
- URL: https://github.com/yashdew3/agentic-ai-chat-analyzer
- Owner: yashdew3
- License: mit
- Created: 2025-06-28T14:44:05.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T17:39:35.000Z (12 months ago)
- Last Synced: 2025-06-28T18:33:03.820Z (12 months ago)
- Topics: agentic-ai, chat-analysis, data-pipeline, docker, fastapi, huggingface, huggingface-transformers, llm, nlp, portfolio-website, sentiment-analysis, streamlit, summarization
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ง Agentic AI Chat Analyzer
> An AI-powered platform for analyzing agent chat transcripts about Washington Post articles using lightweight LLMs, visual EDA, and an interactive frontend.
> Designed to summarize conversations, detect sentiments, and deliver insights โ all through a modular, API-driven architecture.
---
## ๐โจ Features
โ
Modular Data Pipeline โ Clean ingestion, cleaning, and transformation
๐ EDA + Profiling โ Dataset summaries, word clouds, sentiment plots
๐ง LLM Summarizer โ Uses Flan-T5-small
๐ฌ Sentiment Classification โ CardiffNLP RoBERTa Sentiment
๐ FastAPI Backend โ 3 REST endpoints with Pydantic validation
๐ผ๏ธ Streamlit Frontend โ Interactive UI for real-time transcript analysis
๐ฆ Model Caching โ Offline-ready with locally saved models
๐งช Evaluation Pipeline โ Accuracy and BLEU score metrics
---
## ๐๏ธ Folder Structure
```bash
Agentic_AI_ChatAnalyzer/
โโโ app/ # Core app logic (API, services, utils)
โโโ data/ # Dataset and output CSVs
โโโ models/ # Locally saved HuggingFace models
โโโ notebooks/ # EDA and profiling notebook
โโโ scripts/ # Model downloader and batch inference
โโโ streamlit_app/ # UI client (integrated with FastAPI)
โโโ main.py # FastAPI entrypoint
โโโ requirements.txt # Python dependencies
โโโ .gitignore
โโโ README.md
```
---
## ๐ System Architecture
```mermaid
flowchart LR
A["User Input via Streamlit UI"] --> B["POST Transcript to FastAPI API"]
B --> C["LLM Summarizer (Flan-T5)"]
B --> D["Sentiment Classifier (RoBERTa)"]
C --> E["Summary Output"]
D --> F["Sentiment per Agent"]
E --> G["Response JSON to Streamlit"]
F --> G
G --> H["Visualization: WordClouds + Metrics"]
```
---
## โ๏ธ Setup Instructions
```bash
# 1. Clone the repo
git clone https://github.com/yashdew3/Agentic-AI-Chat-Analyzer.git
cd Agentic_AI_ChatAnalyzer
# 2. Create and activate environment (optional)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Download local LLM + sentiment models (run once)
python scripts/download_models.py
```
---
## ๐ How to Use
### Run FastAPI Backend
```bash
uvicorn main:app --reload
```
- Access Swagger Docs: http://localhost:8000/docs
---
### Run Streamlit Frontend
```bash
streamlit run streamlit_app/app_ui.py
```
- Analyze transcripts visually
- Paste chats and see live:
- `Summary`
- `Sentiment Insights`
- `Word Clouds`
- `Article Links`
---
## ๐ก API Endpoints
| Method | Endpoint | Description |
| ------ | ------------ | -------------------------------------------------- |
| GET | `/summary` | Returns dataset stats |
| POST | `/transform` | Preprocess and clean new chat input |
| POST | `/insights` | Summarizes, classifies sentiment, returns insights |
---
## ๐งช Sample API Input
### ๐ฅ Sample Payload (for `/insights`)
```json
{
"content": [
{"agent": "agent_1", "message": "Letโs discuss the article on the new football rule change."},
{"agent": "agent_2", "message": "Yes, it's causing a lot of debate on ESPN."}
],
"article_url": "https://www.washingtonpost.com/sports/football-rule-change"
}
```
---
## ๐ Tech Stack
| Layer | Tools Used |
| ----------- | ------------------------------------------ |
| Backend | FastAPI, Uvicorn, Pydantic |
| Frontend | Streamlit, Matplotlib, WordCloud |
| NLP Models | HuggingFace Transformers: Flan-T5, RoBERTa |
| Analysis | Pandas, Seaborn, ydata-profiling |
| LLM Hosting | Locally saved models in `/models/` |
---
## ๐ฎ Future Enhancements
- ๐ Add JWT authentication
- ๐ณ Dockerize backend & frontend for deployment
- โ๏ธ Deploy on Render, Railway, or HuggingFace Spaces
- ๐ค Export chat reports (PDF/CSV)
- ๐ฌ Multi-transcript support with database
---
## ๐ License
MIT License ยฉ Yash Dewangan
## โญ Show Your Support
If you liked this project, give it a โญ star on GitHub and feel free to fork it!
## ๐ฌ Let's Connect
Feel free to connect or suggest improvements!
- Built by **Yash Dewangan**
- ๐Github: [YashDewangan](https://github.com/yashdew3)
- ๐งEmail: [yashdew06@gmail.com](mailto:yashdew06@gmail.com)
- ๐Linkedin: [YashDewangan](https://www.linkedin.com/in/yash-dewangan/)
## ๐ค Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/yashdew3/Agentic-AI-Chat-Analyzer/issues) (if you have one) or open a new issue to discuss changes. Pull requests are also appreciated.