QVAC Logo

ragCloseWorkspace( )

Closes a RAG workspace, releasing in-memory resources (Corestore, HyperDB adapter, RAG instance). **Workspace lifecycle:** Workspaces are implicitly opened. This function explicitly closes them, releasing memory and file locks. The workspace data remains on disk unless `deleteOnClose` is set to true.

function ragCloseWorkspace(params?: { deleteOnClose?: boolean; workspace?: string }, options?: { forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary" | "verbose" }; timeout?: number }): Promise

Parameters

NameTypeRequired?Description
params\{ deleteOnClose?: boolean; workspace?: string \}The parameters for closing
options`{ forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary""verbose" }; timeout?: number }`

Returns

Promise

Throws

ErrorWhen
When the operation fails

Example

// Close a specific workspace
await ragCloseWorkspace({ workspace: "my-docs" });

// Close and delete in one call
await ragCloseWorkspace({ workspace: "my-docs", deleteOnClose: true });

On this page