krinya's picture
Fix broken links in README and app.py for live demo and documentation
12e3d57
|
Raw
History Blame Contribute Delete
2.86 kB
---
title: AI Chatbot with Smart Routing
emoji: πŸ€–
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
app_port: 7860
---
# πŸ€– Financial AI Chatbot with Smart Routing & RAG
**A demo GenAI app that demonstrates smart routing using LangChain**
## πŸš€ Try It Live
- **🎯 Live Demo**: [Financial AI Chatbot](https://huggingface.co/spaces/krinya/smart_routing_with_render_example) ← **Try it here!**
- **πŸ’» Frontend Code**: [`app.py`](https://huggingface.co/spaces/krinya/smart_routing_with_render_example/tree/main) - Gradio interface code
- **πŸ”— Backend API**: [Deployed on Render](https://gen-ai-demo-rag-bot.onrender.com/docs)
- **πŸ“– Backend API Code**: [GitHub Repository](https://github.com/krinya/gen_ai_demo_rag_bot/tree/main)
## 🎯 What This Demonstrates
This project shows **how to create a complete GenAI product**:
### 1. 🧠 Smart Routing with LangChain
Intelligently routes financial questions about **5 major companies** (Apple, Google, Amazon, Tesla, Intel):
- πŸ” **FAQ Route**: Quick facts (CEO names, founding dates)
- πŸ“š **RAG Route**: Financial data from 2024 annual reports (revenue, profits)
- 🧠 **LLM Route**: General explanations and financial concepts
### 2. πŸ“Š RAG Implementation
- **Vector Storage**: ChromaDB with processed financial documents (full annual reports)
- **Retrieval System**: Semantic search for relevant information
- **Smart Fallbacks**: Multiple sources with quality scoring
### 3. πŸ—οΈ Production Architecture
- **Backend**: Python FastAPI with LangChain, deployed on Render
- **Frontend**: Gradio UI deployed on Hugging Face Spaces
- **Separation**: Backend API + Frontend UI for scalability
## πŸ› οΈ How This Shows GenAI Product Development
**Complete workflow: Backend β†’ Deploy β†’ Frontend**
1. **Write Backend** (Python + LangChain)
- FastAPI with smart routing logic
- RAG pipeline with vector storage
- Deploy on Render cloud platform
2. **Create Frontend** (Gradio + Hugging Face)
- Interactive chat interface
- Real-time routing insights
- Deploy on Hugging Face Spaces
3. **Connect & Scale**
- Backend API serves multiple frontends
- Docker containerization
- Production-ready architecture
## πŸ”§ Tech Stack
- **AI**: OpenAI GPT-4o-mini + LangChain orchestration
- **Backend**: Python FastAPI deployed on Render
- **Frontend**: Gradio deployed on Hugging Face Spaces
- **Storage**: ChromaDB vector database
- **Data**: 2024 financial reports (Apple, Google, Amazon, Tesla, Intel)
## οΏ½ Example Queries
Try these in the live demo:
- "Who is the CEO of Tesla?" β†’ FAQ route
- "What was Apple's revenue in 2024?" β†’ RAG route
- "How do you calculate P/E ratio?" β†’ LLM route
---
**🎯 Key Learning**: This demonstrates the complete GenAI development stack from data processing to production deployment!