glam/backend/rag
kempersc 0b0ea75070 feat(rag): add factual query fast path - skip LLM for count/list queries
- Add ontology cache warming at startup in lifespan() function
- Add is_factual_query() detection in template_sparql.py (12 templates)
- Add factual_result and sparql_query fields to DSPyQueryResponse
- Skip LLM generation for factual templates (count, list, compare)
- Execute SPARQL directly and return results as table (~15s → ~2s latency)
- Update ConversationPanel.tsx to render factual results table
- Add CSS styling for factual results with green theme

For queries like 'hoeveel archieven zijn er in Den Haag', the SPARQL
results ARE the answer - no need for expensive LLM prose generation.
2026-01-08 13:34:23 +01:00
..
benchmark_results enrich custodian profiles 2026-01-02 02:10:18 +01:00
optimized_models fix(rag): correct SPARQL ontology prefixes for LinkML schema 2025-12-22 21:31:08 +01:00
specificity Enhance specificity scoring system integration with existing infrastructure 2026-01-05 17:37:49 +01:00
__init__.py Fix LinkML URI conflicts and generate RDF outputs 2026-01-07 12:32:59 +01:00
atomic_decomposer.py enrich custodians 2025-12-11 22:32:09 +01:00
benchmark_lm_optimization.py remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
benchmark_optimization.py remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
benchmark_optimization_v2.py enrich entries 2025-12-21 22:12:34 +01:00
benchmark_performance.py enrich custodian profiles 2026-01-02 02:10:18 +01:00
benchmark_prompt_caching.py enrich entries 2025-12-23 13:27:35 +01:00
cache_config.py enrich custodians 2025-12-11 22:32:09 +01:00
cost_tracker.py enrich person custodian 2025-12-14 17:09:55 +01:00
dspy_heritage_rag.py Refactor RAG to template-based SPARQL generation 2026-01-07 22:04:43 +01:00
event_retriever.py Fix LinkML URI conflicts and generate RDF outputs 2026-01-07 12:32:59 +01:00
gepa_training_extended.py enrich custodians 2025-12-11 22:32:09 +01:00
LM_OPTIMIZATION_FINDINGS.md enrich entries 2025-12-21 22:12:34 +01:00
main.py feat(rag): add factual query fast path - skip LLM for count/list queries 2026-01-08 13:34:23 +01:00
metrics.py Refactor RAG to template-based SPARQL generation 2026-01-07 22:04:43 +01:00
ontology_mapping.py feat(rag): Add hybrid language detection and enhanced ontology mapping 2025-12-14 15:55:18 +01:00
optimization_log.txt enrich custodians 2025-12-11 22:32:09 +01:00
optimize_templates.py enrich HC profiles 2026-01-02 02:11:04 +01:00
optimized_heritage_router.json enrich person custodian 2025-12-14 17:09:55 +01:00
reply_types.py enrich CH entries with mission statements 2026-01-04 13:12:32 +01:00
requirements.txt add sparql validator and RAG injector 2025-12-30 03:43:31 +01:00
run_bootstrap_optimization.py enrich custodians 2025-12-11 22:32:09 +01:00
run_gepa_optimization.py enrich custodians 2025-12-11 22:32:09 +01:00
run_mipro_optimization.py remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
schema_loader.py Enhance specificity scoring system integration with existing infrastructure 2026-01-05 17:37:49 +01:00
semantic_cache.py enrich entries 2025-12-23 13:27:35 +01:00
semantic_router.py Refactor RAG to template-based SPARQL generation 2026-01-07 22:04:43 +01:00
session_manager.py enrich HC profiles 2026-01-02 02:11:04 +01:00
template_sparql.py feat(rag): add factual query fast path - skip LLM for count/list queries 2026-01-08 13:34:23 +01:00
temporal_intent.py Fix LinkML URI conflicts and generate RDF outputs 2026-01-07 12:32:59 +01:00
temporal_resolver.py Fix LinkML URI conflicts and generate RDF outputs 2026-01-07 12:32:59 +01:00
test_dspy_rag.py enrich person custodian 2025-12-14 17:09:55 +01:00
test_live_rag.py fix(rag): correct SPARQL ontology prefixes for LinkML schema 2025-12-22 21:31:08 +01:00
test_rate_limit_handling.py enrich entries 2025-12-23 13:27:35 +01:00
test_semantic_routing.py Refactor RAG to template-based SPARQL generation 2026-01-07 22:04:43 +01:00
test_template_sota.py Refactor RAG to template-based SPARQL generation 2026-01-07 22:04:43 +01:00
test_temporal_intent.py Fix LinkML URI conflicts and generate RDF outputs 2026-01-07 12:32:59 +01:00