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.core provides 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.tools exposes 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 the get_bindex, pick_libraries, register_bindex, and register_bindex_json tools for supported GenAI providers.

Typical workflow

  1. Create or update a bindex.json document that describes a reusable project or library.
  2. Register the document with a Picker or the registration function tools.
  3. Persist the serialized Bindex, searchable metadata, and classification embedding in MongoDB.
  4. Submit a natural-language request describing required capabilities, stack, or integrations.
  5. Classify the request with the configured GenAI provider and generate an embedding for the classification.
  6. Search registered Bindex records with vector similarity and metadata filters such as language and layer.
  7. 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, and BINDEX_PASSWORD.
  • Embedding generation uses the configured embedding.model provider.
  • Request classification uses pick.model when present, otherwise the gateway model configured by gw.model.
  • The default picker score can be supplied through pick.score for tool-based recommendations.
  • The module depends on generated schema classes in org.machanism.machai.schema for Bindex and classification structures.

Main types

  • org.machanism.machai.bindex.core.BindexRepository defines the storage and search contract for Bindex metadata.
  • org.machanism.machai.bindex.core.MongoBindexRepository implements MongoDB-backed storage and vector-search result loading.
  • org.machanism.machai.bindex.core.Picker orchestrates Bindex registration, prompt classification, embedding generation, search, and lookup.
  • org.machanism.machai.bindex.ai.tools.BindexFunctionTools registers 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

Bindex Core 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.

Packages
Package
Description
Provides AI-facing tool implementations for discovering, retrieving, filtering, and registering Bindex metadata.
Provides MongoDB-backed Bindex registration, persistence, retrieval, and semantic selection services.