Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Lightweight Nearest Neighbors with Flexible Backends
| Date | Stars |
|---|---|
| 2026-07-24 | 349 |
| 2026-07-25 | 349 |
| 2026-07-28 | 349 |
| 2026-07-30 | 349 |
| 2026-08-15 | 350 |
| 2026-08-31 | 351 |
| 2026-09-20 | 351 |
Today
— stars today
This week
— stars this week
This month
+1 stars this month
Momentum
0.0
growth rate 0.00%/day
<h2 align="center">
<img width="35%" alt="Vicinity logo" src="assets/images/vicinity_logo.png"><br/>
Lightweight Nearest Neighbors with Flexible Backends
</h2>
<div align="center">
<h2>
<a href="https://pypi.org/project/vicinity/"><img src="https://img.shields.io/pypi/v/vicinity?color=%23007ec6&label=pypi%20package" alt="Package version"></a>
<a href="https://minish.ai/packages/vicinity/introduction"><img src="https://img.shields.io/badge/docs-minish.ai-blue.svg" alt="Docs"></a>
<a href="https://pepy.tech/project/vicinity">
<img src="https://static.pepy.tech/badge/vicinity" alt="Downloads">
</a>
<a href="https://app.codecov.io/gh/MinishLab/vicinity">
<img src="https://codecov.io/gh/MinishLab/vicinity/graph/badge.svg?token=0MQ2945OZL" alt="Codecov">
</a>
<a href="https://discord.gg/4BDPR5nmtK">
<img src="https://img.shields.io/badge/Join-Discord-5865F2?logo=discord&logoColor=white" alt="Join Discord">
</a>
<a href="https://github.com/MinishLab/vicinity/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License - MIT">
</a>
</h2>
[Quickstart](#quickstart) •
[Main Features](#main-features) •
[Supported Backends](#supported-backends) •
[Installation](#installation)
</div>
Vicinity is a light-weight, low-dependency vector store. It provides a simple and intuitive interface for nearest neighbor search, with support for different backends and evaluation.
There are many nearest neighbors packages and methods out there. However, we found it difficult to compare them. Every package has its own interface, quirks, and limitations, and learning a new package can be time-consuming. In addition to that, how do you effectively evaluate different packages? How do you know which one is the best for your use case?
This is where Vicinity comes in. Instead of learning a new interface for each new package or backend, Vicinity provides a unified interface for all backends. This allows you to easily experiment with different indexing methods and distance metrics and choose the best one for your use case. Vicinity also provides a simple way to evaluate the performance of different backends, allowing you to measure the queries per second and recall.
## Quickstart
Install the package with:
```bash
pip install vicinity
```
Optionally, [install specific backends and integrations](#installation), or simply install all of them with:
```bash
pip install vicinity[all]
```
The following code snippet demonstrates how to use Vicinity for nearest neighbor search:
```python
import numpy as np
from vicinity import Vicinity, Backend, Metric
# Create some dummy data as strings or other serializable objects
items = ["triforce", "master sword", "hylian shield", "boomerang", "hookshot"]
vectors = np.random.rand(len(items), 128)
# Initialize the Vicinity instance (using the basic backend and cosine metric)
vicinity = Vicinity.from_vectors_and_items(
vectors=vectors,
items=items,
backend_type=Backend.BASIC,
metric=Metric.COSINE
)
# Create a query vector
query_vector = np.random.rand(128)
# Query for nearest neighbors with a top-k search
results = vicinity.query(query_vector, k=3)
# Query for nearest neighbors with a threshold search
results = vicinity.query_threshold(query_vector, threshold=0.9)
# Query with a list of query vectors
query_vectors = np.random.rand(5, 128)
results = vicinity.query(query_vectors, k=3)
```
Saving and loading a vector store:
```python
vicinity.save('my_vector_store')
vicinity = Vicinity.load('my_vector_store')
```
Pushing and loading a vector store from the Hugging Face Hub (note that you can optionally add the model used for generating embeddings to the metadata, e.g. `vicinity.metadata["model"] = "minishlab/potion-base-8M"`):
```python
vicinity.push_to_hub(repo_id='minishlab/my-vicinity-repo')
vicinity = Vicinity.load_from_hub(repo_id='minishlab/my-vicinity-repo')
```
Evaluating a backend:
```python
#Excerpt of 11,272 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e550d0183ea7a3e3, topic:vector-database, topic:faiss, topic:hnsw