README.md

# Anodex

Elixir bindings for [ANODE](https://github.com/psila-ai/anode) - a disk-resident approximate nearest neighbor (ANN) search system.

## Features

- **Disk-resident**: Handles datasets larger than RAM
- **Lock-free concurrent operations**: High throughput for mixed read/write workloads
- **Automatic sharding**: Manode automatically partitions data across shards
- **Formal recall guarantees**: Staleness tracking with theoretical recall bounds

## Installation

Add `anodex` to your dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:anodex, "~> 0.1.0"}
  ]
end
```

## Usage

```elixir
# 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

- Elixir >= 1.14
- Rust toolchain (for NIF compilation)
- Linux with io_uring support (kernel 5.1+)

## License

MIT