ragChunk( )
Chunks documents into smaller pieces for embedding. Part of the segregated flow: ragChunk() → embed() → ragSaveEmbeddings()
function ragChunk(params: infer): PromiseDescription
Chunks documents into smaller pieces for embedding. Part of the segregated flow: ragChunk() → embed() → ragSaveEmbeddings()
Parameters
| Name | Type | Required? | Description |
|---|---|---|---|
params | infer | ✓ | The parameters for chunking |
Returns
PromiseExamples
const chunks = await ragChunk({
documents: ["Long document text here..."],
chunkOpts: {
chunkSize: 256,
chunkOverlap: 50,
chunkStrategy: "paragraph",
},
});ping( )
Sends a ping request to the server and returns the pong response.
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.