An open API service indexing awesome lists of open source software.

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 ๐Ÿš€

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.