feat(rag): offer the storage driver when an agent initializes its RAG

Agent startup and graph rag nodes both run an interactive wizard when their
knowledge base has not been built, but neither offered the driver choice that
interactive named-RAG creation has, so both silently produced a yaml store.

A plain agent was the worse of the two: AgentConfig carries only documents, so
there was no way to get a duckdb RAG for one, interactively or declaratively. A
graph node could at least declare driver: in the workflow.

Agent startup now passes prompt_for_driver, and a rag node whose wizard runs is
asked too. The prompt is skipped when the node already declares a driver, and
sits inside the not-fully-specified branch after the non-interactive bail, so
declarative workflows and headless runs are unchanged. Temp RAGs still pass
false: they are deleted on the next run, so a persistent store would only leave
a sidecar behind.

The prompt moves to select_rag_driver rather than being duplicated.
This commit is contained in:
2026-08-12 12:02:15 -06:00
parent 81ed769f8a
commit c84f9522e9
2 changed files with 30 additions and 26 deletions
+6 -2
View File
@@ -185,7 +185,7 @@ impl Agent {
&rag_path_clone,
&document_paths,
abort,
false,
true,
)
.await
})
@@ -1025,7 +1025,7 @@ async fn init_graph_rags(
{
bail!("rag node '{node_id}': {message}");
}
let config = rag_init_config(rag_node);
let mut config = rag_init_config(rag_node);
let fully_specified = config.embedding_model.is_some()
&& config.chunk_size.is_some()
&& config.chunk_overlap.is_some();
@@ -1051,6 +1051,10 @@ async fn init_graph_rags(
initialized. RAG initialization is required for this agent."
);
}
if config.driver.is_none() {
config.driver = Some(crate::rag::select_rag_driver()?);
}
}
let document_paths =