Skip to main content

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

Project description

🍋 citrus.

open-source (distributed) vector database

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

results = citrus.query(
    index="example",
    documents=["What is it like to launch a startup"],
    k=1,
    include=["document", "metadata"]
)

print(results)

You can specify if you want the associated text document and metadata to be returned. By default, only the IDs are returned.

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

chat w/ replit ai podcast

pokedex search

Facing issues?

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

PS: citrus isn't fully 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.6.4.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

citrusdb-0.6.4-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for citrusdb-0.6.4.tar.gz
Algorithm Hash digest
SHA256 1219b3f113dd20a73b0a6c059e4a09c91cc40a54585163d7023ea7f692e3d019
MD5 77b7583aad950ae70777d15aac48d08f
BLAKE2b-256 380cef6df98c905a7e602e3a75ca1fb2a62fb7caf5da90d488696e32e590d012

See more details on using hashes here.

File details

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

File metadata

  • Download URL: citrusdb-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 24.7 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.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 93c46b0b844a488d9b0fef91a64eb90a9b5afaa8c2a4fc72eddad9055020c66d
MD5 76c4148d147bfdb5154d4530547581ff
BLAKE2b-256 f02dcc154aebcc586f266c70b6914c6901af07fa5e1589be9e3fe4702609bf90

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