Bindex Core 1.2.1-SNAPSHOT API
Bindex Core
Bindex Core provides core functionality for bindex metadata management, including generation, registration, library selection, and project assembly. It enables automated handling of library metadata to support efficient discovery, integration, and assembly 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 an
AI tool adapter package.
-
org.machanism.machai.bindex.coreprovides MongoDB-backed Bindex registration, persistence, retrieval, and semantic selection services. It stores serialized Bindex JSON together with searchable fields such as logical id, name, version, languages, domains, layers, integrations, and classification 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 source compatibility targets release
8. - MongoDB access can be configured with
BINDEX_REPO_URL,BINDEX_USER, andBINDEX_PASSWORD. - Embedding generation uses the configured
embedding.modelprovider. - Request classification uses
pick.modelwhen present, otherwise the gateway model configured bygw.model. - The default picker score can be supplied through
pick.scorefor tool-based recommendations. - 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.ai.tools.BindexFunctionToolsregisters Bindex-related operations as GenAI function tools.
Usage examples
Register a Bindex record with generated classification embeddings.
Configurator configurator = ...;
Picker picker = new Picker(configurator);
Bindex bindex = ...;
String recordId = picker.save(bindex);
Pick registered libraries for a natural-language requirement.
Configurator configurator = ...;
Picker picker = new Picker(configurator);
List<Bindex> matches = picker.pick("Java service that stores metadata in MongoDB", 250, 0.85, configurator);
Retrieve a stored Bindex by id through the repository contract.
Configurator configurator = ...;
BindexRepository repository = new MongoBindexRepository(700, 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.
