{"id":37150297,"url":"https://github.com/pilillo/apostasi","last_synced_at":"2026-01-14T17:44:53.742Z","repository":{"id":83297438,"uuid":"537734119","full_name":"pilillo/apostasi","owner":"pilillo","description":"so far yet so close","archived":false,"fork":false,"pushed_at":"2022-12-29T17:23:15.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T23:59:05.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/pilillo.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":"2022-09-17T07:34:39.000Z","updated_at":"2022-10-01T08:11:17.000Z","dependencies_parsed_at":"2023-03-12T17:54:22.893Z","dependency_job_id":null,"html_url":"https://github.com/pilillo/apostasi","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"5e676775983343244989f3010d2c157ba24cc5ba"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pilillo/apostasi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fapostasi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fapostasi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fapostasi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fapostasi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilillo","download_url":"https://codeload.github.com/pilillo/apostasi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fapostasi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T17:44:53.053Z","updated_at":"2026-01-14T17:44:53.733Z","avatar_url":"https://github.com/pilillo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌍​ Apostasi 🏺\n\nA collection of approximate nearest neighbor (k-NN) algorithms implemented in Go.\n\n## Algorithms\n\n### 🔥 HNSW (Hierarchical Navigable Small World)\n**Status**: ✅ \n\nA state-of-the-art graph-based algorithm for approximate nearest neighbor search. Features:\n- **Logarithmic search complexity**: O(log N) expected time\n- **Multi-layer graph structure**: Hierarchical search from coarse to fine\n- **High recall and precision**: Excellent accuracy vs speed trade-off\n- **Dynamic insertion**: Add vectors incrementally\n- **Configurable parameters**: Tune for your specific use case\n\n**Quick Start**:\n```go\n// Create index for 128D vectors\nindex := hnsw.NewHNSWIndex(128, 16, 0.5)\n\n// Insert vectors\nindex.Insert(vector1)\nindex.Insert(vector2)\n\n// Search for 10 nearest neighbors  \nresults, _ := index.Search(queryVector, 10)\n```\n\nSee [`hnsw/README.md`](hnsw/README.md) for detailed documentation and [`examples/hnsw_example.go`](examples/hnsw_example.go) for a complete example.\n\n### LSH (Locality Sensitive Hashing)\n**Status**: ✅ \n\nRandom-hyperplane hashing to bucketize vectors and explore nearby buckets.\n\n- See [`lsh/README.md`](lsh/README.md)\n- Example: [`examples/lsh_example.go`](examples/lsh_example.go)\n\n### Annoy (Approximate Nearest Neighbors Oh Yeah)\n**Status**: ✅ \n\nMultiple random-projection trees with best-first search.\n\n- See [`annoy/README.md`](annoy/README.md)\n\n## Unified Interface\nAll indices provide a consistent interface:\n\n- Insert(vector []float64) error\n- Search(query []float64, k int) ([]SearchResult, error)\n- GetStats() map[string]interface{}\n- GetNode(id) interface{}\n\nNotes:\n- All algorithms now support dynamic insertion\n- HNSW supports dynamic insertion with optimal performance\n- LSH assigns sequential IDs on insert\n- Annoy dynamically splits leaves when capacity exceeds k\n\n## Getting Started\n\n```bash\n# Clone the repository\ngit clone https://github.com/pilillo/apostasi.git\ncd apostasi\n\n# Run tests\ngo test ./...\n\n# Try the examples\ncd examples\n# HNSW example\ngo run hnsw_example.go\n# LSH example\ngo run lsh_example.go\n# Annoy example\ngo run annoy_example.go\n```\n\n## Performance Comparison\n\n| Algorithm | Search Time | Memory Usage | Accuracy | Dynamic Updates |\n|-----------|-------------|-------------|----------|-----------------|\n| **HNSW**  | O(log N)    | Medium      | High     | ✅ Yes          |\n| **LSH**   | ~O(1)       | Low         | Medium   | ✅ Yes          |\n| **Annoy** | O(log N)    | Low         | Medium   | ✅ Yes          |\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fapostasi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilillo%2Fapostasi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fapostasi/lists"}