Spaces:
Sleeping
Sleeping
metadata
license: apache-2.0
emoji: π§
sdk: docker
colorFrom: blue
colorTo: purple
thumbnail: >-
https://cdn-uploads.huggingface.co/production/uploads/68734d5a2ae5ca930a3d195a/71R1ZoEhLA6neM5WSpxt4.png
π§ Notionhive AI Chatbot
A FastAPI-based intelligent FAQ chatbot powered by Google Gemini and LangChain, designed to answer questions based on Notionhive's official FAQs and website: notionhive.com.
π Features
- Semantic search using Sentence Transformers & Chroma DB
- Gemini AI (gemini-2.0-flash) for accurate response generation
- CSV-based FAQ management (upload, add, delete, view)
- RESTful API built with FastAPI
- Prompt structure enforcing Notionhive's tone and boundaries
- CORS enabled for frontend integration
π Project Structure
.
βββ main.py # FastAPI app initialization
βββ faq_routes.py # All chatbot + FAQ management API endpoints
βββ faq_services.py # Vector store logic, Gemini model setup
βββ chatbot_prompt.py # Prompt template for Gemini responses
βββ faqs.csv # Stored FAQs (question/answer pairs)
βββ README.md
π Requirements
- Python 3.9+
- Google API Key for Gemini
sentence-transformerslangchainchromadbfastapi,uvicornpython-dotenv,pandas
Install dependencies:
pip install -r requirements.txt
π Environment Setup
Create a .env file in your root directory with the following:
GOOGLE_API_KEY=your_google_api_key_here
π Usage
Run the API server locally:
uvicorn main:app --reload
Access endpoints:
POST /askβ Ask a questionPOST /add_faqβ Add a new FAQPOST /upload_faqs_csvβ Upload bulk FAQs from CSVDELETE /delete_faqβ Delete FAQ by contentDELETE /deleted/{faq_id}β Delete FAQ by IDDELETE /delete/destroyallβ Delete all FAQsGET /get_faqsβ View all FAQsPOST /retrainβ Reload vector DB
π€ Chatbot Behavior
- Introduces itself as Noah, Notionhiveβs AI Assistant.
- Answers based on FAQs and content from notionhive.com.
- Uses web search only if FAQ-based answers arenβt available and question is general or critical.
- Will never generate fabricated or speculative responses.
π Notes
- All FAQs are stored in
faqs.csv. Updating this file retrains the vector search index. - Currently single-tenant; for multi-tenant expansion, isolate CSV and vector store per tenant ID.
π¨βπΌ Credits
Developed by the Notionhive AI team.