CoolFace
Apppublic

kp2524/langchain-use-cases-demo

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
App README

LangChain Use Cases Demo

Interactive demonstration of 8 LangChain use cases powered by Groq AI:

  1. 1.๐Ÿ’ฌ AI-Powered Chatbots - Context-aware conversations
  2. 2.๐Ÿ“„ Document Question Answering - Ask questions about documents
  3. 3.๐Ÿ” RAG (Retrieval-Augmented Generation) - Knowledge base queries
  4. 4.๐Ÿ“ Document Summarization - Automatic text summarization
  5. 5.๐Ÿ“Š Data Extraction - Extract structured data from text
  6. 6.โœ๏ธ Content Generation - Generate context-aware content
  7. 7.โš™๏ธ Workflow Automation - Multi-step AI workflows
  8. 8.๐Ÿ› ๏ธ Custom AI Tools - Specialized AI-powered tools

๐Ÿš€ Quick Start

Local Testing

  1. 1.Install dependencies:
bash
   python -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
   pip install -r requirements.txt
  1. 1.Get a free Groq API key:
  2. 2.Visit console.groq.com
  3. 3.Sign up (free)
  4. 4.Create API key
  1. 1.Run the app:
bash
   streamlit run app.py
  1. 1.Enter your API key in the sidebar and start exploring!

Deploy to Hugging Face Spaces (Docker)

  1. 1.Push this code to a GitHub repository:
bash
   git init
   git add .
   git commit -m "Initial commit"
   git remote add origin YOUR_GITHUB_REPO_URL
   git push -u origin main
  1. 1.Create Hugging Face Space:
  2. 2.Go to huggingface.co/spaces
  3. 3.Click "Create new Space"
  4. 4.Space name: langchain-use-cases-demo (or your choice)
  5. 5.SDK: Docker (select Docker, not Streamlit)
  6. 6.Visibility: Public or Private
  7. 7.Click "Create Space"
  1. 1.Connect GitHub repository:
  2. 2.In Space Settings โ†’ Repository
  3. 3.Click "Import from GitHub" or manually upload files
  4. 4.Make sure Dockerfile, app.py, requirements.txt, and README.md are included
  1. 1.Add API key as secret:
  2. 2.Go to Space Settings โ†’ Secrets
  3. 3.Add new secret:
  4. 4.Key: GROQ_API_KEY
  5. 5.Value: Your Groq API key
  6. 6.Save
  1. 1.Deploy:
  2. 2.The Space will automatically build and deploy
  3. 3.Check build logs if there are any issues
  4. 4.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.