Anodex

Elixir bindings for ANODE - a disk-resident approximate nearest neighbor (ANN) search system.

Features

Installation

Add anodex to your dependencies in mix.exs:

def deps do
  [
    {:anodex, "~> 0.1"}
  ]
end

Usage

# Create an index
opts = %Anodex.Options{
  dimension: 128,
  data_dir: "/var/lib/myapp/vectors",
  name: "embeddings",
  compaction_threshold: 100_000
}

{:ok, index} = Anodex.Manode.new(opts)

# Insert vectors
:ok = Anodex.Manode.insert(index, {1, embedding_vector})

# Search for nearest neighbors
{:ok, results} = Anodex.Manode.search(index, query_vector, 10)
# Returns [{distance, id}, ...]

# Shutdown (persists to disk)
:ok = Anodex.Manode.shutdown(index)

Requirements

Releasing

  1. Bump version in mix.exs:

    @version "0.2.0"
  2. Push to master — triggers precompiled NIF builds automatically.

  3. Wait for CI — the "Build Precompiled NIFs" workflow uploads artifacts to spiredb/anodex releases

  4. Download checksums and publish to Hex:

    mix rustler_precompiled.download Anodex.Native --all --print
    mix hex.publish

GitHub Actions Workflows

Workflow Trigger Purpose
CI Push/PR Runs Rust and Elixir tests
Build Precompiled NIFs Push to master (anodex/anode changes) Builds NIFs for x86_64-linux, uploads to spiredb/anodex
Publish to Hex.pm GitHub release or manual Downloads checksums, publishes to Hex

Manual triggers — all workflows support workflow_dispatch:

  1. Go to Actions tab
  2. Select workflow
  3. Click "Run workflow"

License

MIT