How mr1823/gitcontext works
GitContext indexes a local repository’s source, documentation, Git history, and optional GitHub discussions, then retrieves cited evidence and optionally synthesizes an answer. The principal workflow is scan and parse → chunk and enrich → persist → retrieve/rerank → answer, exposed through CLI and browser/API entry points. Evaluation is a separate product capability. Edges follow shown calls or README-documented behavior; unsampled modules are represented only where their role is documented or their relationship appears in the source index.
Main entry points: indexer.py Index workflow · cli.py CLI commands · web.py FastAPI service · retrieval.py Hybrid retrieval
Components 20
User interfaces
- CLI commands
src/gitcontext/cli.py - Browser UI
src/gitcontext/static/app.js - FastAPI service
src/gitcontext/web.py
Repository ingestion
- Repository scanner
src/gitcontext/ingest/repository.py - Source parser
src/gitcontext/ingest/parser.py - Content chunking
src/gitcontext/chunking.py - Git history
src/gitcontext/ingest/history.py - GitHub ingestion
src/gitcontext/ingest/github.py
Index and retrieval
- Runtime settings
src/gitcontext/config.py - Index workflow
src/gitcontext/indexer.py - Local embeddings
src/gitcontext/embeddings.py - Persistent index
src/gitcontext/vector_store.py - SQLite index
- Qdrant vectors
Answer and evaluation
- Hybrid retrieval
src/gitcontext/retrieval.py - Cited answer
src/gitcontext/answer.py - Retrieval evaluation
src/gitcontext/evaluation.py
Other components
- Developer
- GitHub API
- Chat endpoint
Connections 28
- Developer → CLI commands: runs commands
README.md - Developer → Browser UI: uses browser
README.md - Browser UI → FastAPI service: sends requests
README.md - CLI commands → Repository scanner: scans repository
src/gitcontext/cli.py - CLI commands → Index workflow: indexes repository
src/gitcontext/cli.py - FastAPI service → Repository scanner: scans repository
src/gitcontext/web.py - FastAPI service → Index workflow: indexes repository
src/gitcontext/web.py - Index workflow → Runtime settings: loads settings
src/gitcontext/indexer.py - Index workflow → Repository scanner: finds source files
src/gitcontext/indexer.py - Index workflow → Source parser: parses files
src/gitcontext/indexer.py - Index workflow → Content chunking: chunks content
src/gitcontext/indexer.py - Index workflow → Git history: collects commits
src/gitcontext/indexer.py - Index workflow → GitHub ingestion: fetches discussions
src/gitcontext/indexer.py - GitHub ingestion → GitHub API: requests records
src/gitcontext/ingest/github.py - Index workflow → Local embeddings: embeds chunks
src/gitcontext/indexer.py - Index workflow → Persistent index: writes index
src/gitcontext/indexer.py - Persistent index → SQLite index: persists metadata
src/gitcontext/vector_store.py - Persistent index → Qdrant vectors: syncs vectors
src/gitcontext/vector_store.py - CLI commands → Hybrid retrieval: retrieves evidence
src/gitcontext/cli.py - FastAPI service → Hybrid retrieval: retrieves evidence
src/gitcontext/web.py - Hybrid retrieval → Persistent index: reads chunks
src/gitcontext/retrieval.py - Hybrid retrieval → Local embeddings: encodes query
src/gitcontext/retrieval.py - CLI commands → Cited answer: answers question
src/gitcontext/cli.py - FastAPI service → Cited answer: answers question
src/gitcontext/web.py - Cited answer → Runtime settings: uses endpoint settings
src/gitcontext/answer.py - Cited answer → Chat endpoint: synthesizes answer
src/gitcontext/answer.py - CLI commands → Retrieval evaluation: scores retrieval
src/gitcontext/cli.py - Retrieval evaluation → Hybrid retrieval: evaluates results
src/gitcontext/cli.py