Package org.machanism.machai.bindex.core
Interface BindexRepository
- All Known Implementing Classes:
MongoBindexRepository
public interface BindexRepository
Repository interface for managing
Bindex records.
Provides methods for retrieving, saving, and recommending Bindex entries based on classification, score, embedding vectors, and configuration.
-
Method Summary
Modifier and TypeMethodDescriptionfind(org.machanism.machai.schema.Classification[] classifications, List<Double> embedding, long vectorSearchLimits, Double score, Configurator config) Finds and retrieves matching Bindex records using a combination of vector similarity search and metadata classification filtering.org.machanism.machai.schema.BindexRetrieves aBindexentry by its unique identifier.Saves aBindexentry to the repository, along with its embedding vector.
-
Method Details
-
find
Collection<BindexInfo> find(org.machanism.machai.schema.Classification[] classifications, List<Double> embedding, long vectorSearchLimits, Double score, Configurator config) Finds and retrieves matching Bindex records using a combination of vector similarity search and metadata classification filtering.This method performs semantic searches using the provided vector embedding, narrows down results based on specific classification tags, and applies threshold filters to deliver highly relevant results.
- Parameters:
classifications- an array ofClassificationfilters to restrict the search scope, ornull/empty to search across all categoriesembedding- the query vector representation used for calculating semantic similarityvectorSearchLimits- the maximum number of candidates to evaluate or retrieve during the vector search phasescore- the minimum similarity score threshold (only records with a relevance score equal to or higher than this value will be returned)config- theConfiguratorcontaining execution or contextual configurations- Returns:
- a collection of
BindexInfoelements matching the search criteria, typically sorted by descending similarity score
-
getBindex
Retrieves aBindexentry by its unique identifier.- Parameters:
bindexId- the unique identifier of the Bindex entry- Returns:
- the
Bindexentry if found, ornullif not found
-
save
Saves aBindexentry to the repository, along with its embedding vector.- Parameters:
bindex- theBindexobject to saveembeddingBson- the embedding vector associated with the Bindex entry- Returns:
- the unique identifier assigned to the saved Bindex entry
-