{"id":18376601,"url":"https://github.com/barakmich/bbqvec","last_synced_at":"2025-06-11T19:07:24.664Z","repository":{"id":257792018,"uuid":"857036960","full_name":"barakmich/bbqvec","owner":"barakmich","description":"Scalable Embedded Vector Index for Go and Rust","archived":false,"fork":false,"pushed_at":"2024-10-31T18:19:37.000Z","size":464,"stargazers_count":36,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-16T17:05:17.016Z","etag":null,"topics":["aknn","ann","golang","knn","rust","similarity-search","vector","vector-database","vector-search"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/barakmich.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T17:14:58.000Z","updated_at":"2025-04-18T05:06:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"06de4207-964a-4001-8652-14545f11b6c7","html_url":"https://github.com/barakmich/bbqvec","commit_stats":null,"previous_names":["daxe-ai/bbqvec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/barakmich/bbqvec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakmich%2Fbbqvec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakmich%2Fbbqvec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakmich%2Fbbqvec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakmich%2Fbbqvec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barakmich","download_url":"https://codeload.github.com/barakmich/bbqvec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakmich%2Fbbqvec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259320478,"owners_count":22839992,"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":["aknn","ann","golang","knn","rust","similarity-search","vector","vector-database","vector-search"],"created_at":"2024-11-06T00:24:04.861Z","updated_at":"2025-06-11T19:07:24.658Z","avatar_url":"https://github.com/barakmich.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![BBQvec Logo](.github/bbqvec.png)\n\n![Status](https://img.shields.io/badge/status-beta-blue)\n[![license](https://img.shields.io/github/license/barakmich/bbqvec)](LICENSE)\n[![GoDoc](https://godoc.org/github.com/barakmich/bbqvec?status.svg)](https://godoc.org/github.com/barakmich/bbqvec)\n[![Crates.io](https://img.shields.io/crates/v/bbqvec)](https://crates.io/crates/bbqvec)\n[![Go CI](https://github.com/barakmich/bbqvec/actions/workflows/go.yml/badge.svg)](https://github.com/barakmich/bbqvec/actions/workflows/go.yml)\n[![Rust CI](https://github.com/barakmich/bbqvec/actions/workflows/rust.yml/badge.svg)](https://github.com/barakmich/bbqvec/actions/workflows/rust.yml)\n\nBBQvec is an open-source, embedded vector database index for Go and Rust, providing approximate K-nearest-neighbors (aKNN).\n\n# Getting Started\n\n## Go\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  bbq \"github.com/barakmich/bbqvec\"\n)\n\nfunc main() {\n  // Declare store parameters\n  dimensions := 200\n  nBasis := 10\n\n  // Initialize the store\n  backend := bbq.NewMemoryBackend(dimensions)\n  datastore, _ := bbq.NewVectorStore(backend, nBasis)\n\n  // Create some test data, 100K random vectors\n  vecs := bbq.NewRandVectorSet(100_000, dimensions, nil)\n  datastore.AddVectorsWithOffset(0, vecs)\n  /*\n  Equivalent to:\n  for i, v := range vecs {\n  datastore.AddVector(bbq.ID(i), v)\n  }\n  */\n\n  // Run a query\n  targetVec := bbq.NewRandVector(dimensions, nil)\n  results, _ := datastore.FindNearest(targetVec, 10, 1000, 1)\n\n  // Inspect the results\n  top := results.ToSlice()[0]\n  vec, _ := backend.GetVector(top.ID)\n  fmt.Println(top.ID, vec, top.Similarity)\n}\n```\n\n## Rust\n\n```rust\nuse bbqvec::IndexIDIterator;\n\nfn main() -\u003e Result\u003c()\u003e {\n  // Declare store parameters\n  let dimensions = 200;\n  let n_basis = 10;\n\n  // Initialize the store\n  let mem = bbqvec::MemoryBackend::new(dimensions, n_basis)?;\n  let mut store = bbqvec::VectorStore::new(mem)?;\n\n  // Create some test data, 100K random vectors\n  let vecs = bbqvec::create_vector_set(dimensions, 100000);\n  store.add_vector_iter(vecs.enumerate_ids())?;\n\n  // Run a query\n  let target = bbqvec::create_random_vector(dimensions);\n  let results = store.find_nearest(\u0026target, 10, 1000, 1)?;\n\n  // Inspect the results\n  for res in results.iter_results() {\n    println!(\"{} {}\", res.id, res.similarity)\n  }\n}\n\n```\n\n# TODOs\n\nWe're still early; Go is the more tried-and-true and suits the beta use-case, but Rust is a good deal faster. We welcome contributions.\n\n## Go\n- [ ] More benchmarks\n- [ ] New Quantizations\n  - [ ] Hamming Distance (single-bit vectors)\n  - [ ] Novel quantizations\n## Rust\n- [ ] Finish disk backend to match Go (in progress, shortly)\n- [ ] New Quantizations\n\n\n### Acknowledgements\nThank you to MariaLetta for the [free-gophers-pack](https://github.com/MariaLetta/free-gophers-pack) and to [rustacean.net](https://rustacean.net) for the CC0 logo characters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarakmich%2Fbbqvec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarakmich%2Fbbqvec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarakmich%2Fbbqvec/lists"}