Hybrid Retrieval-Augmented Document Intelligence Assistant
VectorDocs is a session-aware Retrieval-Augmented Generation (RAG) assistant that allows users to upload documents (PDF / TXT / JSON) and interact with them conversationally.
Unlike basic vector-only RAG systems, VectorDocs uses a hybrid retrieval pipeline combining semantic embeddings, keyword search, and cross-encoder reranking to deliver accurate, grounded answers with reduced hallucinations.
Traditional RAG systems often:
- Miss exact keywords (IDs, logs, error codes)
- Retrieve loosely related chunks
- Hallucinate when context is weak
VectorDocs solves this by design.
FAISS (Semantic Recall)
+
BM25 (Keyword Precision)
β
Cross-Encoder Reranking
β
Hallucination-Guarded Answering
| Feature | Description |
|---|---|
| π Session Isolation | Independent document index per chat |
| π Hybrid Retrieval | FAISS + BM25 |
| π§ Reranking | ms-marco-MiniLM-L-6-v2 |
| π‘ Hallucination Guard | Context-validated answers |
| π File Support | PDF, TXT, JSON |
| πΎ Local Cache | Persistent FAISS + BM25 |
| π¬ Chat Sessions | Switch chats without losing progress |
| π§© Modular Codebase | Easy to extend |
User
β
Streamlit UI
β
Loader & Chunker
β
Hybrid Retrieval Engine
ββ FAISS
ββ BM25
ββ Cross-Encoder
β
LLM (Answer + Validation)
VectorDocs/
βββ app/
β βββ main.py
β βββ components/
β βββ utility/
βββ loader/
βββ vector_store/
βββ embeddings/
βββ assets/
β βββ logo.png
β βββ screenshots/
βββ data/
βββ LICENSE
βββ README.md
βββ requirements.txt
python -m venv .venv
source .venv/bin/activate # Linux / Mac
.venv\Scripts\activate # Windowspip install -r requirements.txtstreamlit run app/main.pyOpen π http://localhost:8501
Pull the published image directly from Docker Hub:
docker pull mahar628/vectordocs:latestRun the application:
docker run --rm -p 8501:8501 mahar628/vectordocs:latestOpen π http://localhost:8501
VectorDocs allows you to set the OpenAI API key directly from the Streamlit web interface.
-
Launch the app
-
In the sidebar, find βOpenAI API Keyβ
-
Paste your key:
sk-******************************** -
Press Enter / Save
- Stored only in Streamlit session state
- Isolated per browser session
- Never written to disk or source code
- Cleared on app restart
Supported formats:
- π PDF
- π TXT
- π§Ύ JSON
-
Upload files from the sidebar
-
Files are:
- Parsed
- Chunked
- Indexed using FAISS + BM25
-
Uploads can be incremental β indexes update automatically
Each chat session maintains:
- Independent document uploads
- Separate FAISS + BM25 indexes
- Its own conversation history
You can switch between chats without losing progress.
I wrote about the motivation behind VectorDocs, the problems I encountered with existing Chat-with-PDF applications, and why I decided to build my own document Q&A system.
π Why I Stopped Trusting Chat-with-PDF Apps and Built My Own
Explore the journey behind VectorDocs β from the limitations of existing PDF chat tools to building a more transparent and controllable document intelligence application.
Licensed under the MIT License. See the LICENSE file for details.
β Star the repository if you find this project useful!

