{"id":13513543,"url":"https://github.com/yoshoku/annoy-rb","last_synced_at":"2025-04-25T09:32:49.323Z","repository":{"id":56842449,"uuid":"285339311","full_name":"yoshoku/annoy-rb","owner":"yoshoku","description":"annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).","archived":false,"fork":false,"pushed_at":"2025-01-01T11:20:15.000Z","size":153,"stargazers_count":35,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T13:57:17.386Z","etag":null,"topics":["approximate-nearest-neighbor-search","gem","nearest-neighbor-search","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/annoy-rb","language":"C++","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/yoshoku.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-05T16:01:24.000Z","updated_at":"2025-02-06T14:27:16.000Z","dependencies_parsed_at":"2023-12-29T13:25:17.562Z","dependency_job_id":"ab90c471-6283-477e-aeb5-94e302d5e91a","html_url":"https://github.com/yoshoku/annoy-rb","commit_stats":{"total_commits":104,"total_committers":1,"mean_commits":104.0,"dds":0.0,"last_synced_commit":"093d46ea841a85659f75b65878aadb165b8db95d"},"previous_names":["yoshoku/annoy.rb"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoshoku%2Fannoy-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoshoku%2Fannoy-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoshoku%2Fannoy-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoshoku%2Fannoy-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoshoku","download_url":"https://codeload.github.com/yoshoku/annoy-rb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250790286,"owners_count":21487783,"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":["approximate-nearest-neighbor-search","gem","nearest-neighbor-search","ruby"],"created_at":"2024-08-01T05:00:30.674Z","updated_at":"2025-04-25T09:32:49.068Z","avatar_url":"https://github.com/yoshoku.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# annoy-rb\n\n[![Build Status](https://github.com/yoshoku/annoy-rb/workflows/build/badge.svg)](https://github.com/yoshoku/annoy-rb/actions?query=workflow%3Abuild)\n[![Gem Version](https://badge.fury.io/rb/annoy-rb.svg)](https://badge.fury.io/rb/annoy-rb)\n[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://github.com/yoshoku/annoy-rb/blob/main/LICENSE.txt)\n[![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/annoy-rb/doc/)\n\nannoy-rb provides Ruby bindings for the [Annoy (Approximate Nearest Neighbors Oh Yeah)](https://github.com/spotify/annoy).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'annoy-rb'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install annoy-rb\n\nNote: annoy-rb does not require the installation of another external library.\nIn addition, annoy-rb does not give any optimization options when building native extensions.\nIf necessary, add optimization options yourself during installation, as follows;\n\n```\n$ bundle config --local build.annoy-rb \"--with-cxxflags=-march=native\"\n$ bundle install\n```\n\nOr:\n\n```\n$ gem install annoy-rb -- --with-cxxflags=-march=native\n```\n\n## Documentation\n\n* [annoy-rb API Documentation](https://yoshoku.github.io/annoy-rb/doc/)\n\n## Usage\n\n```ruby\nrequire 'annoy'\n\nf = 40 # length of item vector that will be indexed.\nt = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular')\n\n1000.times do |i|\n  v = Array.new(f) { rand }\n  t.add_item(i, v)\nend\n\nt.build(10) # 10 trees.\nt.save('test.ann')\n\nu = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular')\nu.load('test.ann')\np u.get_nns_by_item(0, 100) # will find the 100 nearest neighbors.\n```\n\nWith the default argument, annoy-rb uses double precision floating point type for the data type of vector element.\nOn the other hand, the [Python bindings of Annoy](https://pypi.org/project/annoy/) use single precision floating point type.\nIf you want to load a search index created with the Python bindings, specify 'float32' to the dtype argument.\n\n```ruby\nrequire 'annoy'\n\nf = 40\nt = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular', dtype: 'float32')\nt.load('index_with_python_bindings.ann')\n```\n\n## License\n\nThe gem is available as open source under the terms of the [Apache-2.0 License](https://www.apache.org/licenses/LICENSE-2.0).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/annoy-rb.\nThis project is intended to be a safe, welcoming space for collaboration,\nand contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org) code of conduct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoshoku%2Fannoy-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoshoku%2Fannoy-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoshoku%2Fannoy-rb/lists"}