Builder and container for configuring SemanticRetriever embedding providers, vector store, and text chunker.
Signature:
export declare class SemanticRetrieverComponents
Properties
| Property | Type | Description |
|---|---|---|
| providers | ReadonlyArray<EmbeddingProvider> | Registered embedding providers. |
| textChunker | TextChunker | undefined | Optional text chunker used when indexing documents. |
| vectorStore | VectorStore | undefined | Vector store used for indexing and similarity search. |
Methods
| Method | Description |
|---|---|
| addProvider(provider) | Registers an embedding provider (such as universalEmbedder.getProvider()). |
| setTextChunker(chunker) | Sets the text chunker used to split long documents during indexing. |
| setVectorStore(store) | Sets the vector store implementation (defaults to MemoryVectorStore if not set). |
SemanticRetrieverComponents.providers
Registered embedding providers.
Signature:
get providers(): ReadonlyArray<EmbeddingProvider>;
SemanticRetrieverComponents.textChunker
Optional text chunker used when indexing documents.
Signature:
get textChunker(): TextChunker | undefined;
SemanticRetrieverComponents.vectorStore
Vector store used for indexing and similarity search.
Signature:
get vectorStore(): VectorStore | undefined;
SemanticRetrieverComponents.addProvider()
Registers an embedding provider (such as universalEmbedder.getProvider()).
Signature:
addProvider(provider: EmbeddingProvider): this;
Parameters
| Parameter | Type | Description |
|---|---|---|
| provider | EmbeddingProvider | The embedding provider to add. |
Returns:
this
SemanticRetrieverComponents.setTextChunker()
Sets the text chunker used to split long documents during indexing.
Signature:
setTextChunker(chunker: TextChunker): this;
Parameters
| Parameter | Type | Description |
|---|---|---|
| chunker | TextChunker | The text chunker instance (for example, DefaultTextChunker). |
Returns:
this
SemanticRetrieverComponents.setVectorStore()
Sets the vector store implementation (defaults to MemoryVectorStore if not set).
Signature:
setVectorStore(store: VectorStore): this;
Parameters
| Parameter | Type | Description |
|---|---|---|
| store | VectorStore | The vector store instance. |
Returns:
this