Defines the embedding model and vector store components to the runtime. This must be called before using any other method in the class. If already defined, this is a no-op.
Delete resources from the runtime. This should be called when the VectorStore is no longer needed. If already deleted, this is a no-op.
Generates an embedding vector for the given input text using the embedding model
Input text to embed
Inserts a new document into the vector store
Retrieves the top-K most similar documents to the given query
The input query string to search for similar content
Number of top similar documents to retrieve
The
VectorStore
class provides a high-level abstraction for storing and retrieving documents. It mainly consists of two modules - embedding model and vector store.It supports embedding text using AI and interfacing with pluggable vector store backends such as FAISS or ChromaDB. This class handles initialization, insertion, similarity-based retrieval, and cleanup.
Typical usage involves:
initialize()
insert()
retrieve()
The embedding model and vector store are defined dynamically within the provided runtime.