Skip to main content

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

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

Metadata

Release files for citrusdb 0.6.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for citrusdb 0.6.9
File Size Uploaded
citrusdb-0.6.9.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for citrusdb 0.6.9
File Interpreter ABI Platform
citrusdb-0.6.9-py3-none-any.whl Python 3 none any Details

Total release size: 43.5 kB

Release files / citrusdb-0.6.9.tar.gz

Download URL citrusdb-0.6.9.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
07a109ae22dd3e1c06e008989bf7f8c041cf4ccb22d16823b5cebaeaa5d0919b
BLAKE2b-256 checksum
How to use checksums
cb7e8dbdb66d711a04e251520852a291b37059a8d91cae5fb43a721a96a7ce6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / citrusdb-0.6.9-py3-none-any.whl

Download URL citrusdb-0.6.9-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
837e0cf22dd543c9cc60e7f0fc7ffbf499cb492a8475508811875db52eb3f56c
BLAKE2b-256 checksum
How to use checksums
2d191122acfa7f3ae893cbeb6c890d3c50859e82914f11a7033909892bbc827b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.6.9 This release

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page