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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file citrusdb-0.6.9.tar.gz
.
File metadata
- Download URL: citrusdb-0.6.9.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07a109ae22dd3e1c06e008989bf7f8c041cf4ccb22d16823b5cebaeaa5d0919b |
|
MD5 | 1090725f4cf20a877bf41f14474866a7 |
|
BLAKE2b-256 | cb7e8dbdb66d711a04e251520852a291b37059a8d91cae5fb43a721a96a7ce6b |
File details
Details for the file citrusdb-0.6.9-py3-none-any.whl
.
File metadata
- Download URL: citrusdb-0.6.9-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 837e0cf22dd543c9cc60e7f0fc7ffbf499cb492a8475508811875db52eb3f56c |
|
MD5 | 0cd39a696f67074c6130b1020d8c6a6f |
|
BLAKE2b-256 | 2d191122acfa7f3ae893cbeb6c890d3c50859e82914f11a7033909892bbc827b |