What the project does and what makes it unique
Goldilocks RAG is a configurable evaluation lab for choosing the LLM, and the amount of retrieved context, behind a document-grounded assistant. The RAG setup stays frozen so that only the model changes. Gemini and Grok receive the same context, the same prompt and the same generation settings. Every answer is scored for correctness against a reference answer, completeness, and grounding (the share of claims supported by the retrieved context).
The lab is not tied to one dataset:
- Inputs: question sets and result or metric files can be loaded from the start screen.
- Context strategies: top-N chunks, neighbouring chunks and the full document, run as a sweep from a configuration file.
- Settings: generation parameters and models are set per run.
The same lab can therefore assess a pre-processed document collection, a question set or a new model version, and turn a model choice into a repeatable, evidence-based test rather than an impression.
In this demonstration, we applied it to GeoAtributo's quality-management documentation (procedures, annexes and templates). We used 62 reference questions plus one no-context test case, and 7 context configurations: top-1, 3, 6 and 10, neighbours 3×1 and 5×2, and the full document. The first results (models: Gemini 4 Argon and Grok 4.7; blind cross-judging by an LLM judge, in which each model scores the other's answers) were:
- With 6 chunks, both models pass 96% of scored cases. Grounding is 0.98 to 1.00 for both in every configuration.
- Context size matters more than the model: correctness rises from 0.86 (Gemini) and 0.89 (Grok) with one chunk to 0.95 to 0.99 with three or more chunks, neighbouring chunks or the full document.
- Limits: each configuration was run once, and between 7 and 16 of the 63 cases per configuration are not scored for correctness (expected refusals, wrong refusals or cases without context), so pass rates have different denominators per model. Differences of one or two points are smaller than one case.
The role of AI in the solution
- Gemini and Grok generate the answers under comparison.
- An LLM judge scores every answer.
- In the blind cross-judging mode, each model scores the other's answers.
- A blind human evaluation screen lets people score each answer from 0 to 10 and export the results to CSV.
Technologies
- Python, FastAPI and uvicorn
- OpenAI SDK for the xAI API (Grok), and the Gemini API
- React and Vite (TypeScript)
- Docker and nginx, deployed on Google Cloud Run with Firestore
- pytest
Source code link