zaxiu88888/issue-rag

RAG over GitHub issues, with a hand-reviewed eval set and an audit of the judge itself. Reports the interval, not just the best number.

What is issue-rag?

issue-rag is a system that answers questions about a real open-source project (vitejs/vite) by retrieving relevant information from its issue tracker and then using a language model to generate an answer. But its real purpose is measurement: it tests how often an AI's confident answers about a fast-moving library are actually wrong, and whether retrieving recent issues fixes that. It also audits its own grading process to make sure the numbers it reports are trustworthy.

Key Findings

  • Retrieval helps a lot. With no retrieval, the system scores only 8.4% of answers as correct; with the best retrieval configuration, that jumps to 64.2%. The weighted accuracy goes from 0.221 to 0.700.
  • The size of the gain depends on who grades it. The project reports an interval: 2.3× to 3.2× under different AI judges, and about 5.2× under a blind human review. The machine-measured gain is a conservative estimate, not an inflated one.
  • The four retrieval configurations are indistinguishable. Their accuracy scores (0.632–0.700) are within the noise of the judge itself, and the ranking flips when you change the judge. The only solid claims are that closed-book (no retrieval) is always worst, and that retrieval gives a real boost.
  • Retrieval increases fabrication. The rate of confidently wrong answers (e.g., wrong version numbers) jumps from 1.1% (closed-book) to 20% with retrieval. The system goes from “honestly doesn’t know” to “confidently wrong.”
  • The judge was audited on four axes: changing the rubric, changing the judge model, running the same judge twice, and comparing to human review (70% agreement, κ=0.816). The human review showed the judge is too lenient on vague advice (+0.100) and too strict on good retrieval answers (−0.133).

How It Works

The pipeline is:

  1. Harvest – Pull issue titles and maintainer comments from GitHub’s API.
  2. Build corpus – Split issue bodies and comments into chunks, each prefixed with the issue title.
  3. Mine eval set – Each question is a real issue title; the reference answer is the maintainer’s reply that closed it. Humans review and keep/drop candidates (95 kept out of 200).
  4. Retrieve – Use BM25, dense embeddings, hybrid, or hybrid+rerank to find relevant chunks.
  5. Generate – Use a language model (local or API) to produce an answer.
  6. Judge – Grade the answer against the reference using a rubric that flags fabricated version numbers/APIs as the worst outcome.
  7. Evaluate – Produce results tables and JSON.

Three design choices make it trustworthy:

  • Eval set is grounded in real data – no invented questions; each is a real issue title and the maintainer’s actual reply.
  • Retrieval is scored with the source issue excluded – otherwise the query could match its own thread and look perfect. Metrics are reported both with and without that exclusion.
  • Confident wrong answers are scored incorrect, never partial – because that’s the failure mode the system exists to prevent.

Results in Brief

  • Answer quality (95 items, judge deepseek-chat):
    • Closed-book: accuracy 0.221, correct 8.4%, fabricated 1.1%
    • Best retrieval (bm25): accuracy 0.700, correct 64.2%, fabricated 20.0%
  • Retrieval quality (measured on the answering comment, not the issue): the reranker finds the gold chunk best (0.621) but does not produce the best final answers (0.679 vs bm25’s 0.700).
  • Sample size effect: expanding from 29 to 95 items made the retrieval gain stronger (2.72× → 3.17×), not weaker.
  • What survives scrutiny:
    • Retrieval beats closed-book: holds under every condition.
    • The gain is “4×”: does not hold – it’s 2.3×–3.2× by machine judges, ~5× by human.
    • The reranked system is best: does not hold – it’s within noise of the others.
    • Any ordering among the four retrieval configs: unresolved – all within 0.07.
    • The judge understates the gain: supported.
    • The eval set was too small: does not hold – tripling it barely moved closed-book.

Limitations

  • Retrieval only supports English – the corpus, BM25 tokenization, and embedding models are all English. Asking in Chinese retrieves noise and leads to refusals. This is acknowledged as a design flaw.
  • The human review is a single reviewer, 30 answers, one sitting – treated as a directional check, not a precise estimate.

Quickstart

# Setup
python -m venv .venv && source .venv/bin/activate
pip install -e ".[models,dev]"

# Harvest data (works anonymously; set GITHUB_TOKEN for higher rate)
python -m issue_rag.fetch issues   --preset vite --months 12 --allow-wait
python -m issue_rag.fetch comments --preset vite --mode per-issue --max-comment-issues 120

# Build corpus
python -m issue_rag.corpus --preset vite

# Mine eval set, then review by hand
python -m issue_rag.evalset --preset vite
# edit data/processed/vite/evalset_review.csv, then:
python -m issue_rag.evalset --preset vite --finalize

# Run the full matrix (or use an API provider)
python -m issue_rag.evaluate --preset vite --systems closed_book,bm25,dense,hybrid,hybrid_rerank

All stages are cached, so reruns are free.

Why This Isn’t “Chat with Your PDF”

The project deliberately avoids the usual demo pitfalls: it uses real ground truth, excludes the source issue from retrieval scoring, and treats fabricated answers as the worst outcome. It also reports its own measurement noise and audits its judge, so the numbers are honest about their limits.

Related

  • Project
  • Project
  • Project
  • Project