An expanded set of questions and answers for evaluating metrics (RAGAS) of the sibling RAG
projects in this repository: context-rag, graph-rag, hybrid-rag, knowledge-enhanced-rag,
memory-augmented-rag, and self-rag.
All 6 projects above currently use the same fixed set of 10 questions (test_queries +
ground_truths, two parallel hardcoded lists in each main.py), separated by category comments
(# EASY, # MEDIUM, # HARD — 4/3/3 questions). Ten questions produce metrics
(faithfulness, answer_relevancy, context_precision, context_recall) with high statistical
variance from one run to another.
This dataset expands that set to 90 questions (9x more) to enable more conclusive and
definitive future evaluations. It is a
standalone data artifact: it does not change any file in the 6 projects or in metrics-rags
(see the "Compatibility" section below).
The 90 questions were generated by directly reading the 7 PDF books that make up the corpus in
context-rag/docs/ — a corpus that is byte-for-byte identical (verified by checksum) to the one
in graph-rag/docs/, and that covers the same domain ("programming logic and algorithms") also
present, in smaller corpora, in knowledge-enhanced-rag/data/apostilas/ and in
memory-augmented-rag/docs/.
Why only the context-rag books: it is the most complete and pedagogically organized corpus in
the domain (7 titles covering everything from basic to advanced), and it is shared with
graph-rag. Two notes about the other projects, for context:
hybrid-rag/docs/contains only one academic-curriculum PDF ("PPC Sistemas de Informação"), described in the project's own README as "1 sample PDF" — it is not a programming logic book, so it was not used as a source.self-rag/docs/has 10 PDFs, including different editions of 5 titles also present incontext-rag(same authors, different files) plus 5 exclusive books (CLRS, data structures). It was not used in this round to keep a single, traceable source; it could be incorporated in a future expansion of the dataset.
Note on topic auditing: of the 7 books in the corpus, 1 (Conceitos de Linguagens de
Programação [Concepts of Programming Languages], by Robert W. Sebesta) was removed as a
source after a topic audit: although it is physically present in the docs/ folder, its content
deals with the design/implementation of programming languages (static/dynamic type binding,
static/dynamic scope resolution) — a discipline distinct from "programming logic," which is the
algorithmic reasoning behind solving problems with sequence, decision, repetition, and data
structures. The 5 questions initially based on Sebesta were replaced with equivalent questions
anchored instead in hash tables and records (heterogeneous data structures) — algorithm
and data-structure topics that the remaining books in the corpus cover directly.
Books actually used as sources (name used in the source_book field) and the number of questions
generated from each:
Book (source_book) |
Questions |
|---|---|
| Lógica de programação (André Luiz Villar Forbellone) [Programming Logic] | 51 |
| Entendendo Algoritmos (Aditya Y. Bhargava) [Grokking Algorithms] | 21 |
| Fundamentos da programação de computadores (Ana Fernanda Gomes Ascencio et al.) [Fundamentals of Computer Programming] | 9 |
| Introdução à programação com Python (Nilo Ney Coutinho Menezes) [Introduction to Programming with Python] | 4 |
| Algoritmos Lógica para desenvolvimento de programação de computadores [Algorithms: Logic for Computer Programming Development] | 3 |
| Algoritmos e Programação de Computadores (Dilermando Junior, Gilberto Nakamiti) [Algorithms and Computer Programming] | 2 |
| Total | 90 |
The distribution is not uniform across the 6 books because each one covers the domain with different depth: the introductory programming-logic books (Forbellone, Ascencio et al., Nakamiti) concentrate the more foundational topics, while the more advanced topics (recursion, search/sorting, complexity, stacks/queues, hash tables, records) come mostly from Bhargava ("Grokking Algorithms") and from "Algoritmos Lógica para desenvolvimento...", the two titles in the corpus that cover these topics in sufficient depth.
- Direct reading of the relevant chapters/sections of each source PDF (not the whole book), focusing on the passages that actually cover the domain's topics.
- Writing the questions in the same tone and style as the projects' original 10 questions
(
main.py:53-69incontext-rag): colloquial-technical, direct, with varied openings ("In a very direct way...", "What is X used for...", "What is the difference between..."). - Writing the answers (
ground_truth) paraphrased from the content read — never copied verbatim from the books — keeping factual fidelity to what the book states, with 2 to 5 sentences per answer. - Assigning the
source_bookfield to each pair, allowing each question/answer to be traced back to its source book. - Verifying that each question is answerable solely from the content of the source books (without introducing knowledge external to the corpus).
- Checking uniqueness: no question repeats or is a trivial rephrasing of another within the final dataset.
qa_dataset_90.json is an array of 90 objects. Each object has exactly these fields:
| Field | Type | Description |
|---|---|---|
id |
string | Sequential identifier Q001–Q090 — makes it easier to read and slice into batches. |
question |
string | The question in English, in the style of the projects' original questions. |
ground_truth |
string | Reference answer, paraphrased from the source book — used as ground_truth in RAGAS evaluations (context_recall, context_precision) or for semantic similarity. |
source_book |
string | Name of the source book the content was extracted from, given as the Portuguese title of the edition actually consulted, followed by an English gloss in brackets (the real original title when the book is a translation, e.g. Bhargava's "Grokking Algorithms"; otherwise a literal translation of the title) — see table above. |
Example item:
{
"id": "Q001",
"question": "What does 'programming logic' mean in simple words?",
"ground_truth": "It is the correct use of the laws of thought and organized reasoning processes applied to creating computer programs, with the goal of producing valid and coherent solutions that properly solve the proposed problems.",
"source_book": "Lógica de programação (André Luiz Villar Forbellone) [Programming Logic]"
}This JSON is a data deliverable, deliberately not integrated with any existing code:
- No
main.pyin the 6 RAG projects was changed — they continue to use their original 10 hardcoded questions (in Portuguese). metrics-rags/generate_rag_plots.py::validate_results()currently validates fixed counts (300 total rows = 5 runs × 10 questions × 6 projects; 50 rows per project; 10 rows per run; each question appearing exactly 30 times). Adopting the 90 questions in any of the 6 projects without also updating these validation constants inmetrics-ragsbreaks that validation.
A future full adoption of this dataset (replacing the current 10 questions in the 6 main.py
files) would require, as separate work:
- Updating
test_queries/ground_truths(or replacing them with a read of this JSON) in eachmain.py. - Recalculating the
metrics-ragsvalidation constants (300 → 5 × 90 × 6 = 2700 total rows; 50 → 450 rows per project; 10 → 90 rows per run).
This integration is out of scope for this deliverable and is a decision to be made separately.