rakam_systems.vector_store.VectorStores

class rakam_systems.vector_store.VectorStores(base_index_path: str, embedding_model: str)

A class for managing multiple vector stores using FAISS and SentenceTransformers.

__init__(base_index_path: str, embedding_model: str) None

Initializes the VectorStores with the specified base index path and embedding model.

Parameters:
  • base_index_path – Base path to store the FAISS indexes.

  • embedding_model – Pre-trained SentenceTransformer model name.

Methods

__init__(base_index_path, embedding_model)

Initializes the VectorStores with the specified base index path and embedding model.

create_from_files(stores_files)

Creates FAISS indexes from dictionaries of store names and VSFile objects.

create_from_nodes(store_name, nodes)

Creates a FAISS index from a list of nodes and stores it under the given store name.

get_embeddings(sentences[, parallel])

Generates embeddings for a list of sentences.

load_all_stores()

Loads all vector stores from the base directory.

load_store(store_path)

Loads a single vector store from the specified directory.

predict_embeddings(query)

Predicts embeddings for a given query using the embedding model.

search(store_name, query[, distance_type, ...])

Searches the specified store for the closest embeddings to the query.