How anujsonawane60/rag_pipeline_v3_docker works
• Frontend Client:
• Represented by the static HTML files (index.html, chatbot.html) housed in the “static” folder.
• This is the UI that users interact with via a web browser.
• Backend API Server:
• Represented by main.py, which is the FastAPI application serving as the backend.
• This component processes requests, handles file uploads, manages chatbots, validates documents (using tools like PyPDF2 and docx), and routes API calls.
• Language Model Integration:
• Incorporate components for each external service: OpenAI, Cohere, and TogetherAI.
• Document and Context Management:
• A dedicated module for managing document uploads, file validations (PDF, DOCX, TXT), and creating the necessary context for the chatbot.
• Vector Database/Indexing:
• Use a separate component for Pinecone, which is used to support vector-based retrieval during conversations.
• Deployment and Containerization:
• Docker container (via Dockerfile and .dockerignore) which encapsulates the application for deployment.
Relationships and interactions
• From the Backend API Server, illustrate outgoing API calls to each of the LLM providers (OpenAI, Cohere, TogetherAI) indicating which language model is used for generating responses.
• Backend API Server to the Pinecone component to show the flow of vector data for context retrieval.
• Document upload pathway by connecting the Frontend to the dedicated file parsing/validation module within the backend.
Important architectural patterns and design principles
• Separation of concerns between the frontend (static content) and the backend (API logic).
• That the system follows a modular design where each integration (LLM, Pinecone, file validation) is an independently replaceable or updateable component.
• It’s valuable to note that the use of FastAPI facilitates asynchronous handling of requests, an important detail for high-efficiency API communication.
Relevant technologies, frameworks, and libraries
• FastAPI as the main web framework.
• Uvicorn as the ASGI server.
• Python (with dependencies listed in requirements.txt).
• LLM integration services: OpenAI, Cohere, TogetherAI.
• Pinecone for vector search.
• File parsing libraries: PyPDF2 for PDFs and docx for DOCX files.
• Docker for containerization.