How willdupree90/findingedoc works
Project Type and Purpose
• Project Type: This is a full-stack application with a containerized multi-service architecture.
• Purpose: Building a chatbot that helps developers explore codebases. It leverages generative AI (via OpenAI’s API), constructs knowledge graphs (stored in Neo4j), and uses Retrieval-Augmented Generation (RAG) to answer code-related queries.
File Structure
• Top-level Files & Directories: Notice the presence of Dockerfiles (for Neo4j and Python) and a docker-compose.yaml file which indicate containerized services.
• Directories:
• “src/edoc”: Contains application code including the chatbot entry point.
• “src/edoc/chatbot_components” and “src/edoc/gpt_helpers”: Responsible for handling conversation logic and managing interactions with GPT.
• “src/edoc/kg_construction”: Handles the building and processing of the knowledge graph (KG); includes components for bulk loading and file system processing.
• “src/edoc/rag_components”: Deals with retrieval and response generation through both structured and unstructured retrievers.
• “notebooks”: Contains experimental Jupyter notebooks which serve as prototypes and testing scripts, offering insights into prototyping of KG creation and RAG responses.
• Configuration/Environment: The presence of a Docker setup (docker-compose.yaml, Dockerfiles) and environment variables indicate a strong separation of concerns between the runtime environment (containers), development/testing (notebooks), and production code (in src/edoc).
Synthesize Information from the README
• The README explains two primary methods of interacting with the system:
• Running the system via Docker (with both a Neo4j service and a Python Gradio App).
• Running the application locally by activating a Python virtual environment.
• Key functionalities include setting up API keys, uploading codebase archives to build a knowledge graph, asking questions via a Gradio interface, and optionally clearing existing graph data.
• It explicitly mentions the use of generative AI and RAG for processing developer queries.
Main Components
a. Frontend/Interface:
• Gradio Chatbot Interface: Provides user interaction, enabling file uploads, API key input, querying, etc.
b. Backend/Application Logic:
• Chatbot Entry Point (src/edoc/chatbot.py): Routes incoming requests, handles logic, and coordinates with underlying modules.
• Chatbot Components: Handles conversation flow and potentially preprocessing or postprocessing of data.
• GPT Helpers: Manages connections to the OpenAI APIs and handles generative AI calls.
• KG Construction: Handles the ingestion of code project data, processes file systems, builds/updates the knowledge graph via utilities and bulk loading.
• RAG Components: Incorporates both structured and unstructured retrievers, and a responder component that synthesizes the final output for queries.
c. Database/External Service:
• Neo4j Database: Serves as the persistent store for the knowledge graph, connected via Docker.
d. Infrastructure/Containers:
• Docker Environment: Manages separate containers for Neo4j (as specified in Dockerfile.neo4j) and the Python application (Dockerfile.python).
• docker-compose: Orchestrates the different services and ensures they communicate appropriately.