A simple in-memory vector store written in Rust, performing K-Nearest Neighbour search.
Build the server with Docker:
docker build -t porridge .
Now run the container:
docker run -p 5000:5000 porridge
/store
- Post embeddings with the following schema:
[
{
"embedding": [
0.1,
0.1,
0.1
],
"text": "Example text."
}
]
/search
- Post a query payload and returnk
most similar embeddings. The payload should take the form of a single embedding entry, e.g.
{
"embedding": [
0.1,
0.1,
0.1
],
"text": "Example text."
}
Search returns a vector of UUID associated with the most similar entries.
/retrieve
- Entries to the database can be retrieved by UUID as parameter to the endpoint./heartbeat
- If the server is alive then hitting this endpoint will return:
{
"status": "I am alive."
}
/delete
- Entries in the database can be removed either by UUID as a parameter to the endpoint - or the whole dataset without a parameter.
Settings for the server can be configured with environment variables:
HOST
: The host for the server, e.g.,0.0.0.0
.PORT
: The port for the server, e.g.,5000
.SIMILARITY_METRIC
: The similarity metric used for search (currently only cosine similarity supported). Options: [cosine
].K_NEAREST_NEIGHBOURS
: The number of nearest neighbours to return, e.g.,5
.SEARCH_ALGORITHM
: The search algorithm to use to find nearest neighbours (currently only support brute-force search). Options: [brute
].
- Python: in the works.
- Persistent storage options.
- Approximate nearest neighbours.
- More options for similarity metrics.
- Python client.
- Integration tests.