How valerianrey/ragthiscode works
Project type and purpose
• This is a full-stack Retrieval-Augmented Generation (RAG) application (“RagThisCode”) that:
• Ingests code from one or more GitHub repositories into a vector store.
• Exposes an MCP (Microservice-based Communication Protocol) server that answers free-form questions by retrieving relevant code snippets and calling the OpenAI API.
• Provides both a CLI chat client and a browser-based frontend (React/JSX) to interact with the server.
• Optionally runs a proxy for local testing or CORS avoidance.
• Key indicators: store_code_in_vector_db.py, server.py, chat.py, proxy.py, a frontend/ folder with JSX, plus Docker tooling.
File structure
Top-level:
• Dockerfile / .dockerignore / .gitignore / pyproject.toml / .pre-commit-config.yaml
• store_code_in_vector_db.py – ingestion pipeline
• server.py – the RAG microservice (Astral UV)
• chat.py – CLI chat client
• proxy.py – HTTP proxy (for CORS or API-key isolation)
• frontend/ – simple React-style client (index.html, main.jsx, styles.css)
Configuration & orchestration: Dockerfile for containerizing all components; UV (“uv run …”) as the runner for Python scripts; HTTP server to serve static frontend assets.
README for additional insights
• There are four entry points (ingest, server, chat, proxy) and a static web client served via Python’s http.server.
• External dependencies: GitHub REST API, OpenAI API, a local vector database (Chroma via LangChain), Astral UV server.
• Docker usage shows ports 7070 (MCP server) and 9000 (proxy).
Detail without over-splitting
• Transformation flow (raw code → embeddings → retrieved context → LLM call).
• Don’t omit the Docker boundary: cluster your backend pieces into one container block and annotate ports (7070, 9000).