Spaces:
Sleeping
Sleeping
Commit History
-
feat(rag): switch to rich context judge with reasoning (D3 strategy)
Replace score gap + boolean judge with Gemini Flash rich context judge that returns story names + reasoning. Benchmarked as best strategy: 58% exact match, 90% within ±1 vs ground truth, ~2s latency. Score floor (-9.0) still handles off-topic queries instantly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>96d78cc -
tune(rag): calibrate relevance filter for raw logit scores
- GAP_THRESHOLD: 0.3 → 5.0 (raw cross-encoder logits, not normalized) - SCORE_FLOOR: add -9.0 threshold for off-topic detection - Improved LLM judge prompt with archive scope context - Benchmark comparison mode in benchmark_filter.py - Results: recall 0.95, latency P50 777ms (vs ~10s before) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0110ecb -
feat(rag): add adaptive relevance filter (score gap + LLM fallback)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>10d159f -
fix(test): increase retrieval latency budget to 1000ms for reranker
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2c36755 -
test: add unit tests for eval/runner.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f4eb869 -
test: add unit tests for rag/prompts.py build_context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>311089e -
feat: add LRU-cached embed_query to avoid re-embedding repeated searches
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2bf4d05
-
refactor: remove streaming generator and rewriter
4e4db5e -
feat(api): replace SSE chat with sync POST /api/search
4bb26eb
-
feat: correct story links, loading UX, slug-based card filtering
- Build link lookup from mediastorm.com nav_config at startup (uid → full path) - Cards only display for stories actually cited by Gemini - Loading dots animation during streaming, cards-or-text display - Updated system prompt: use exact URLs from context, conversational no-match - Added done flag to messages for proper streaming/done state handling - Markdown rendering with marked library Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c2b75fa -
feat: conditional query rewriting for conversational follow-ups
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>4323ffa -
feat: metadata routing for structural queries (most awarded, newest, oldest)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d22b592 -
feat: integrate cross-encoder reranker into hybrid retriever
Adds optional Reranker to HybridRetriever (applied after soft boost, before top-k slice). Updates api.py lifespan and benchmark fixture to pass a Reranker instance. Adds false-positive test for 'jazz' query. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f2386a1 -
feat: cross-encoder reranker with ONNX inference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f3bd99e -
feat: /api/chat SSE endpoint with hybrid RAG
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ea63c1f -
feat: /api/stories endpoint for landing mosaic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>de2956c -
feat: FastAPI skeleton with health endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>61a9b93 -
fix(test): replace quantum_computing edge case with minecraft_redstone
Burner Face story legitimately contains quantum computing content (PLATO AI), so the retriever correctly finds it. Replaced with a query truly outside the archive's scope. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f84669d -
refactor: remove Reranker references from all entrypoint files
app.py, audit.py, eval_retrieval.py, tests/test_generation.py no longer import or instantiate Reranker; HybridRetriever calls drop the reranker kwarg. edge_no_match logic in eval_retrieval.py updated to check len(retrieval.stories) == 0 directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d43a5d9 -
refactor: remove cross-encoder reranker, RRF handles ranking alone
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>195890d -
feat: replace sentence-transformers with ONNX Runtime embedder (bge-small 384d)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0de90e8
-
test: expand generation tests to 30 queries across full spectrum
Cover all 7 categories from eval ground truth: - Geographic (5): Congo, Afghanistan, East Africa, Latin America, Israel-Palestine - Thematic (5): PTSD, climate, women's rights, wildlife, immigration - Temporal (4): 2005-2006, 2022-2025, financial crisis, around 2010 - People (4): Salgado, McCullin, Ai Weiwei, Angelina Jolie - Genre (4): photo essays, crisis guides, family/aging, animation - Awards (4): Emmy, World Press Photo, Iraq war awards, Webby - Edge cases (4): quantum, pasta, Taylor Swift, crypto Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c5592ad -
test: add generation quality tests for Flash responses
- 3 citation tests: verify mediastorm.com links in responses - 3 relevance tests: correct stories for Congo, climate, person queries - 2 edge case tests: no hallucination on food, nothing for quantum computing - Reset Gemini client between tests to avoid event loop issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e06f7cb -
feat: streaming responses with Flash, remove story cards
- Switch generation from Gemini Pro to Flash (2s vs 16s first chunk) - Stream responses progressively via generate_response_stream - Remove story card images from chat responses (links in text suffice) - Strengthen citation prompt for Flash compliance - Handle None responses from Gemini with fallback message - Increase max_output_tokens to 4096 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>6845476 -
feat: retrieval evaluation script with router improvements
- Add eval_retrieval.py with 30 ground truth queries across 7 categories (geographic, thematic, temporal, people, genre, awards, edge cases) - Metrics: Precision@1, Recall@5, MRR, NDCG@5 with separate reporting for core semantic vs filter queries - Router: detect specific award names (Emmy, Webby, World Press Photo) and media types (photo essay, video documentary, interactive) - Retriever: soft boost for award_names and media_type from router - Results: semantic P@1=0.93, MRR=0.96, R@5=0.75 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9d271a0 -
fix: pipeline cleanup + retrieval improvements
- Remove Vimeo dependency (vimeo.py, config, tests) - Simplify merger to wrap_speaker_turns (no timestamps) - Update Gemini models to 2.5-flash/pro - Fix KeyQuote schema to coerce null → empty string - Fix audit.py: use HybridRetriever, remove segments_count - Soft filters: router-inferred filters boost instead of exclude - Cross-filter countries/regions in post-filter - Date range ±3 years for approximate queries - Expose rerank_score, filter low-relevance cards in UI - Fix Gradio chat history format for multi-turn - Stricter RAG prompt (no tangential connections) - Increase transcript window 3K→15K chars for enrichment - Add key_quotes to embedded text for better retrieval - RRF k=60 (was k=20) per best practices Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b03128f
-
feat: update prompts for stories-only context with enriched metadata
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>47d1484 -
feat: rewrite retriever as HybridRetriever with dense+BM25+RRF+reranking
Replaces the old two-phase Retriever with HybridRetriever: dense (ChromaDB) + sparse (BM25) retrieval fused via RRF, cross-encoder reranking, and scalar/ list metadata filtering. Filter invariant enforced in _attach_metadata so BM25 results outside the ChromaDB scalar filter cannot surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>fed3af1 -
feat: add QueryRouter with regex-first intent classification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b37b4cb -
feat: add Reranker with cross-encoder ms-marco-MiniLM-L-12-v2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ceb9c4e -
feat: expand chunk_story metadata (20+ fields), remove chunk_segments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>69f0e6b -
feat: add BM25Store with tokenization, stemming, save/load
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6dd9291 -
refactor: remove segments collection from VectorStore, add get_all_metadata
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>594e33c -
feat: expand StoryEnrichment with themes, countries, regions, event_period, media_type, is_subject
New hybrid RAG fields in StoryEnrichment: - themes: list of thematic tags - countries: geographic coverage list - regions: regional specification list - event_period: temporal scope (e.g., "1994") - media_type: content classification (e.g., "video documentary") PersonMention enriched with is_subject boolean flag. All new fields default to empty collections/strings for backward compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f6eba8b -
feat: propagate content_type from nav tree position in fetcher
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>bea8724 -
feat: add parse_recognition, parse_press_mentions, extract_director, extract_commissioned_by parsers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b8835a7
-
feat: display poster images alongside RAG results
Add _format_story_images() helper that reads poster_images metadata from retrieved stories and appends markdown image references to the chat response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>c2410fa -
feat: propagate poster_images as ChromaDB metadata
e8d4c83 -
feat: extract poster_images during story ingest
148b7d3 -
feat: add extract_poster_images parser function
f0b4063