{% extends "base.html" %} {% block title %}Semantic Search - Talkpipe Vault{% endblock %} {% block content %} {% if agent_trace %} {# An agent run: its selection is neither ranked by similarity nor a fixed count. #} {% set results_note = "Chosen by the agent, in the order it kept them — the note above says how its run ended." %} {% if agent_error %} {# The run failed (no server, model not pulled, no tool calling): the fix is the provider, not the question or the model's tool-calling strength. #} {% set no_results_hint = "The agent could not run: the note above says what failed." %} {% set no_results_suggestions = [ "Fix the chat provider on the Settings page — its Configuration status panel tests it.", "Search without the agent.", ] %} {% else %} {% set no_results_hint = "The agent kept no chunks. The note and the agent tool calls above show what it searched and why it stopped." %} {% set no_results_suggestions = [ "Rephrase the question.", "Try a chat model with stronger tool calling (Settings).", "Search without the agent.", ] %} {% endif %} {% else %} {% set results_note = "Ranked by vector similarity: the closest " ~ search_result_limit ~ " chunks are always returned, so the last few can be weak matches — on a small vault, every chunk. A score of 0 is not shown; the default embedder scores all but the closest match or two at 0, so go by rank." %} {% if vault_path and not folder_mode and not shingled_chunks_count %} {% set no_results_hint = "This vault holds no indexed documents yet, so there is nothing to search." %} {% set no_results_suggestions = [ "Add a folder of documents, or index documents into this vault, on the Vaults & Documents page.", ] %} {% else %} {% set no_results_hint = "Semantic search works best with a complete question or descriptive phrase." %} {% set no_results_suggestions = [ "Use a broader phrase.", "Refresh the vault if files were just indexed.", ] %} {% endif %} {% endif %} {% set score_help = "Higher scores are more similar to your query." %} {% include "_search_results.html" %} {% include "_document_modal.html" %} {% include "_search_interactions.html" %} {% endblock %}