How lit-24-25/github-issues works
Project type and purpose
• This is a full-stack Django web application (“GitHelp”) that provides technical support for GitHub repositories.
• It uses GitHub Issues as its knowledge base and leverages external LLM/embedding services (OpenRouter, GigaChat) plus an internal retrieval pipeline to answer users’ questions.
File structure
• Top-level Django project:
• issues_project/ ← Django project configuration (settings, URLs, ASGI/WSGI)
• manage.py ← Django CLI entry point
• Django apps:
• question_app/ ← Handles question submission, context building, HTTP views, templates, serializers, URLs, management command (train_model)
• conversation/ ← Manages conversation history models, views, admin interface
• Pure‐Python business logic module:
• business_logic/ ← Implements chunking, vector store (Chroma), embedding/model wrappers, retrieval, training orchestration
• Tests and cassettes:
• tests/ ← Unit/integration tests, VCR cassettes for GitHub API mocks, markdown issue fixtures
• Config/deploy:
• .github/workflows/main.yml ← CI pipeline
• requirements.txt, setup.py, pytest.ini
README for additional insights
• Describes external dependencies: GitHub token, OpenRouter API key, GigaChat API key
• Outlines the training step (manage.py train_model) to ingest repository issues into the embedding store
• Outlines the server startup and usage flow
Main components and their interactions
a. Frontend (Browser)
• Users access a Django‐rendered HTML form or conversation UI (templates/question_app/*.html)
b. Django Web Server
• question_app.views: handles question submissions, invokes business_logic.retrieve()
• conversation.views: serves conversation history, admin interface
c. Business Logic Layer (business_logic/)
• train.py: orchestration for building the embedding store
• chunks.py: splits issue text into retrievable chunks
• mychroma.py: vector store interface (ChromaDB)
• mymodel.py: abstraction over OpenRouter/GigaChat API calls
• retrieve.py: retrieves top‐k chunks and assembles prompts
d. Database
• Django ORM models: question_app.models (questions, contexts), conversation.models (messages, threads)
e. External Services
• GitHub REST API: fetch raw issue data during training & retrieval
• OpenRouter API: language model inference for answer generation
• GigaChat API: embedding generation (and possibly chat)
f. CI/CD Pipeline
• GitHub Actions: runs tests via pytest
Relationships & data flow
1. User → HTTP POST /ask → question_app.views
2. question_app → business_logic.retrieve()
3. retrieve():
• fetches embeddings from ChromaDB
• if cache miss, may call GitHub API
• calls model APIs for answer
4. business_logic returns answer → question_app stores question/answer in DB
5. question_app returns HTTP response → User
6. Admin or conversation UI → conversation.models → DB → views → User
Architectural patterns and principles
• Layered architecture:
• Presentation (templates, serializers, views)
• Application logic (Django apps)
• Domain/Business logic (vector retrieval, model wrappers)
• Infrastructure (DB, external APIs)
• Single-monolith deployment (no microservices), with clear separation of concerns via Python packages and Django apps
• Command-based orchestration (train_model) for offline processing
• Use of Django’s management command and ORM to persist conversational state
Final checklist
• [ ] Browser/UI
• [ ] Django Web Server subdivided by app
• [ ] Business Logic modules
• [ ] Database (ORM models)
• [ ] External APIs (GitHub, OpenRouter, GigaChat)
• [ ] Management command path (train_model)