How bangoc123/drop-rag works
Key Architectural Layers/Components
• User Interface (Frontend):
• Represented mainly by the Streamlit pages found in the “pages” directory (e.g., Interactive_Chatbot.py, Graph_Rag.py) and the main entry point in app.py.
• This layer handles user interactions such as file uploads, LLM selections, and displaying chatbot responses or graph visualizations.
• Data Processing/Pipeline Logic:
• The core logic for managing uploaded files and processing content is spread over multiple modules:
• “chunking” directory: Contains various strategies for dividing content into chunks (e.g., recursive token, semantic, fixed token, and agentic chunkers).
• “collection_management.py”, “prompt.py”, and “utils.py” provide supporting functions for organizing and processing the data.
• LLM Integration:
• The “llms” directory abstracts interactions with different Large Language Models.
• Two main components:
• “llms/onlinellms.py” for cloud-based models (Gemini and OpenAI).
• “llms/localLllms.py” for local inference via OLLAMA.
• Data Storage and Retrieval:
• The README explains that a Chroma vector store is used to store vector embeddings.
• Although a dedicated storage module isn’t obvious from a single file, functions in “graph_rag.py”, “graph_search.py”, and configuration files like “neo4j.conf” indicate:
• Vector search interactions.
• Graph-based retrieval and visualization (Graph RAG).
• External Services:
• Cloud-based LLM providers (Gemini, OpenAI) and local models for inference.
• Optionally, external vector store components (Chroma) and possibly a Neo4j graph database (given the neo4j.conf) should be shown as part of the overall ecosystem.
Representing Relationships and Data Flow
• The Application Core calls the “Chunking Module” (various strategies from the “chunking” folder) to preprocess documents.
• After chunking, the processed data flows to the “Storage & Retrieval” component where embeddings are generated and stored in the Chroma vector store.
• For generating responses, the application routes the query to the “LLM Integration” layer where either an online or local LLM is invoked.
Architectural Patterns and Key Design Principles
• Separation of Concerns: Clearly delineate responsibilities between the UI (pages and app.py), business logic (chunking, file processing utilities), and external service integrations (LLM modules and data retrieval/graph visualization modules).
Additional Detailed Components
• The “components” directory (e.g., notify.py) that seems to contain UI or notification logic.
• Configuration Files: Represent the neo4j.conf as a configuration block for the Graph RAG feature.
• Auxiliary Modules: Ensure utilities, prompts, and constant definitions are referenced in the architecture as operational support.
Final Implementation Approach:
• Top: User Interface (Streamlit)
• Middle: Application Core (app.py, pages, and various processing utilities)
• Bottom: Integration Layers (Chunking, LLMs, Storage & Graph Visualization)