🍋 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
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| citrusdb-0.6.9.tar.gz | 18.7 kB | Without provenance | Details for citrusdb-0.6.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| citrusdb-0.6.9-py3-none-any.whl | Python 3 | none | any | Details for citrusdb-0.6.9-py3-none-any.whl |
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
|
Security for citrusdb 0.6.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.