kp2524/langchain-use-cases-demo
0
LangChain Use Cases Demo
Interactive demonstration of 8 LangChain use cases powered by Groq AI:
- ๐ฌ AI-Powered Chatbots - Context-aware conversations
- ๐ Document Question Answering - Ask questions about documents
- ๐ RAG (Retrieval-Augmented Generation) - Knowledge base queries
- ๐ Document Summarization - Automatic text summarization
- ๐ Data Extraction - Extract structured data from text
- โ๏ธ Content Generation - Generate context-aware content
- โ๏ธ Workflow Automation - Multi-step AI workflows
- ๐ ๏ธ Custom AI Tools - Specialized AI-powered tools
๐ Quick Start
Local Testing
- Install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Get a free Groq API key:
- Visit console.groq.com
- Sign up (free)
- Create API key
- Run the app:
streamlit run app.py- Enter your API key in the sidebar and start exploring!
Deploy to Hugging Face Spaces (Docker)
- Push this code to a GitHub repository:
git init
git add .
git commit -m "Initial commit"
git remote add origin YOUR_GITHUB_REPO_URL
git push -u origin main- Create Hugging Face Space:
- Go to huggingface.co/spaces
- Click "Create new Space"
- Space name:
langchain-use-cases-demo(or your choice) - SDK: Docker (select Docker, not Streamlit)
- Visibility: Public or Private
- Click "Create Space"
- Connect GitHub repository:
- In Space Settings โ Repository
- Click "Import from GitHub" or manually upload files
- Make sure
Dockerfile,app.py,requirements.txt, andREADME.mdare included
- Add API key as secret:
- Go to Space Settings โ Secrets
- Add new secret:
- Key:
GROQ_API_KEY - Value: Your Groq API key
- Save
- Deploy:
- The Space will automatically build and deploy
- Check build logs if there are any issues
- Your app will be live at:
https://huggingface.co/spaces/YOUR_USERNAME/SPACE_NAME
Note: The Dockerfile is included in this repo and will automatically be used for deployment.
๐ ๏ธ Technology
- LangChain - AI agent framework
- Groq - Ultra-fast AI inference (free tier available)
- Hugging Face - Embeddings and models
- ChromaDB - Vector database
- Streamlit - Interactive UI
๐ Note
This app requires a Groq API key (free to get). The key is stored only in your session and never saved.
