Package org.machanism.machai.bindex.core
A Bindex describes a library or integration, including its identity,
version, description, dependencies, and Classification metadata. The types in this
package form the core workflow around that description:
BindexRepositorydefines operations for saving Bindex documents, retrieving a document by its identifier, and finding relevant documents from classification filters and an embedding vector. Repository searches return lightweightBindexInfosummaries rather than full documents.MongoBindexRepositoryprovides the repository implementation using MongoDB. It stores the serialized Bindex together with searchable classification fields and the classification embedding, and also exposes document deletion and registration-identifier lookup.Pickerturns a natural-language request into one or more classifications with a configured GenAI provider, creates an embedding, and delegates semantic matching to aBindexRepository. It also registers Bindex entries and recursively resolves their dependencies.BindexInfois the compact result model used for recommendations; it contains the selected Bindex identifier, version, description, and similarity score.
A typical integration configures a Configurator, constructs a
MongoBindexRepository with it, and supplies that repository to a
Picker. The configurator selects the MongoDB connection and the GenAI
and embedding providers. pick(String, long, double, org.machanism.macha.core.commons.configurator.Configurator) uses the GenAI
provider to derive Classification filters from a request, creates an
embedding, and returns the matching Bindex summaries. Applications that
create a MongoBindexRepository must call MongoBindexRepository.close() when it is no longer needed to release its
MongoDB client resources.
For example:
org.machanism.macha.core.commons.configurator.Configurator config = ...;
MongoBindexRepository repository = new MongoBindexRepository(config);
Picker picker = new Picker(repository, config);
String request = "Find Java libraries for a REST API";
java.util.Collection<BindexInfo> matches =
picker.pick(request, 20, 0.75, config);
repository.close();
- See Also:
-
ClassDescriptionRepresents metadata information for a Bindex record, including its identifier, version, description, and relevance score.Repository interface for managing
Bindexrecords.MongoDB-backed repository for persisting and retrievingBindexdocuments.Performs Bindex registration, lookup, and semantic retrieval through aBindexRepositoryusing GenAI-derived classifications and embeddings.