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.core provides MongoDB-backed Bindex registration, persistence, retrieval, and semantic selection services. Its BindexRepository contract separates storage from the Picker orchestration layer, while MongoBindexRepository stores serialized Bindex JSON together with searchable classification fields and 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 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.model provider and 700-dimensional vectors.
  • Request classification uses pick.model when present, otherwise the gateway model configured by gw.model.
  • Tool-based recommendations default to a score of 0.85 and a vector-search limit of 25.
  • 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.core.BindexInfo carries the identifier, version, description, and similarity score returned by searches.
  • 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 = ...; 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

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 the AI-facing integration layer for Bindex (bundle index) metadata.
Supplies persistence, semantic search, and recommendation services for Bindex metadata.