Spaces:
Configuration error
Configuration error
`# Dify Documentation Expert (RAG Chatbot)
A Retrieval-Augmented Generation (RAG) chatbot for Dify documentation, using MiniLM for semantic search and DistilBERT for answer generation. Built with Python, Flask, LangChain, and FAISS. Deployable on Vercel.
Features
- Scrapes and processes Dify documentation
- Builds a FAISS vector store with MiniLM embeddings
- Uses DistilBERT for question answering
- Fast API with
/askand/healthendpoints - Ready for serverless deployment (Vercel)
Project Structure
Dify-Expert/
βββ api/
β βββ dify_api.py # Flask API (entry point for Vercel)
βββ dify_docs_scraper/
β βββ dify_rag.py # RAG logic (vector store + QA)
β βββ dify_faiss_index/ # FAISS index files
β βββ ... # Scraper, processing scripts, etc.
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel config
βββ README.md # This file
βββ futurescope.md # Project roadmap/ideas
Quickstart
1. Install dependencies
pip install -r requirements.txt
2. Build the vector store (if not already built)
python3 dify_docs_scraper/build_vector_store.py
3. Run locally (API)
python3 api/dify_api.py
4. Query the API
curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{"question": "What is Dify?"}'
Deployment (Vercel)
- Push to GitHub.
- Connect repo to Vercel.
- Deploy (Vercel auto-detects Python from requirements.txt).
- Endpoints:
/ask(POST)/health(GET)
API Endpoints
POST /askβ{ "question": "..." }β{ "answer": ..., "score": ..., "sources": [...] }GET /healthβ{ "status": "ok" }
Roadmap
See futurescope.md for planned features and ideas.
License
MIT