Skip to main content

getChunks

client.vectorDb.getChunks(id: string, params?: Record<string, unknown>): Promise<VectorChunk[]>

Retrieves chunks from a vector collection.

Fetches text chunks that were created when documents were processed. Chunks are smaller segments of documents used for more granular similarity search and retrieval operations.

Parameters​

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the collection
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns​

Promise<VectorChunk[]> — A promise that resolves to an array of VectorChunk objects

Example​

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.vectorDb.getChunks('id');
console.log(result);