Current section
Files
Jump to
Current section
Files
README.md
# Qdrant Elixir ClientAn Elixir client for the Qdrant vector similarity search engine. This library provides a convenient way to interact with the Qdrant API, offering functionality to create collections, insert vectors, search, delete data, and more.## InstallationIt's [available in Hex](https://hexdocs.pm/qdrant/readme.html), the package can be installedby adding `qdrant` to your list of dependencies in `mix.exs`:```elixirdef deps do [ {:qdrant, "~> 0.5.0"} # Or use the latest version from GitHub | Recommended during development phase {:qdrant, git: "git@github.com:marinac-dev/qdrant.git"}, ]end```## Config```elixirconfig :qdrant, port: 6333, interface: "rest", # gRPC not yet supported database_url: System.get_env("QDRANT_DATABASE_URL"), # If you are using cloud version of Qdrant, add API key api_key: System.get_env("QDRANT_API_KEY")```## UsageThe Qdrant Elixir Client provides a simple interface for interacting with the Qdrant API. For example, you can create a new collection, insert vectors, search, and delete data using the provided functions.```elixircollection_name = "my-collection"# Create a new collection# The vectors are 1536-dimensional (because of OpenAi embedding) and use the Cosine distance metricQdrant.create_collection(collection_name, %{vectors: %{size: 1536, distance: "Cosine"}})# Create embeddings for some textvector1 = OpenAi.embed_text("Hello world")vector2 = OpenAi.embed_text("This is OpenAI")# Now we can insert the vectors with batchQdrant.upsert_points(collection_name, %{batch: %{ids: [1,2], vectors: [vector1, vector2]}})# Or one by oneQdrant.upsert_point(collection_name, %{points: [%{id: 1, vector: vector1}, %{id: 2, vector: vector2}]})```## Contributing- Fork the repository- Create a branch for your changes- Make your changes- Run `mix format` to format your code## Change LogGenerate change log with `git-chglog -o CHANGELOG.md`## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details