This is a simple project to test Chroma DB on a local environment as part of Python app.
- Create a Python virtual environment
virtualenv env
source env/bin/activate
- Update Pip and install dependencies
pip install --upgrade pip
pip install --requirement requirements.txt
- Use the
write.py
script to write to the database stored locally in a file
python write.py
- Use the
read.py
script to make a query to the database
python read.py
Expected output:
{'ids': [['id1', 'id2']], 'distances': [[0.7111213785443223, 1.010977553098025]], 'metadatas': [[{'source': 'my_source'}, {'source': 'my_source'}]], 'embeddings': None, 'documents': [['This is a document', 'This is another document']]}