{"id":23412916,"url":"https://github.com/httpjamesm/small-world-rs","last_synced_at":"2025-10-30T01:32:05.009Z","repository":{"id":266917526,"uuid":"899759587","full_name":"httpjamesm/small-world-rs","owner":"httpjamesm","description":"The easiest HNSW vector index you'll ever use.","archived":false,"fork":false,"pushed_at":"2024-12-09T06:44:40.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T08:38:32.099Z","etag":null,"topics":["ai","cosine-similarity","embeddings","euclidean-distances","hnsw","machine-learning","rust","simd","vectordb","vectors"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/httpjamesm.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-07T00:30:06.000Z","updated_at":"2024-12-08T01:48:08.000Z","dependencies_parsed_at":"2024-12-07T01:24:13.134Z","dependency_job_id":"72115877-6826-4d51-9524-c868814eb980","html_url":"https://github.com/httpjamesm/small-world-rs","commit_stats":null,"previous_names":["httpjamesm/small-world-rs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpjamesm%2Fsmall-world-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpjamesm%2Fsmall-world-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpjamesm%2Fsmall-world-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpjamesm%2Fsmall-world-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/httpjamesm","download_url":"https://codeload.github.com/httpjamesm/small-world-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238921036,"owners_count":19552678,"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":["ai","cosine-similarity","embeddings","euclidean-distances","hnsw","machine-learning","rust","simd","vectordb","vectors"],"created_at":"2024-12-22T18:26:56.946Z","updated_at":"2025-10-30T01:31:59.713Z","avatar_url":"https://github.com/httpjamesm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# small-world-rs\n\n\u003ca href=\"https://crates.io/crates/small-world-rs\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/small-world-rs.svg\" alt=\"crates.io\"\u003e\n\u003c/a\u003e\n\nsmall-world-rs is an HNSW vector index written in Rust.\n\n## Features\n\n- Fast, accurate and easy to implement\n- Choose your precision (16 or 32 bit floats)\n- Choose your distance metric\n  - Supports cosine distance (recommended for text) and euclidean distance (recommended for images)\n- Serialize and deserialize for persistence\n\n## Example\n\nSee the [text-embeddings example](./examples/text-embeddings/src/main.rs) for a simple example of how to use small-world-rs to perform semantic search over a set of text embeddings.\n\nBasically, it works like this:\n\n1. Get your embeddings, be that from OpenAI, Ollama, or wherever\n2. Create a `World` with `World::new` or `World::new_from_dump`\n3. Insert your vectors into the world with `world.insert_vector`\n4. Perform a search with `world.search`\n5. Dump the world with `world.dump` to save for later\n\n## What config values should I use?\n\nKey Parameters:\n\n- `m`: Connections per layer\n\n  - Recommended: 16-64\n  - Sweet spot: 32\n  - Higher values increase recall but consume more memory\n\n- `ef_construction`: Construction-time exploration factor\n\n  - Recommended: 100-500\n  - Trade-off: Higher values = better recall but slower build time\n  - Rule of thumb: 2-4× your target `ef_search`\n\n- `ef_search`: Query-time exploration factor\n\n  - Recommended: 50-150\n  - Adjustable at search time\n  - Higher values increase accuracy but slow down search\n  - Tune based on recall requirements\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttpjamesm%2Fsmall-world-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttpjamesm%2Fsmall-world-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttpjamesm%2Fsmall-world-rs/lists"}