0xDebabrata Citrus Save Abandoned

(distributed) vector database

Project README

🍋 citrus.

open-source (distributed) vector database

Special thanks to

DevKit

DevKit - The Essential Developer Toolkit
DSoC 2023

Installation

pip install citrusdb

Getting started

1. Create index

import citrusdb

# Initialize client
citrus = citrusdb.Client()

# Create index
citrus.create_index(
  name="example",
  max_elements=1000,            # increases dynamically as you insert more vectors
)

2. Insert elements

ids = [1, 2, 3]
documents = [
  "Your time is limited, so don't waste it living someone else's life",
  "I'd rather be optimistic and wrong than pessimistic and right.",
  "Running a start-up is like chewing glass and staring into the abyss."
]

citrus.add(index="example", ids=ids, documents=documents)

You can directly pass vector embeddings as well. If you're passing a list of strings like we have done here, ensure you have your OPENAI_API_KEY in the environment. By default we use OpenAI to to generate the embeddings. Please reach out if you're looking for support from a different provider!

result, distances = citrus.query(index="example", documents=["What is it like to launch a startup"], k=1)

Go launch a repl on Replit and see what result you get after running the query! result will contain the ids of the top k search hits.

Example

pokedex search

Facing issues?

Feel free to open issues on this repository! Discord server coming soon!

PS: citrus isn't distributed just yet. We're getting there though ;)

Open Source Agenda is not affiliated with "0xDebabrata Citrus" Project. README Source: 0xDebabrata/citrus

Open Source Agenda Badge

Open Source Agenda Rating