Bindex Core 1.1.0-SNAPSHOT API

Bindex Core

Bindex Core (artifactId: 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 within the Machanism ecosystem.

What is a Bindex?

A Bindex is a JSON document (typically named bindex.json) that describes a software project or a reusable library. It provides a stable identity for the project, a set of classification facets used for semantic retrieval, and a dependency graph that allows results to be expanded transitively.

Typical contents

  • Identity: for example id, name, version.
  • Facets: domains, layers, languages, integrations used for search and selection.
  • Dependencies: links to other Bindexes, enabling transitive expansion.

Package overview

The public API is organized around two primary areas:

  • org.machanism.machai.bindex — MongoDB-backed persistence and semantic retrieval for org.machanism.machai.schema.Bindex metadata. Key responsibilities include registration, CRUD-style access, and vector-search-based retrieval that can expand results via dependencies.
  • org.machanism.machai.bindex.builder — project-layout-specific builders that generate org.machanism.machai.schema.Bindex by assembling project context and delegating generation to a configured org.machanism.machai.ai.manager.Genai provider.

Typical workflow

  1. Generate or update a local bindex.json from a detected project layout and representative files.
  2. Register the document in a MongoDB-backed registry for reuse and team sharing.
  3. Pick relevant libraries for a query using semantic retrieval, then expand dependencies.
  4. Assemble selected Bindexes into prompt-ready inputs for downstream GenAI workflows.

Key types

  • org.machanism.machai.bindex.BindexRepository: MongoDB persistence for stored Bindex documents.
  • org.machanism.machai.bindex.Picker: registers and semantically searches Bindexes; expands results via dependencies.
  • org.machanism.machai.bindex.ai.tools.BindexFunctionTools: tool surface for LLM-assisted operations on Bindex data.

Class diagram

Bindex Core class diagram

Usage examples

Pick libraries


Configurator config = ...;
Picker picker = new Picker("openai", null, config);

List<Bindex> selected = picker.pick("http client with oauth2 support");

Load a registered Bindex by id


Configurator config = ...;
BindexRepository repo = new BindexRepository(config);

Optional<Bindex> bindex = repo.findById("org.example:lib");

Operational notes

  • Source compatibility targets Java 8 (see maven.compiler.release).
  • The registry uses MongoDB; connection settings are provided via configuration and environment variables.
Packages
Package
Description
MongoDB-backed persistence and semantic retrieval for Bindex metadata.