Spaces:
Sleeping
Sleeping
add project documentation
Browse files
README.md
CHANGED
|
@@ -1,119 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
- PDF document indexing
|
| 11 |
-
- Website content scraping
|
| 12 |
-
- Hybrid semantic retrieval
|
| 13 |
-
- ColBERT-style retrieval
|
| 14 |
-
- Cross-encoder reranking
|
| 15 |
-
- LLM answer generation
|
| 16 |
-
- Modern UI with dark mode
|
| 17 |
-
- Expandable retrieved context viewer
|
| 18 |
-
|
| 19 |
-
## Architecture
|
| 20 |
-
|
| 21 |
-
Pipeline:
|
| 22 |
-
|
| 23 |
-
User Query
|
| 24 |
-
β
|
| 25 |
-
Retriever (ColBERT)
|
| 26 |
-
β
|
| 27 |
-
Reranker (Cross Encoder)
|
| 28 |
-
β
|
| 29 |
-
Context Compression
|
| 30 |
-
β
|
| 31 |
-
LLM (Gemini)
|
| 32 |
-
β
|
| 33 |
-
Final Answer
|
| 34 |
-
|
| 35 |
-
## Tech Stack
|
| 36 |
-
|
| 37 |
-
Backend:
|
| 38 |
-
- FastAPI
|
| 39 |
-
- Python
|
| 40 |
-
|
| 41 |
-
Retrieval:
|
| 42 |
-
- Sentence Transformers
|
| 43 |
-
- FAISS
|
| 44 |
-
- ColBERT-style token similarity
|
| 45 |
-
|
| 46 |
-
Ranking:
|
| 47 |
-
- Cross Encoder (MS MARCO)
|
| 48 |
-
|
| 49 |
-
LLM:
|
| 50 |
-
- Google Gemini API
|
| 51 |
-
|
| 52 |
-
Frontend:
|
| 53 |
-
- HTML
|
| 54 |
-
- CSS
|
| 55 |
-
- JavaScript
|
| 56 |
-
|
| 57 |
-
Deployment:
|
| 58 |
-
- Hugging Face Spaces
|
| 59 |
-
- Docker
|
| 60 |
-
|
| 61 |
-
## Project Structure
|
| 62 |
-
scholar-rag-engine
|
| 63 |
-
β
|
| 64 |
-
βββ main.py
|
| 65 |
-
βββ ingestion.py
|
| 66 |
-
βββ chunking.py
|
| 67 |
-
βββ scraper.py
|
| 68 |
-
βββ retrieval_colbert.py
|
| 69 |
-
βββ reranker.py
|
| 70 |
-
βββ LLM.py
|
| 71 |
-
βββ requirements.txt
|
| 72 |
-
βββ Dockerfile
|
| 73 |
-
β
|
| 74 |
-
βββ templates
|
| 75 |
-
βββ index.html
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
## Installation
|
| 79 |
-
|
| 80 |
-
Clone the repository
|
| 81 |
-
git clone https://github.com/mr-snake-mr/scholar-rag-engine
|
| 82 |
-
cd scholar-rag-engine
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
Install dependencies
|
| 86 |
-
pip install -r requirements.txt
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
Run the server
|
| 90 |
-
uvicorn main:app --reload
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
Open in browser
|
| 94 |
-
http://localhost:8000
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
## Environment Variables
|
| 98 |
-
|
| 99 |
-
Set your Gemini API key:
|
| 100 |
-
GOOGLE_API_KEY=your_gemini_api_key
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
## Deployment
|
| 104 |
-
|
| 105 |
-
This project is deployed on Hugging Face Spaces using Docker.
|
| 106 |
-
https://huggingface.co/spaces/snakeeee/scholar-rag-engine
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
## Future Improvements
|
| 110 |
-
|
| 111 |
-
- Streaming responses
|
| 112 |
-
- Chat-style UI
|
| 113 |
-
- Multi-document support
|
| 114 |
-
- Vector database integration
|
| 115 |
-
- GPU acceleration
|
| 116 |
-
|
| 117 |
-
## Author
|
| 118 |
-
|
| 119 |
-
Developed as an AI-powered research assistant project.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Scholar RAG Engine
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_file: main.py
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|