Skip to main content

Class: VectorStoreManager

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:59

Implements the IVectorStoreManager interface.

Implements​

Implements​

Constructors​

Constructor​

new VectorStoreManager(): VectorStoreManager

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:70

Constructs a VectorStoreManager instance. The manager is not operational until initialize is called.

Returns​

VectorStoreManager

Properties​

managerInstanceId​

readonly managerInstanceId: string

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:64

Methods​

checkHealth()​

checkHealth(providerId?): Promise<VectorStoreManagerHealthReport>

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:295

Async

Checks the health of all managed vector store providers or a specific one. This aggregates health information from individual IVectorStore.checkHealth() calls.

Parameters​

providerId?​

string

Optional: If provided, checks only this specific provider. If omitted, checks all configured providers.

Returns​

Promise<VectorStoreManagerHealthReport>

A promise that resolves with a comprehensive health report.

Implementation of​

IVectorStoreManager.checkHealth


getDefaultProvider()​

getDefaultProvider(): IVectorStore

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:233

Retrieves the default IVectorStore provider instance as configured in VectorStoreManagerConfig.defaultProviderId.

Returns​

IVectorStore

The default IVectorStore instance.

Throws​

If no default provider is configured, the configured default provider is not found, or it failed to initialize.

Implementation of​

IVectorStoreManager.getDefaultProvider


getProvider()​

getProvider(providerId): IVectorStore

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:217

Retrieves a specific, initialized IVectorStore provider instance by its configured ID. The provider ID corresponds to VectorStoreProviderConfig.id.

Parameters​

providerId​

string

The unique ID of the vector store provider instance.

Returns​

IVectorStore

The IVectorStore instance.

Throws​

If the providerId is not configured, not found, or the provider failed to initialize.

Implementation of​

IVectorStoreManager.getProvider


getStoreForDataSource()​

getStoreForDataSource(dataSourceId): Promise<{ collectionName: string; dimension?: number; store: IVectorStore; }>

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:255

Retrieves an IVectorStore instance and the specific collection name within that store associated with a given logical RAG Data Source ID. This is a convenience method for services like RetrievalAugmentor that operate on logical dataSourceIds.

Parameters​

dataSourceId​

string

The logical RAG Data Source ID (from RagDataSourceConfig.dataSourceId).

Returns​

Promise<{ collectionName: string; dimension?: number; store: IVectorStore; }>

A promise that resolves with the IVectorStore instance, the actual collection name to use with that store for this data source, and the expected embedding dimension.

Throws​

If the dataSourceId is not configured, or its associated provider is unavailable.

Implementation of​

IVectorStoreManager.getStoreForDataSource


initialize()​

initialize(managerConfig, dataSourceConfigs): Promise<void>

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:79

Async

Initializes the VectorStoreManager with configurations for all its managed providers and data sources. This involves instantiating and initializing each configured IVectorStore provider.

Parameters​

managerConfig​

VectorStoreManagerConfig

The manager's configuration, including an array of individual vector store provider configurations.

dataSourceConfigs​

RagDataSourceConfig[]

An array of configurations for all logical data sources, which map to specific providers and collections/indexes within them.

Returns​

Promise<void>

A promise that resolves when the manager and all its essential providers are successfully initialized.

Throws​

If initialization fails due to invalid configuration, inability to connect to a critical provider, or other setup errors.

Implementation of​

IVectorStoreManager.initialize


listDataSourceIds()​

listDataSourceIds(): string[]

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:287

Lists the unique IDs of all logical RAG Data Sources configured.

Returns​

string[]

An array of RAG Data Source IDs.

Implementation of​

IVectorStoreManager.listDataSourceIds


listProviderIds()​

listProviderIds(): string[]

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:279

Lists the unique IDs of all vector store providers configured and managed by this manager.

Returns​

string[]

An array of provider IDs.

Implementation of​

IVectorStoreManager.listProviderIds


shutdownAllProviders()​

shutdownAllProviders(): Promise<void>

Defined in: packages/agentos/src/cognition/rag/VectorStoreManager.ts:356

Async

Gracefully shuts down all managed vector store providers. This calls the shutdown() method on each initialized IVectorStore instance.

Returns​

Promise<void>

A promise that resolves when all providers have been shut down.

Implementation of​

IVectorStoreManager.shutdownAllProviders