How aashiq-04/ai-powered-reseach-assistant-tool works
Main Components
• Backend Service: Built with FastAPI and located in the “backend” directory. It includes the main API (app.py) which exposes endpoints for uploading PDFs (/upload), embedding text from PDFs (/embed), and querying the embedded documents (/query). Additionally, the backend uses libraries such as LangChain, FAISS, and PyPDF2 to process the PDFs.
• Frontend Application: Found within the “pdf-query” directory. It is a ReactJS single-page application that offers a user interface for uploading documents, querying the data, and displaying responses.
• PDF Processing Module: Under “backend/ragPdf”, there are various scripts for PDF handling and related utilities. While some of these may be auxiliary tools (like PDF processing tools or test utilities), they show that PDF file manipulation is a core element.
• Data Storage / Vector Store: Although not explicitly a separate service or folder, the backend utilizes a vector store (built likely via FAISS) internally to keep track of embedded document representations.
• Integration Points: The communication between the frontend and backend (possibly enabled by CORS) and any configuration for external services like the Groq API (configured in the .env file) should also be represented.
Component Relationships
• The Frontend (ReactJS) issues HTTP requests to the FastAPI server.
• The FastAPI backend contains endpoints:
• The /upload endpoint handles file upload requests.
• The /embed endpoint processes the PDFs, splits the content, and embeds the text into a vector store.
• The /query endpoint accepts natural language queries and returns responses based on the vector search.
• The PDF Processing and Embedding consists of interaction between PDF parsing libraries (PyPDF2), text embedding (using LangChain), and vector indexing using FAISS.
Technologies and Frameworks to Highlight
• FastAPI for the backend service.
• ReactJS for building the UI in the frontend.
• LangChain for text embedding and managing language model workflows.
• FAISS for efficient vector similarity searches.
• PyPDF2 for processing PDF documents.
• Environment management via Python virtual environments and Node.js (npm) for React.