Skip to main content

open-source vector database. store and retrieve embeddings for your next project!

Project description

🍋 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!

3. Search

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 ;)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

citrusdb-0.5.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

citrusdb-0.5.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file citrusdb-0.5.0.tar.gz.

File metadata

  • Download URL: citrusdb-0.5.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for citrusdb-0.5.0.tar.gz
Algorithm Hash digest
SHA256 db23b7617874096369c23068f021af6dd81f37dba6b4bdc305e0736a42ccce4a
MD5 76bd2c4c8e060f4ceda6d60dc9a55be6
BLAKE2b-256 3bed97346f4ef9fbc10fd8538bcb13a8c7b81afe7ce1e73eb46853845b83bc86

See more details on using hashes here.

File details

Details for the file citrusdb-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: citrusdb-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for citrusdb-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c2ea8561145541a53eec23f20d6bb73aad61668e7990fa2033f52a266534f8e
MD5 73fdbbf7d02a63c990bb555f94657e7c
BLAKE2b-256 ab1f057ff240d3e246b6232c952ed1b673f7725ffda3f8cf8341c866e6ff3666

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page