Interface: IVectorStore
Defined in: packages/agentos/src/rag/IVectorStore.ts:247
Interface
IVectorStore
Description
Defines the contract for interacting with a specific vector database or storage backend. Implementations will wrap specific clients (e.g., Pinecone client, Weaviate client, in-memory store logic).
Methods
checkHealth()
checkHealth():
Promise<{details?:any;isHealthy:boolean; }>
Defined in: packages/agentos/src/rag/IVectorStore.ts:381
Async
Checks the operational health of the vector store provider. This might involve pinging the service, checking connection status, or verifying authentication.
Returns
Promise<{ details?: any; isHealthy: boolean; }>
A promise that resolves with the health status.
details can include specific error messages or status information.
collectionExists()?
optionalcollectionExists(collectionName):Promise<boolean>
Defined in: packages/agentos/src/rag/IVectorStore.ts:371
Async
Checks if a collection with the given name exists in the vector store.
Parameters
collectionName
string
The name of the collection to check.
Returns
Promise<boolean>
A promise that resolves with true if the collection exists, false otherwise.
Throws
If the check fails for reasons other than existence (e.g., connection issue).
createCollection()?
optionalcreateCollection(collectionName,dimension,options?):Promise<void>
Defined in: packages/agentos/src/rag/IVectorStore.ts:347
Async
Creates a new collection (or index, class, etc.) in the vector store. This is often necessary before documents can be upserted into it, depending on the provider.
Parameters
collectionName
string
The name of the collection to create.
dimension
number
The dimensionality of the vector embeddings that will be stored in this collection.
options?
Optional parameters for collection creation, such as similarity metric or provider-specific settings.
Returns
Promise<void>
A promise that resolves when the collection is successfully created.
Throws
If collection creation fails (e.g., name conflict and not overwriting, invalid parameters).
delete()
delete(
collectionName,ids?,options?):Promise<DeleteResult>
Defined in: packages/agentos/src/rag/IVectorStore.ts:330
Async
Deletes documents from a specified collection by their IDs or by a metadata filter.
Parameters
collectionName
string
The name of the collection to delete documents from.
ids?
string[]
An array of document IDs to delete.
options?
Optional parameters, including metadata filters or a deleteAll flag.
If ids are provided, options.filter might be ignored or combined,
depending on store behavior. Use with caution.
Returns
Promise<DeleteResult>
A promise that resolves with the result of the delete operation.