AskYourDoc is a fully offline, high-performance document processing and semantic search system that transforms multiple document formats into vector embeddings and enables accurate, context-aware retrieval using FAISS.
It is designed as a modular, scalable pipeline that processes documents end-to-end — from upload to intelligent search — without relying on any external APIs.
- Images (OCR-based)
- PPTX
- TXT
- XLS / XLSX
- Parallel file processing (threaded pipeline)
- Real-time file detection using watchdog
- Batch processing support
- Embedding-based retrieval (not keyword-based)
- Context-aware results
- High accuracy retrieval
- FAISS vector database (in-memory)
- Batch-based disk persistence
- Metadata tracking
- No external APIs
- Local processing & storage
- Privacy-focused
- User uploads documents
- Files are automatically detected
- Text is extracted
- Cleaned & normalized
- Chunked
- Embedded
- Stored in FAISS
- Query returns relevant results
Upload → Extract → Clean → Normalize → Chunk → Embed → FAISS → Search
AskYourDoc_Backend/
│
├── app/
│ ├── controllers/
│ │ ├── uploadPDF/
│ │ │ └── controller.py
│ │ ├── uploadIMAGES/
│ │ │ └── controller.py
│ │ ├── uploadPPTX/
│ │ │ └── controller.py
│ │ ├── uploadTXT/
│ │ │ └── controller.py
│ │ ├── uploadXLS/
│ │ │ └── controller.py
│ │
│ ├── fileProcessors/
│ │ ├── pdfProcessor.py
│ │ ├── imageProcessor.py
│ │ ├── pptxProcessor.py
│ │ ├── txtProcessor.py
│ │ ├── xlsProcessor.py
│ │
│ ├── utils/
│ │ └── text_cleaner.py
│ │
│ ├── chunking/
│ │ └── chunker.py
│ │
│ ├── embedding/
│ │ └── embedder.py
│ │
│ ├── vectorstore/
│ │ └── faiss_store.py
│ │
│ ├── workers/
│ │ └── file_watcher.py
│ │
│ ├── routes/
│ │ └── search_routes.py
│ │
│ ├── search/
│ │ └── search.py
│ │
│ ├── main.py
│ └── status_store.py
│
├── docs/
│ ├── pdf/
│ ├── images/
│ ├── pptx/
│ ├── txt/
│ ├── xls/
│
├── venv/
├── README.md
└── requirements.txt
- FastAPI – API framework
- Python (async + threading)
- PyMuPDF, pytesseract, python-pptx, pandas
- sentence-transformers (MiniLM)
- FAISS (vector DB)
- Multi-file support
- Duplicate prevention
- Organized storage
- Watchdog-based automation
- Parallel execution
- File-type-specific extraction
- Centralized utility
- Text normalization
- Sentence-aware splitting
- Metadata preserved
- Local model (MiniLM)
- Fast vector generation
- In-memory search
- Metadata mapping
- Optimized disk writes
- Persistent storage
User Query → Embedding → FAISS → Top Matches → Response
| Stage | Complexity |
|---|---|
| Upload | O(n) |
| Processing | O(n) |
| Chunking | O(n) |
| Embedding | O(n) |
| Search | ~O(log n) |
- Corrupted files
- Unsupported formats
- Empty content
- OCR failures
- Partial processing failures
- Local filesystem
- Organized by file type
- RAM + disk hybrid
- Batch persistence
- Modular architecture
- Separation of concerns
- Fault-tolerant
- Offline-first
- Scalable
git clone <your-repo>
cd AskYourDoc_Backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python app/main.py
🚀 Usage
Upload files
Wait for processing
Query system
Get semantic results
🎯 Status
✅ Pipeline complete
✅ Accurate retrieval
✅ Offline system
✅ Production-ready backend
🔮 Future Improvements
Re-ranking
Threshold tuning
Frontend integration
Advanced caching
👤 Author
Ravi Sharma
Full Stack developer