Building a RAG-Powered Code Reviewer That Actually Understands Your Codebase A developer with 12+ years of Magento experience built a RAG-powered code review tool that understands project-specific patterns, not just generic advice. The tool indexes a codebase using tree-sitter for PHP parsing and BGE-small for embeddings, then retrieves relevant context before querying an LLM. It outperforms long-context approaches at scale by providing surgical, relevant code snippets instead of noise. Most AI code review tools give you generic advice. "Add type hints." "Handle exceptions." Useful, sure — but the same advice you'd get from any linter or a quick ChatGPT prompt. What if your AI reviewer could say: "Add type hints to the constructor — consistent with how OrderProcessor.php and OrderPlaceAfter.php already do it in your project" ? That's the difference between a generic AI tool and one that understands your codebase . I built the latter. Here's how. I've been a Magento/PHP developer for 12+ years. Magento has complex architectural patterns — plugins, observers, dependency injection via XML, area-scoped configuration. When tools like CodeRabbit or GitHub Copilot review Magento code, they're getting better at repository-wide context — Copilot indexes your workspace, CodeRabbit reads related files. But they still treat Magento XML configurations as static text files rather than active dependency injection and event routing maps. They don't inherently know that: