Bindex Core 1.3.3-SNAPSHOT API
Bindex Core
Bindex Core provides core functions for managing bindex metadata, including library generation, registration, selection, and project building. It enables automated processing of library metadata to support efficient application discovery, integration, and assembly workflows.
The project supports all types of project files, including source code, documentation, project site content, and other relevant files. Its Bindex metadata provides a consistent way to describe those resources so that they can be discovered and assembled by applications and AI-assisted development workflows.
The module manages org.machanism.machai.schema.Bindex records that describe
reusable projects, libraries, integrations, and their classifications. It stores those
records in MongoDB, generates classification embeddings through configured GenAI providers,
and retrieves matching libraries by combining metadata filters with MongoDB vector search.
Bindex metadata model
A Bindex is a structured JSON document, commonly stored as bindex.json, that acts as
the registration and retrieval unit for a project or library. The document captures the
information needed to identify a reusable component and match it to project requirements.
- Identity: logical id, name, version, and descriptive text for the registered component.
- Classification: domains, layers, languages, and integrations used to filter and rank candidates.
- Dependencies: related Bindex identifiers that can be traversed to collect transitive context.
- Embeddings: vector representations of classifications used for semantic search.
Package structure
The public API is centered on the org.machanism.machai.bindex.core package and its
org.machanism.machai.bindex.ai.tools integration package. The core package owns
persistence and semantic selection; the tools package adapts those operations for function
calling by configured GenAI providers.
-
org.machanism.machai.bindex.coreprovides MongoDB-backed Bindex registration, persistence, retrieval, and semantic selection services. ItsBindexRepositorycontract separates storage from thePickerorchestration layer, whileMongoBindexRepositorystores serialized Bindex JSON together with searchable classification fields and embeddings. -
org.machanism.machai.bindex.ai.toolsexposes Bindex operations as callable function tools for GenAI-assisted workflows, including retrieval, recommendation, file-based registration, and JSON-based registration.
Core responsibilities
-
Repository abstraction through
org.machanism.machai.bindex.core.BindexRepository, which defines operations for saving Bindex records, retrieving them by id, and finding recommended entries from classification text and embeddings. -
MongoDB persistence through
org.machanism.machai.bindex.core.MongoBindexRepository, which serializes Bindex objects to JSON, stores metadata fields for filtering, maintains classification embedding vectors, and reads registered records back into schema objects. -
Semantic selection through
org.machanism.machai.bindex.core.Picker, which classifies natural-language requests, generates embeddings, delegates vector search to the repository, registers Bindex records, and resolves dependency identifiers recursively. -
AI tool integration through
org.machanism.machai.bindex.ai.tools.BindexFunctionTools, which provides theget_bindex,pick_libraries,register_bindex, andregister_bindex_jsontools for supported GenAI providers.
Typical workflow
- Create or update a
bindex.jsondocument that describes a reusable project or library. - Register the document with a
Pickeror the registration function tools. - Persist the serialized Bindex, searchable metadata, and classification embedding in MongoDB.
- Submit a natural-language request describing required capabilities, stack, or integrations.
- Classify the request with the configured GenAI provider and generate an embedding for the classification.
- Search registered Bindex records with vector similarity and metadata filters such as language and layer.
- Retrieve matching Bindex records and, where needed, traverse dependency references for additional context.
Configuration and runtime behavior
- Java compilation targets release
17, as configured by Maven. - MongoDB access is configured through the project’s
Configurator, including the repository URL and optional credentials. - Embedding generation uses the configured
embedding.modelprovider and 700-dimensional vectors. - Request classification uses
pick.modelwhen present, otherwise the gateway model configured bygw.model. - Tool-based recommendations default to a score of
0.85and a vector-search limit of25. - The module depends on generated schema classes in
org.machanism.machai.schemafor Bindex and classification structures.
Main types
org.machanism.machai.bindex.core.BindexRepositorydefines the storage and search contract for Bindex metadata.org.machanism.machai.bindex.core.MongoBindexRepositoryimplements MongoDB-backed storage and vector-search result loading.org.machanism.machai.bindex.core.Pickerorchestrates Bindex registration, prompt classification, embedding generation, search, and lookup.org.machanism.machai.bindex.core.BindexInfocarries the identifier, version, description, and similarity score returned by searches.org.machanism.machai.bindex.ai.tools.BindexFunctionToolsregisters Bindex-related operations as GenAI function tools.
Usage examples
Register a Bindex record with generated classification embeddings.
Configurator configurator = ...;
BindexRepository repository = new MongoBindexRepository(configurator);
Picker picker = new Picker(repository, configurator);
Bindex bindex = ...;
String recordId = picker.save(bindex);
Pick registered libraries for a natural-language requirement.
Configurator configurator = ...;
BindexRepository repository = new MongoBindexRepository(configurator);
Picker picker = new Picker(repository, configurator);
Collection<BindexInfo> matches = picker.pick("Java service that stores metadata in MongoDB", 25, 0.85, configurator);
Retrieve a stored Bindex by id through the repository contract.
Configurator configurator = ...;
BindexRepository repository = new MongoBindexRepository(configurator);
Bindex stored = repository.getBindex("org.example:library:1.0.0");
Class diagram
Intended usage
This module is intended for applications, build automation, and AI-assisted development workflows that need a searchable registry of project and library metadata. It is especially useful when components must be selected from descriptive requirements rather than exact coordinates, or when tool-calling agents need structured access to reusable project knowledge.
