feat(rag): add database routing to geographic query templates

Add databases: ["oxigraph"] to 4 geographic templates to skip vector search:
- list_institutions_by_type_city
- list_institutions_by_type_region
- list_institutions_by_type_country
- list_institutions_in_city

Also add documentation explaining database routing configuration in _metadata.
This commit is contained in:
kempersc 2026-01-09 11:56:18 +01:00
parent 5255128159
commit 76644f55f5

View file

@ -50,6 +50,29 @@ _metadata:
# ui_template:
# nl: "Gevonden: {{ count }} {{ institution_type_nl }} in {{ city }}."
# en: "Found: {{ count }} {{ institution_type_en }} in {{ city }}."
#
# Database Routing Configuration
# ==============================
# Each template can specify which databases to query via `databases` (list).
# This allows skipping unnecessary data sources for faster, deterministic results.
#
# Available databases:
# - "oxigraph": SPARQL Knowledge Graph (deterministic, has coordinates)
# - "qdrant": Vector search (probabilistic, semantic similarity)
#
# Examples:
# databases: ["oxigraph", "qdrant"] # Default: query both (backward compatible)
# databases: ["oxigraph"] # SPARQL only - skip vector search
# databases: ["qdrant"] # Vector only - for exploration queries
#
# Use ["oxigraph"] for:
# - Geographic/map queries (Oxigraph has lat/lon coordinates)
# - Factual queries with known schema (counts, lists by type)
# - Deterministic results without vector noise
#
# Use ["qdrant"] for:
# - Semantic exploration ("similar institutions to X")
# - Free-text search without structured slots
# Standard SPARQL prefixes used in all templates
_prefixes: |
@ -473,6 +496,7 @@ templates:
description: "List heritage institutions of a specific type in a city"
intent: ["geographic", "exploration"]
response_modes: ["table", "map"]
databases: ["oxigraph"] # Geographic query - Oxigraph has lat/lon coordinates
ui_template:
nl: "Gevonden: {{ result_count }} {{ institution_type_nl }} in {{ city }}."
en: "Found: {{ result_count }} {{ institution_type_en }} in {{ city }}."
@ -556,6 +580,7 @@ templates:
description: "List heritage institutions of a specific type in a province/region"
intent: ["geographic", "exploration"]
response_modes: ["table", "map"]
databases: ["oxigraph"] # Geographic query - Oxigraph has lat/lon coordinates
ui_template:
nl: "Gevonden: {{ result_count }} {{ institution_type_nl }} in {{ region }}."
en: "Found: {{ result_count }} {{ institution_type_en }} in {{ region }}."
@ -620,6 +645,7 @@ templates:
description: "List heritage institutions of a specific type in a country"
intent: ["geographic", "exploration"]
response_modes: ["table", "map"]
databases: ["oxigraph"] # Geographic query - Oxigraph has lat/lon coordinates
ui_template:
nl: "Gevonden: {{ result_count }} {{ institution_type_nl }} in {{ country }}."
en: "Found: {{ result_count }} {{ institution_type_en }} in {{ country }}."
@ -839,6 +865,7 @@ templates:
description: "List all heritage institutions in a city"
intent: ["geographic", "exploration"]
response_modes: ["table", "map"]
databases: ["oxigraph"] # Geographic query - Oxigraph has lat/lon coordinates
ui_template:
nl: "Gevonden: {{ result_count }} erfgoedinstellingen in {{ city }}."
en: "Found: {{ result_count }} heritage institutions in {{ city }}."