ElixDb

Hex.pmHexDocsGitHub stars

Elixir vector database: collections, points (upsert/get/delete), exact k-NN (cosine, L2, dot product), optional DAZO index with HNSW-style multi-layer graph (Qdrant/Milvus-like) and IVF coarse quantizer, Nx batch re-rank, file persistence, and optional HTTP API.


Links


Installation

Add elix_db to your list of dependencies in mix.exs:

def deps do
  [
    {:elix_db, "~> 0.1.0"}
  ]
end

Then run mix deps.get.

Documentation: https://hexdocs.pm/elix_db.


Quick start

mix deps.get
mix test
iex -S mix
# Create collection (dim 3, cosine)
ElixDb.CollectionRegistry.create_collection(ElixDb.CollectionRegistry, "my_coll", 3, :cosine)

# Upsert and search
ElixDb.Store.upsert(ElixDb.Store, "my_coll", "p1", [1.0, 0.0, 0.0], %{})
{:ok, results} = ElixDb.Store.search(ElixDb.Store, "my_coll", [1.0, 0.0, 0.0], 5)

# Build DAZO index for faster search (HNSW 500–5k vectors, IVF ≥5k; Nx batch re-rank)
ElixDb.DazoIndex.build(ElixDb.DazoIndex, ElixDb.Store, "my_coll", registry: ElixDb.CollectionRegistry)
# Options: full_scan_threshold (500), coarse_threshold (5k), m, ef_construct, ef
# Force brute-force: Store.search(store, "my_coll", vector, k, brute_force: true)

See the project README for production status, HNSW/IVF details, HTTP API, benchmarks (script/full_bench.exs --dazo), and full docs.


License

MIT – see LICENSE.