Skip to content

scott-clare1/porridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Porridge 🥣

A simple in-memory vector store written in Rust, performing K-Nearest Neighbour search.

Getting Started

Build the server with Docker:

docker build -t porridge .

Now run the container:

docker run -p 5000:5000 porridge

Endpoints

  • /store - Post embeddings with the following schema:
[
  {
    "embedding": [
      0.1,
      0.1,
      0.1
    ],
    "text": "Example text."
  }
]
  • /search - Post a query payload and return k 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.

Configuration

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].

Clients

  • Python: in the works.

Roadmap:

  • Persistent storage options.
  • Approximate nearest neighbours.
  • More options for similarity metrics.
  • Python client.
  • Integration tests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published