metadata
title: Personal AI Assistant with RAG
emoji: 🤗
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: true
license: mit
Personal AI Assistant with RAG
A powerful personal AI assistant that uses Retrieval-Augmented Generation (RAG) to provide responses based on your documents and notes.
Features
- Uses free Hugging Face models for language processing and embeddings
- Stores and retrieves information in a vector database
- Upload PDF, TXT, and CSV files to expand the knowledge base
- Add direct text input to your knowledge base
- View sources for AI responses
- Conversation history tracking
How to Use
- Upload Documents: Use the sidebar to upload files (PDF, TXT, CSV)
- Add Text: Enter text directly into the knowledge base
- Ask Questions: Chat with the assistant about your documents
- View Sources: See where information is coming from
Deployment
Local Deployment
To run the app locally:
- Clone this repository
- Install requirements:
pip install -r requirements.txt
- Run the Streamlit UI:
python run.py --ui
- Or run the API server:
python run.py --api
Deploying to Hugging Face Spaces
This application can be easily deployed to Hugging Face Spaces for free hosting:
- Make sure you have a Hugging Face account
- Create a Hugging Face API token at https://huggingface.co/settings/tokens
- Run the deployment script:
python deploy_to_hf.py
- Follow the prompts to enter your username, token, and space name
- Wait for the deployment to complete
If you encounter any issues during deployment, run python check_git_status.py
to diagnose and fix common problems.
The deployment process:
- Creates a Hugging Face Space using the Spaces SDK
- Configures git for pushing to Hugging Face
- Pushes your code to the Space
- Builds and deploys the Docker container automatically
Built With
- Hugging Face Models
- LLM: google/flan-t5-large
- Embeddings: sentence-transformers/all-MiniLM-L6-v2
- LangChain for orchestration
- Qdrant for vector storage
- Streamlit for UI
Created by p3rc03
License
MIT License - See LICENSE file for details