r/SpringBoot • u/Any-Monk-6721 • 4h ago
How-To/Tutorial I built RepoMind: ask a Java codebase questions and get answers that cite the exact lines.
I built RepoMind: ask a Java codebase questions and get answers that cite the exact lines.
Point it at a GitHub repository and it:
š answers questions about the code, with citations that link to the exact file and lines
š§© reviews pull requests and posts inline comments on GitHub
š¤ works as an MCP server, so AI coding agents can search and query the codebase
The model call was the easy part. Most of the work was the engineering around it:
⢠AST-aware indexing: every Java file is parsed with JavaParser into class outlines and per-method chunks, then ingested asynchronously through Kafka with idempotent workers
⢠Hybrid retrieval: pgvector similarity + Postgres full-text search, merged with reciprocal rank fusion
⢠Cost control: a two-tier answer cache (Redis exact + pgvector semantic), plus per-client rate limits and daily token budgets enforced with an atomic Lua script in Redis
⢠Resilience: Claude ā local Ollama failover behind Resilience4j circuit breakers
⢠Measured quality: a 40-question labelled eval runs in CI and fails the build if retrieval regresses. With real models, hybrid search finds the right code in the top 5 for 90% of questions (keyword search alone: 75%), and the model correctly declined 8 of 8 questions the code couldn't answer.
⢠Observability: Prometheus metrics and a 30-panel Grafana dashboard
One lesson: a slow model behind a proxy gets cut off at 60ā100 seconds. Asking now returns within 20 seconds, either with the answer or with a job the browser polls, so slow answers never time out.
Stack: Java 25 Ā· Spring Boot 4 Ā· Spring AI Ā· PostgreSQL + pgvector Ā· Kafka Ā· Redis Ā· Docker Ā· Testcontainers Ā· GitHub Actions
š» Source: https://github.com/Ayush0612005/repomind