From b628dd0981c00c22e91c4a64f3c187914eb690b5 Mon Sep 17 00:00:00 2001 From: Morgan-Sell Date: Fri, 24 Apr 2026 18:39:46 -0700 Subject: [PATCH 1/8] Implement document expansion to improve RAG performance --- README.md | 1 - configs/default.yaml | 14 ++ img/trailhead_ui.png | Bin 0 -> 340 bytes src/config/loader.py | 19 ++ src/evaluation/config_merge.py | 2 + src/gradio_app/components.py | 2 + src/pipeline/models.py | 3 + src/pipeline/rag_pipeline.py | 11 ++ src/pipeline/trace.py | 6 +- src/retrieval/document_expansion.py | 262 ++++++++++++++++++++++++++++ src/vectorstore/chroma_store.py | 32 ++++ src/vectorstore/protocol.py | 18 +- tests/test_config_merge.py | 1 + tests/test_document_expansion.py | 219 +++++++++++++++++++++++ tests/test_vectorstore.py | 37 ++++ 15 files changed, 624 insertions(+), 3 deletions(-) create mode 100644 img/trailhead_ui.png create mode 100644 src/retrieval/document_expansion.py create mode 100644 tests/test_document_expansion.py diff --git a/README.md b/README.md index bead92a..2d137de 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Trailhead Trailhead is a snow-sports RAG app that answers questions over a richly linked world of athletes, resorts, competitions, and results. It pairs grounded retrieval, cited answers, evaluation tooling, and a clean UI, with just enough mountain energy to make the whole thing more fun than your average AI demo. -`Hierarchical retrieval` `Cited answers` `RAG sweeps` `Trace analysis` `Dockerized UI`