An AI-powered Knowledge Assistant that allows users to upload PDF documents, generate embeddings, and chat with their documents using Retrieval-Augmented Generation (RAG).
The system retrieves relevant document chunks, provides accurate answers, and includes source citations with page references for transparency and trust.
https://ai-knowledge-assistant-project.streamlit.app/
- Upload PDF documents securely.
- Extract text from PDF pages automatically.
- Store document metadata and content in Supabase.
- Generate embeddings using Sentence Transformers.
- Perform semantic similarity search.
- Retrieve the most relevant document chunks.
- Ask questions in natural language.
- Get answers based only on uploaded documents.
- Maintain conversation history.
- Every answer includes:
- Source document name
- Page number
- Improves transparency and trustworthiness.
- Query embeddings generated from user questions.
- Relevant chunks retrieved from vector database.
- Context sent to the LLM for grounded responses.
- User Signup
- User Login
- Secure password hashing with bcrypt
- Save previous conversations.
- Resume old chats anytime.
- Delete conversations when needed.
- View uploaded documents.
- Delete documents.
- Generate embeddings from uploaded files.
User Query
β
βΌ
Generate Query Embedding
β
βΌ
Vector Search (Supabase)
β
βΌ
Retrieve Relevant Chunks
β
βΌ
Build Context
β
βΌ
Groq LLM (Qwen 3 32B)
β
βΌ
Answer + Source Citations
- Streamlit
- Python
- Supabase
- Groq (Qwen/Qwen3-32B)
- sentence-transformers/all-MiniLM-L6-v2
- PyMuPDF
- bcrypt
βββ src/
βββ UI/
β βββ __init__.py
β βββ __pycache__/
β β βββ base_layout.cpython-313.pyc
β β βββ base_layout.cpython-313.pyc.2414922744208
β βββ base_layout.py
βββ screens/ (5200 tokens)
β βββ __init__.py
β βββ __pycache__/
β β βββ Login.cpython-313.pyc
β β βββ Signup.cpython-313.pyc
β βββ Setting.py
β βββ Documents.py
β βββ History.py
β βββ Home.py
β βββ Chat.py
β βββ Upload.py
β βββ Login.py
β βββ Signup.py
βββ database/
β βββ __init__.py
β βββ config.py
β βββ db.py
βββ assets/
β βββ user_logo_img.png
β βββ right_panel_img.png
β βββ Signup_right_panel_img.jpg
βββ RAG/ (2400 tokens)
β βββ ingestion/
β βββ text_cleaner.py
β βββ chunker.py
β βββ embeddings/
β βββ embedder.py
β βββ Generation/
β βββ searchtool.py
β βββ agent.py
β βββ generation_pipline.py
β βββ retrieval/
β βββ retriever.py
β βββ pipline/
β βββ ragpipline.py
βββ .gitignore
βββ requirements.txt
βββ .streamlit/
βββ config.toml
βββ app.py
git clone https://github.com/your-username/AI-Knowledge-Assistant.git
cd AI-Knowledge-Assistantpython -m venv venvActivate:
venv\Scripts\activatepip install -r requirements.txtCreate:
.streamlit/secrets.toml
Add:
SUPABASE_URL="your_supabase_url"
SUPABASE_KEY="your_supabase_key"
GROQ_API_KEY="your_groq_api_key"streamlit run app.py- User uploads PDF.
- PDF text is extracted.
- Pages stored in Supabase.
- Text cleaned.
- Text chunked.
- Embeddings generated.
- Embeddings stored in database.
- User asks a question.
- Query embedding generated.
- Similar chunks retrieved.
- Context built from chunks.
- Context sent to LLM.
- Response returned with citations.
- Summarize the document.
- What are the main conclusions?
- What is the leave policy?
- Explain chapter 3.
- What benefits are mentioned?
- List important dates from the document.
- Passwords hashed using bcrypt.
- User documents isolated by user ID.
- Secure API key management through Streamlit Secrets.
- Citation-based responses reduce hallucinations.
- Multi-document chat
- Hybrid Search (Keyword + Vector)
- Reranking
- OCR Support
- Document Summarization
- Multi-LLM Support
- Bookmark System
- Citation Highlighting
- Streaming Responses
- Role-Based Access Control
Bhupati Nadar
GitHub: https://github.com/BhupatiNadar
If you found this project useful:
β Star the repository
π΄ Fork the project
π οΈ Contribute improvements
Built with β€οΈ using Streamlit, Supabase, Groq, and RAG.