{"id":13619166,"url":"https://github.com/patterns-ai-core/qdrant-ruby","last_synced_at":"2025-05-01T14:33:51.262Z","repository":{"id":152069341,"uuid":"624549430","full_name":"patterns-ai-core/qdrant-ruby","owner":"patterns-ai-core","description":"Ruby wrapper for the Qdrant vector search database API","archived":false,"fork":false,"pushed_at":"2024-01-19T14:31:35.000Z","size":53,"stargazers_count":36,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-22T03:09:02.402Z","etag":null,"topics":["api-client","embedding-vectors","machine-learning","ml","qdrant","ruby","rubyml","vector-search","vector-search-engine"],"latest_commit_sha":null,"homepage":"https://rubydoc.info/gems/qdrant-ruby","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patterns-ai-core.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-06T18:08:15.000Z","updated_at":"2024-05-01T18:43:46.000Z","dependencies_parsed_at":"2024-01-07T10:50:53.668Z","dependency_job_id":"6b4581ef-3168-4c1a-8b3b-d39786be1c86","html_url":"https://github.com/patterns-ai-core/qdrant-ruby","commit_stats":null,"previous_names":["patterns-ai-core/qdrant-ruby","andreibondarev/qdrant-ruby"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patterns-ai-core%2Fqdrant-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patterns-ai-core%2Fqdrant-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patterns-ai-core%2Fqdrant-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patterns-ai-core%2Fqdrant-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patterns-ai-core","download_url":"https://codeload.github.com/patterns-ai-core/qdrant-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224262974,"owners_count":17282454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","embedding-vectors","machine-learning","ml","qdrant","ruby","rubyml","vector-search","vector-search-engine"],"created_at":"2024-08-01T21:00:35.663Z","updated_at":"2024-11-12T11:19:50.552Z","avatar_url":"https://github.com/patterns-ai-core.png","language":"Ruby","readme":"# Qdrant\n\n\u003cp\u003e\n    \u003cimg alt='Qdrant logo' src='https://qdrant.tech/images/logo_with_text.svg' height='50' /\u003e\n    \u0026nbsp;\u0026nbsp;+\u0026nbsp;\u0026nbsp;\n    \u003cimg alt='Ruby logo' src='https://user-images.githubusercontent.com/541665/230231593-43861278-4550-421d-a543-fd3553aac4f6.png' height='40' /\u003e\n\u003c/p\u003e\n\nRuby wrapper for the Qdrant vector search database API.\n\nPart of the [Langchain.rb](https://github.com/andreibondarev/langchainrb) stack.\n\n![Tests status](https://github.com/andreibondarev/qdrant-ruby/actions/workflows/ci.yml/badge.svg)\n[![Gem Version](https://badge.fury.io/rb/qdrant-ruby.svg)](https://badge.fury.io/rb/qdrant-ruby)\n[![Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/qdrant-ruby)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/andreibondarev/qdrant-ruby/blob/main/LICENSE.txt)\n[![](https://dcbadge.vercel.app/api/server/WDARp7J2n8?compact=true\u0026style=flat)](https://discord.gg/WDARp7J2n8)\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add qdrant-ruby\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install qdrant-ruby\n\n## Usage\n\n### Instantiating API client\n\n```ruby\nrequire 'qdrant'\n\nclient = Qdrant::Client.new(\n  url: ENV[\"QDRANT_URL\"],\n  api_key: ENV[\"QDRANT_API_KEY\"]\n)\n```\n\n### Collections\n\n```ruby\n# Get list name of all existing collections\nclient.collections.list\n\n# Get detailed information about specified existing collection\nclient.collections.get(collection_name: \"string\")\n\n# Create new collection with given parameters\nclient.collections.create(\n    collection_name: \"string\",     # required\n    vectors: {},                   # required\n    shard_number: nil,\n    replication_factor: nil,\n    write_consistency_factor: nil,\n    on_disk_payload: nil,\n    hnsw_config: nil,\n    wal_config: nil,\n    optimizers_config: nil,\n    init_from: nil,\n    quantization_config: nil\n)\n\n# Update parameters of the existing collection\nclient.collections.update(\n    collection_name: \"string\",    # required\n    optimizers_config: nil,\n    params: nil\n)\n\n# Drop collection and all associated data\nclient.collections.delete(collection_name: \"string\")\n\n# Get list of all aliases (for a collection)\nclient.collections.aliases(\n    collection_name: \"string\" # optional\n)\n\n# Update aliases of the collections\nclient.collections.update_aliases(\n    actions: [{\n        # `create_alias:`, `delete_alias` and/or `rename_alias` is required\n        create_alias: {\n            collection_name: \"string\", # required\n            alias_name: \"string\"       # required\n        }\n    }]\n)\n\n# Create index for field in collection\nclient.collections.create_index(\n    collection_name: \"string\", # required\n    field_name: \"string\",      # required\n    field_schema: \"string\",\n    wait: \"boolean\",\n    ordering: \"ordering\"\n)\n\n# Delete field index for collection\nclient.collections.delete_index(\n    collection_name: \"string\", # required\n    field_name: \"string\",      # required\n    wait: \"boolean\",\n    ordering: \"ordering\"\n)\n\n# Get cluster information for a collection\nclient.collections.cluster_info(\n    collection_name: \"test_collection\" # required\n)\n\n# Update collection cluster setup\nclient.collections.update_cluster(\n    collection_name: \"string\", # required\n    move_shard: {              # required\n        shard_id: \"int\",\n        to_peer_id: \"int\",\n        from_peer_id: \"int\"\n    },\n    timeout: \"int\"\n)\n\n# Create new snapshot for a collection\nclient.collections.create_snapshot(\n    collection_name: \"string\", # required\n)\n\n# Get list of snapshots for a collection\nclient.collections.list_snapshots(\n    collection_name: \"string\", # required\n)\n\n# Delete snapshot for a collection\nclient.collections.delete_snapshot(\n    collection_name: \"string\", # required\n    snapshot_name: \"string\"    # required\n)\n\n# Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created.\nclient.collections.restore_snapshot(\n    collection_name: \"string\", # required\n    filepath: \"string\",        # required\n    wait: \"boolean\",\n    priority: \"string\"\n)\n\n# Download specified snapshot from a collection as a file\nclient.collections.download_snapshot(\n    collection_name: \"string\",         # required\n    snapshot_name: \"string\",           # required\n    filepath: \"/dir/filename.snapshot\" #require \n)\n```\n\n### Points\n```ruby\n# Retrieve full information of single point by id\nclient.points.get(\n    collection_name: \"string\", # required\n    id: \"int/string\",          # required\n    consistency: \"int\"\n)\n\n# Retrieve full information of points by ids\nclient.points.get_all(\n    collection_name: \"string\", # required\n    ids: \"[int]\",              # required\n    with_payload: \"boolean\"\n    with_vector: \"boolean\"\n)\n\n# Lists all data objects in reverse order of creation. The data will be returned as an array of objects.\nclient.points.list(\n    collection_name: \"string\", # required\n    ids: \"[int/string]\",       # required\n    with_payload: nil,\n    with_vector: nil,\n    consistency: nil\n\n)\n\n# Get a single data object.\nclient.points.upsert(\n    collection_name: \"string\", # required\n    batch: {},                 # required\n    wait: \"boolean\",\n    ordering: \"string\"\n)\n\n# Delete points\nclient.points.delete(\n    collection_name: \"string\", # required\n    points: \"[int/string]\",    # either `points:` or `filter:` required\n    filter: {},\n    wait: \"boolean\",\n    ordering: \"string\"\n)\n\n# Set payload values for points\nclient.points.set_payload(\n    collection_name: \"string\", # required\n    payload: {                 # required\n        \"property name\" =\u003e \"value\" \n    },  \n    points: \"[int/string]\",    # `points:` or `filter:` are required\n    filter: {},\n    wait: \"boolean\",\n    ordering: \"string\"\n)\n\n# Replace full payload of points with new one\nclient.points.overwrite_payload(\n    collection_name: \"string\", # required\n    payload: {},               # required \n    wait: \"boolean\",\n    ordering: \"string\",\n    points: \"[int/string]\",\n    filter: {}\n)\n\n# Delete specified key payload for points\nclient.points.clear_payload_keys(\n    collection_name: \"string\", # required\n    keys: \"[string]\",          # required\n    points: \"[int/string]\",\n    filter: {},\n    wait: \"boolean\",\n    ordering: \"string\"\n)\n\n# Delete specified key payload for points\nclient.points.clear_payload(\n    collection_name: \"string\", # required\n    points: \"[int/string]\",    # required\n    wait: \"boolean\",\n    ordering: \"string\"\n)\n\n# Scroll request - paginate over all points which matches given filtering condition\nclient.points.scroll(\n    collection_name: \"string\", # required\n    limit: \"int\",\n    filter: {},\n    offset: \"string\",\n    with_payload: \"boolean\",\n    with_vector: \"boolean\",\n    consistency: \"int/string\"\n)\n\n# Retrieve closest points based on vector similarity and given filtering conditions\nclient.points.search(\n    collection_name: \"string\", # required\n    limit: \"int\",              # required\n    vector: \"[int]\",           # required\n    filter: {},\n    params: {},\n    offset: \"int\",\n    with_payload: \"boolean\",\n    with_vector: \"boolean\",\n    score_threshold: \"float\"\n)\n\n\n# Retrieve by batch the closest points based on vector similarity and given filtering conditions\nclient.points.batch_search(\n    collection_name: \"string\", # required\n    searches: [{}],            # required  \n    consistency: \"int/string\"\n)\n\n# Look for the points which are closer to stored positive examples and at the same time further to negative examples.\nclient.points.recommend(\n    collection_name: \"string\", # required\n    positive: \"[int/string]\",  # required; Arrray of point IDs\n    limit: \"int\",              # required\n    negative: \"[int/string]\",\n    filter: {},\n    params: {},\n    offset: \"int\",\n    with_payload: \"boolean\",\n    with_vector: \"boolean\",\n    score_threshold: \"float\"\n    using: \"string\",\n    lookup_from: {},\n)\n\n# Look for the points which are closer to stored positive examples and at the same time further to negative examples.\nclient.points.batch_recommend(\n    collection_name: \"string\", # required\n    searches: [{}],            # required\n    consistency: \"string\"\n)\n\n# Count points which matches given filtering condition\nclient.points.count(\n    collection_name: \"string\", # required\n    filter: {},\n    exact: \"boolean\"\n)\n```\n\n### Snapshots\n```ruby\n# Get list of snapshots of the whole storage\nclient.snapshots.list(\n    collection_name: \"string\" # optional\n)\n\n# Create new snapshot of the whole storage\nclient.snapshots.create(\n    collection_name: \"string\" # required\n)\n\n# Delete snapshot of the whole storage\nclient.snapshots.delete(\n    collection_name: \"string\", # required\n    snapshot_name: \"string\"    # required\n)\n\n# Download specified snapshot of the whole storage as a file\nclient.snapshots.download(\n    collection_name: \"string\", # required\n    snapshot_name: \"string\"    # required\n    filepath: \"~/Downloads/backup.txt\" # required\n)\n\n\n# Get the backup\nclient.backups.get(\n    backend: \"filesystem\",\n    id: \"my-first-backup\"\n)\n\n# Restore backup\nclient.backups.restore(\n    backend: \"filesystem\",\n    id: \"my-first-backup\"\n)\n\n# Check the backup restore status\nclient.backups.restore_status(\n    backend: \"filesystem\",\n    id: \"my-first-backup\"\n)\n```\n\n### Cluster\n```ruby\n# Get information about the current state and composition of the cluster\nclient.cluster.info\n\n# Tries to recover current peer Raft state.\nclient.cluster.recover\n\n# Tries to remove peer from the cluster. Will return an error if peer has shards on it.\nclient.cluster.remove_peer(\n    peer_id: \"int\",  # required\n    force: \"boolean\"\n)\n```\n\n### Service\n```ruby\n# Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics\nclient.telemetry(\n    anonymize: \"boolean\" # optional\n)\n\n# Collect metrics data including app info, collections info, cluster info and statistics\nclient.metrics(\n    anonymize: \"boolean\" # optional\n)\n\n# Get lock options. If write is locked, all write operations and collection creation are forbidden\nclient.locks\n\n# Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options\nclient.set_lock(\n    write: \"boolean\" # required\n    error_message: \"string\"\n)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/andreibondarev/qdrant.\n\n## License\n\nqdrant-ruby is licensed under the Apache License, Version 2.0. View a copy of the License file.\n\n","funding_links":[],"categories":["Open Source","Ruby"],"sub_categories":["API Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatterns-ai-core%2Fqdrant-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatterns-ai-core%2Fqdrant-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatterns-ai-core%2Fqdrant-ruby/lists"}