Upload a PDF and search it by meaning, in any language: ask in English and find the answer in a Polish manual. Each page is split into short passages, embedded locally with a multilingual sentence-transformer and stored in Milvus. A query returns the closest passage, and the viewer jumps to its page and highlights it.
0807.mp4
| Module | What it does |
|---|---|
Backend/api |
FastAPI app: PDF upload, and a WebSocket per browser session for processing and search. |
Backend/core |
Reads the PDF with PyMuPDF and processes its pages in parallel threads. |
Backend/embeddings |
Splits page text into 160-character passages (30 overlap) and embeds them with paraphrase-multilingual-MiniLM-L12-v2. |
Backend/db |
Milvus collection of passages, page numbers and session ids; cosine search filtered to the session. |
Frontend |
Upload screen and a PDF.js viewer that jumps to the result's page and highlights the passage. |
Passages are short on purpose: the result is a precise spot to highlight, not a whole page. The multilingual model maps Polish and English text into the same 384-dimensional space, so the language of the query does not have to match the document.
The same manual, queried in English and in Polish:
Needs Python 3.10+ and Milvus standalone 2.3 or newer running
on localhost:19530. A CUDA GPU is used when available.
pip install -r requirements.txt
uvicorn Backend.api.server:app --reload # http://localhost:8000Smoke tests for the pipeline and the database (Milvus has to be running):
python -m Backend.core.unit_tests
python -m Backend.db.unit_tests- It returns the single best passage. It does not generate an answer from it.
- A session lives as long as its WebSocket: when the tab closes, its file and vectors are deleted.
- No authentication: anyone who can reach the server can upload.
MIT