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(
  max_elements=1000,            # increases dynamically as you insert more vectors
  persist_directory="db"       # save data and load index from disk
)

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(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("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

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.3.3.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

citrusdb-0.3.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for citrusdb-0.3.3.tar.gz
Algorithm Hash digest
SHA256 72cd6687e256b7a1efd01a50437178d80d9bca9637e899356fc13cc6181f0483
MD5 6762ee401331497123fdd13c9bccc171
BLAKE2b-256 e1e1fefe9ab781ce8b7fbbfbfbc5f351bc52dc3746a059f3b7db149e75b9de26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: citrusdb-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 15.8 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.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9ef30810f40519246bd8bc47a61af1f717476ec456cd82ea0b5a9f3206299d10
MD5 939fef30a45454c2bb92f3229aadfbfc
BLAKE2b-256 9017acd330ca2355cef61c1dc929b96b5e958922f25c74682a85d3fa923689de

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