Skip to content

๐Ÿ’ฌ Analyze agent conversations using LLMs to generate smart summaries, sentiment insights, and article links โ€” powered by FastAPI + Streamlit + HuggingFace ๐Ÿš€

License

Notifications You must be signed in to change notification settings

yashdew3/Agentic-AI-Chat-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  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

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

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"]
Loading

โš™๏ธ Setup Instructions

# 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

uvicorn main:app --reload

Run Streamlit Frontend

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)

{
  "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!

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page (if you have one) or open a new issue to discuss changes. Pull requests are also appreciated.

About

๐Ÿ’ฌ Analyze agent conversations using LLMs to generate smart summaries, sentiment insights, and article links โ€” powered by FastAPI + Streamlit + HuggingFace ๐Ÿš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published