How ranads/rrjl works
Primary Components
• Frontend/UI: Although there isn’t a dedicated "frontend" directory, the README specifies Streamlit is used for the graphical user interface. Represent this as a separate component.
• Backend/API: The presence of backend.py suggests that FastAPI handles incoming HTTP requests and business logic.
• Chatbot Logic: The chatbot.py file implies the inclusion of core chatbot functionalities, such as interfacing with language models or handling the RAG process.
• PDF Upload & Document Processing: As PDF file uploads are now supported, include a component that handles file ingestion and processing.
• Vector Store: A Chroma vector store is used to perform retrieval from the uploaded PDFs. This should be explicitly labeled.
• Database: The README mentions PostgreSQL for data storage (e.g., chat history). Add a separate component representing the database.
• Configuration & Deployment: Represent supporting components like GitHub workflows (.github/workflows/stage6deploy.yml) and shell scripts (setup.sh, update_app.sh) to demonstrate deployment and environment setup.
Interactions
• The user interacts with the system via the Streamlit frontend.
• The frontend communicates with the FastAPI backend (backend.py), likely sending chat messages and file uploads.
• The backend (FastAPI) routes requests to the appropriate modules:
• Chatbot logic in chatbot.py handles natural language processing and chat interactions.
• Uploaded PDFs are processed and passed to the vector store (Chroma) for context extraction.
• The API also interacts with PostgreSQL—for storing chat histories, and possibly metadata related to PDF documents.
• Data flows from the browser (user) through the frontend to the backend, and then across to both the vector store and the database.
• Deployment and continuous integration are supported by GitHub workflows and setup scripts to streamline project stability and updates.
Architectural Patterns & Design Principles
• Separation of Concerns: The clear division between the UI (Streamlit), API (FastAPI), chatbot core (chatbot.py), and external services (vector store and PostgreSQL) suggests adherence to modular, loosely coupled design principles.
• Extensibility: The structure easily allows for future expansion (e.g., new file types or enhanced chatbot features).
Relevant Technologies
• Frontend: Streamlit
• Backend: FastAPI (backend.py)
• Chatbot Processing: Chatbot.py likely involves LLM-related calls and RAG logic.
• PDF Processing: A module that converts PDFs to context for the vector store (not explicitly named but part of the new functionality).
• Vector Store: Chroma is used for retrieval purposes.
• Database: PostgreSQL for persistent storage.
• CI/CD: GitHub Actions (workflows in .github/workflows) for deployment automation.
• Shell Scripts: setup.sh and update_app.sh for environment configuration and deployment steps.