{"id":19407626,"url":"https://github.com/greptimeteam/vsag-sys","last_synced_at":"2025-04-24T09:31:44.966Z","repository":{"id":261264998,"uuid":"876629337","full_name":"GreptimeTeam/vsag-sys","owner":"GreptimeTeam","description":"A Rust binding for the VSAG -- vector indexing and search library.","archived":false,"fork":false,"pushed_at":"2024-11-07T06:49:57.000Z","size":20,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T03:06:00.656Z","etag":null,"topics":["rust","rust-lang","vector","vector-index","vector-search","vector-search-engine"],"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/GreptimeTeam.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-10-22T09:45:35.000Z","updated_at":"2024-12-24T01:52:47.000Z","dependencies_parsed_at":"2024-11-05T16:41:40.153Z","dependency_job_id":"391f9cb0-6682-4868-864b-00e798dca571","html_url":"https://github.com/GreptimeTeam/vsag-sys","commit_stats":null,"previous_names":["greptimeteam/vsag-sys"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fvsag-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fvsag-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fvsag-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fvsag-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreptimeTeam","download_url":"https://codeload.github.com/GreptimeTeam/vsag-sys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250600715,"owners_count":21457017,"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":["rust","rust-lang","vector","vector-index","vector-search","vector-search-engine"],"created_at":"2024-11-10T12:03:15.454Z","updated_at":"2025-04-24T09:31:44.499Z","avatar_url":"https://github.com/GreptimeTeam.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VSAG Rust Binding\n\nA Rust binding for the [VSAG](https://github.com/alipay/vsag).\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nvsag-sys = \"0.0.1\"\n```\n\nTry the example:\n\n```rust\nuse vsag_sys::VsagIndex;\n\nlet index_type = \"hnsw\";\nlet con_params = r#\"{\n    \"dtype\": \"float32\",\n    \"metric_type\": \"l2\",\n    \"dim\": 128,\n    \"hnsw\": {\n        \"max_degree\": 16,\n        \"ef_construction\": 100\n    }\n}\"#;\nlet search_params = r#\"{\n    \"hnsw\": {\n    \"ef_search\": 100\n    }\n}\"#;\n\nlet index = VsagIndex::new(index_type, con_params).unwrap();\n\nlet ids: Vec\u003ci64\u003e = (0..num_vectors as i64).collect();\nlet vectors = (0..num_vectors)\n    .map(|_| {\n        (0..dim)\n            .map(|_| rand::random::\u003cf32\u003e())\n            .collect::\u003cVec\u003cf32\u003e\u003e()\n    })\n    .collect::\u003cVec\u003c_\u003e\u003e();\nlet vectors_for_index: Vec\u003cf32\u003e = vectors.iter().flat_map(|v| v.iter().copied()).collect();\n\nlet failed_ids = index\n    .build(num_vectors, dim, \u0026ids, \u0026vectors_for_index)\n    .unwrap();\nassert_eq!(failed_ids.len(), 0);\n\nlet query_vector: Vec\u003cf32\u003e = (0..dim).map(|_| rand::random()).collect();\nlet k = 10;\nlet output = index.knn_search(\u0026query_vector, k, search_params).unwrap();\nassert_eq!(output.ids.len(), k.min(num_vectors));\nassert_eq!(output.distances.len(), k.min(num_vectors));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreptimeteam%2Fvsag-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreptimeteam%2Fvsag-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreptimeteam%2Fvsag-sys/lists"}