Skip to main content

Module rag

Module rag 

Source
Expand description

All wiring for the optional RAG server lives in this module — config reading, client construction (client) and the background sync loop (sync). Everything talks to the server through crate::server_client; the rest of the TUI only consumes these helpers and renders status.

Enums§

RagStatus
RAG connection status surfaced in the footer. Disabled (no server configured) is never sent — the loop simply doesn’t start — so the footer shows nothing.

Functions§

rag_client
Builds a RagClient for the current vault from config, or None when no server URL is configured. Shared by every RAG query surface.
rag_configured
Whether a RAG server is configured (drives showing the semantic surface at all). Reachability is a separate, runtime concern.
spawn_rag_sync
Spawns the background sync loop for vault if a RAG server is configured. Returns the task handle (abort it when the vault is rebuilt), or None when the feature is off. Status is delivered to the UI via AppEvent::RagStatus.