A portfolio-ready Retrieval-Augmented Generation project using LangChain, FAISS, OpenAI API, and Streamlit.
Document Q&A Assistant (RAG System) | LangChain, FAISS Vector DB, OpenAI API, Streamlit
• Built a Retrieval-Augmented Generation tool that ingests PDFs and answers natural language queries.
• Implemented FAISS vector indexing for semantic search across document chunks.
• Generated answers grounded strictly in uploaded document context with source previews to reduce hallucination.
- Upload PDF, TXT, or Markdown documents
- Extract text from PDFs
- Split documents into semantic chunks
- Create FAISS vector database
- Ask natural language questions
- Answer strictly from document context
- Display source file, page number, and preview
- Generate grounded document summary
- Smooth premium Streamlit UI with custom CSS animations
- Reset vector database and uploaded files
- Chat history panel
- Python
- Streamlit
- LangChain
- FAISS Vector DB
- OpenAI API
- pypdf
- dotenv
Document_QA_RAG_Assistant
├── app
│ ├── config.py
│ ├── document_loader.py
│ └── rag_engine.py
├── sample_docs
│ └── sample_company_policy.txt
├── main.py
├── requirements.txt
├── .env.example
└── README.md
cd "D:\Document_QA_RAG_Assistant"python -m venv venv.\venv\Scripts\Activate.ps1If PowerShell blocks activation:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\venv\Scripts\Activate.ps1python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txtCopy env file:
copy .env.example .env
notepad .envAdd your key:
OPENAI_API_KEY=your_real_key_herestreamlit run main.pyOpen:
http://localhost:8501
- Upload PDF/TXT/MD files.
- Click Build FAISS Vector Index.
- Ask a question.
- The assistant retrieves relevant chunks.
- Answer is generated strictly from uploaded document context.
- Source previews are shown below the answer.
What is the main purpose of this document?
Summarize the document in 5 bullet points.
What are the key policies mentioned?
What limitations are discussed?
- Add user login
- Add multi-document workspace support
- Add chat export to PDF
- Add local embeddings support
- Add reranking model
- Add citation highlighting
- Add Docker deployment
- Add vector DB persistence per user
- Add support for DOCX, CSV, and web URLs