Skip to content

GitWhy

Persistent memory for AI coding agents over your git history. Indexed once, exposed over MCP — so your editor's AI agent answers "why does this exist?" instantly, with citations.

The pitch in one paragraph

Every developer wastes hours re-deriving why a codebase looks the way it does. The answers live in git history, but commit messages are usually unhelpful (fix, wip, major update) and on-demand AI editors re-pay the analysis cost every session. GitWhy indexes your repository’s history once, uses an LLM to reverse-engineer intent from actual code diffs, and exposes the result over MCP — so any compatible editor (Cursor, Claude Code, Windsurf) gets fast, citation-backed historical context as a native tool call.

What’s inside

3-agent architecture

Archaeologist (indexes + enriches), Knowledge (RAG + citations), Insight (SQL analytics). Explicit inter-agent communication via SQLite — testable, persistent, team-shareable.

9 MCP tools

gitwhy.why, gitwhy.history, gitwhy.risk, gitwhy.related, gitwhy.context_for_pr, gitwhy.catchup, gitwhy.search, gitwhy.suggest_commit_message, gitwhy.ping.

Multi-provider LLM

OpenAI (gpt-4o, gpt-4o-mini), Google Gemini (2.5-flash + gemini-embedding-001), deterministic mock for tests. Auto-detected from env vars.

Adversarial-tested

280+ tests across 33 files. Dedicated suite for prompt injection, secrets in diffs, unicode hazards, SQL-injection-shaped inputs, concurrent queries.

How it compares

ToolWhat it doesWhat GitWhy adds
git log -p + naked AI editorExplains a diff on demandPre-indexed, persistent, citation-backed; 100× faster per query, no re-analysis cost
Repowise / CodeSceneStatic git analytics (hotspots, ownership)AI-inferred intent from diffs, not just metrics; MCP-native; conversational Q&A
Lore ProtocolImproves future commit message hygieneUnderstands existing messy history retroactively

Capstone submission

GitWhy was built as a capstone for the EPAM Generative AI for Software Development program. The deliverables — architecture blueprint, executive summary, self-review — are rendered as proper pages here rather than left as raw Markdown.