Skip to main content

Class: VectorStoreManager

Defined in: packages/agentos/src/rag/VectorStoreManager.ts:58

Implements the IVectorStoreManager interface.

VectorStoreManager

Implements

Implements

Constructors

Constructor

new VectorStoreManager(): VectorStoreManager

Defined in: packages/agentos/src/rag/VectorStoreManager.ts:69

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/rag/VectorStoreManager.ts:63

Methods

checkHealth()

checkHealth(providerId?): Promise<VectorStoreManagerHealthReport>

Defined in: packages/agentos/src/rag/VectorStoreManager.ts:282

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.

Async

Implementation of

IVectorStoreManager.checkHealth


getDefaultProvider()

getDefaultProvider(): IVectorStore

Defined in: packages/agentos/src/rag/VectorStoreManager.ts:220

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/rag/VectorStoreManager.ts:204

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/rag/VectorStoreManager.ts:242

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/rag/VectorStoreManager.ts:78

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.

Async

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/rag/VectorStoreManager.ts:274

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/rag/VectorStoreManager.ts:266

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/rag/VectorStoreManager.ts:343

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.

Async

Implementation of

IVectorStoreManager.shutdownAllProviders