How jatin-mehra119/pdf-insight-beta works
Project Type and Purpose
• PDF Insight Pro is a full-stack document-analysis application.
• It provides a static JS/CSS/HTML frontend (served from /static), a FastAPI backend (app.py + /api/…), and an Android WebView client.
• Core purpose: upload a PDF, chunk & embed its text, run retrieval-augmented generation (RAG) with optional web-search, and return intelligent answers.
File Structure
• Top-level
• app.py, gen_dataset.py, test_RAG.ipynb, requirements.txt, Dockerfile, CI workflows.
• Folders: api/, configs/, models/, services/, utils/, static/, development_scripts/, uploads/, Android App/.
• API Layer (api/): chat, session, upload, utility route modules.
• Config (configs/): environment and key-management.
• Models (models/): Pydantic request/response schemas.
• Business Logic (services/):
• rag_service.py – RAG pipeline, agentic search.
• llm_service.py – LLM prompting/inference via Groq API.
• session_service.py – session persistence.
• Utilities (utils/):
• text_processing.py – PDF extraction & chunking.
• faiss_utils.py – FAISS index management.
• session_utils.py – serialize/deserialize sessions.
• Frontend (static/): HTML, CSS, JS, served as static assets.
• Mobile (Android App/): WebView-based wrapper.
• Storage (uploads/): incoming PDFs & pickled sessions.
README Insights
• Confirms modular architecture: PDF Processing, RAG Engine, API Layer, Frontend, Mobile.
• Details external dependencies: Groq API, Tavily API, FAISS, Sentence Transformers, PyMuPDF, Uvicorn.
• CI/CD: Docker + GitHub Actions + Hugging Face Spaces.
Detail
• Every service module (rag_service, llm_service, session_service).
• Flow of a single “Upload PDF → Ask a question” workflow from end to end.
• Persistent session storage and temporary indices.
• Don’t omit the Docker container boundary or the CI/CD workflow.