ragSearch( )
Searches for similar documents in the RAG vector database. **Workspace lifecycle:** This operation requires an existing workspace. If the workspace doesn't exist, returns an empty array.
function ragSearch(params: { modelId: string; n?: number; query: string; topK?: number; workspace?: string }, options?: { forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary" | "verbose" }; timeout?: number }): PromiseParameters
| Name | Type | Required? | Description |
|---|---|---|---|
params | \{ modelId: string; n?: number; query: string; topK?: number; workspace?: string \} | ✓ | The parameters for searching |
options | `{ forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary" | "verbose" }; timeout?: number }` | ✗ |
Returns
PromiseThrows
| Error | When |
|---|---|
When the operation fails |
Example
const results = await ragSearch({
modelId,
query: "AI and machine learning",
topK: 5,
workspace: "my-docs",
});ragSaveEmbeddings( )
Saves pre-embedded documents to the RAG vector database. Part of the segregated flow: chunk() → embed() → saveEmbeddings() **Workspace lifecycle:** This operation implicitly opens (or creates) the workspace. The workspace remains open until closed.
startQVACProvider( )
Starts a provider service that offers QVAC capabilities to remote peers. The provider's keypair can be controlled via the seed option or QVAC_HYPERSWARM_SEED environment variable.