# ChromaDB: Embeddings and Vector Databases in Python

DevFeed: [ChromaDB: Embeddings and Vector Databases in Python](<https://devfeed.tech/articles/chromadb-embeddings-and-vector-databases-in-python-100528.md>)

Original publisher: [Read original article](<https://realpython.com/chromadb-vector-database/>)

Author: Harrison Hoffman

Published: 2026-10-26T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [vector embeddings in AI](<https://devfeed.tech/topics/vector-embeddings-in-ai.md>), [Vectors & LLMs](<https://devfeed.tech/topics/vectors-llms.md>), [Python](<https://devfeed.tech/topics/python.md>), [spaCy](<https://devfeed.tech/topics/spacy.md>), [ann](<https://devfeed.tech/topics/ann.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>), [pip](<https://devfeed.tech/topics/pip.md>)

Tags: [1-5](<https://devfeed.tech/tags/1-5.md>), [2017](<https://devfeed.tech/tags/2017.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [animation](<https://devfeed.tech/tags/animation.md>), [api](<https://devfeed.tech/tags/api.md>), [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [approximate-nearest-neighbor-search](<https://devfeed.tech/tags/approximate-nearest-neighbor-search.md>), [context](<https://devfeed.tech/tags/context.md>), [databases](<https://devfeed.tech/tags/databases.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [filter](<https://devfeed.tech/tags/filter.md>), [llm](<https://devfeed.tech/tags/llm.md>), [python](<https://devfeed.tech/tags/python.md>), [query](<https://devfeed.tech/tags/query.md>), [store](<https://devfeed.tech/tags/store.md>), [text](<https://devfeed.tech/tags/text.md>), [vector](<https://devfeed.tech/tags/vector.md>), [vector-databases](<https://devfeed.tech/tags/vector-databases.md>)

## AI overview

ChromaDB stores text embeddings and retrieves semantically similar records, with metadata filters to narrow results. The tutorial explains vectors, cosine similarity, and embeddings, then demonstrates ChromaDB 1.5 with Python 3.12+: a persistent client stores data on disk, while in-memory and server or cloud clients are also available. A collection uses an embedding function such as SentenceTransformers' all-MiniLM-L6-v2 model and an HNSW index configured for cosine distance; queries return ranked matches, where cosine distance equals one minus cosine similarity. Examples cover adding documents with IDs and metadata, querying several prompts, filtering by metadata, and updating, upserting, or deleting records. The RAG example retrieves car reviews as context for an OpenAI LLM. The text cautions that semantic matches may be irrelevant when the collection or embedding model is a poor fit. Its supplied excerpt ends while describing batched ingestion of a large review dataset.

## Source excerpt

Learn what embeddings and vector databases are, then store, query, and filter text with ChromaDB in Python and use it to give an LLM context.