How ranguy9304/langgraphrag works
And Represent the Key Project Components
• Main Application: Use “main.py” as the entry point which orchestrates the processing flow.
• graph.py – likely handles the creation/management of graph-based representations.
• loader.py – responsible for loading documents and other data inputs.
• models.py – might define data models or interfaces with the vector database.
• nodes.py – probably deals with processing graph nodes in the RAG flow.
• processDocs.py – manages conversion and ingestion of document formats (PDF to Markdown, etc.).
• Data Storage:
• “Data” directory: Contains both markdown and PDF versions of documents, which serve as the raw inputs for document processing and vector database creation.
• External Services and Environment Configuration:
• Environment variables from “.env” (e.g., the OPENAI_API_KEY, and configuration flags like GET_WEB_PAGES_TO_PDF and CONVERT_PDF_TO_MD) show that the system is configurable.
• External tools (such as wkhtmltopdf for PDF processing) should be clearly noted as integrations.
Relationships and Data Flow
• From “main.py”, branch out to the individual module components:
• Incorporate the “graph.py” and “nodes.py” as parts of the query transformation and processing logic.
• Data storage layer:
• “data” bucket (with sub-components for PDF and Markdown) as the source for raw documents.
• Flows from these sources to the processing modules and then into the vector database creation phase.
• External dependency on LangGraph and any dependencies on services like OpenAI for GPT-related functionalities.
Architectural Patterns and Design Principles
• This design follows a modular separation of concerns: each module in the “modules” directory handles a specific part of the query processing and document management pipeline.
• Use of configuration via environment variables, indicating flexibility and external integrations.