ChromaVectorStore#

pydantic model llama_index.vector_stores.ChromaVectorStore#

Chroma vector store.

In this vector store, embeddings are stored within a ChromaDB collection.

During query time, the index uses ChromaDB to query for the top k most similar nodes.

Parameters

chroma_collection (chromadb.api.models.Collection.Collection) – ChromaDB collection instance

Show JSON schema
{
   "title": "ChromaVectorStore",
   "description": "Chroma vector store.\n\nIn this vector store, embeddings are stored within a ChromaDB collection.\n\nDuring query time, the index uses ChromaDB to query for the top\nk most similar nodes.\n\nArgs:\n    chroma_collection (chromadb.api.models.Collection.Collection):\n        ChromaDB collection instance",
   "type": "object",
   "properties": {
      "stores_text": {
         "title": "Stores Text",
         "default": true,
         "type": "boolean"
      },
      "is_embedding_query": {
         "title": "Is Embedding Query",
         "default": true,
         "type": "boolean"
      },
      "flat_metadata": {
         "title": "Flat Metadata",
         "default": true,
         "type": "boolean"
      },
      "collection_name": {
         "title": "Collection Name",
         "type": "string"
      },
      "host": {
         "title": "Host",
         "type": "string"
      },
      "port": {
         "title": "Port",
         "type": "string"
      },
      "ssl": {
         "title": "Ssl",
         "type": "boolean"
      },
      "headers": {
         "title": "Headers",
         "type": "object",
         "additionalProperties": {
            "type": "string"
         }
      },
      "persist_dir": {
         "title": "Persist Dir",
         "type": "string"
      },
      "collection_kwargs": {
         "title": "Collection Kwargs",
         "type": "object"
      },
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "ChromaVectorStore"
      }
   },
   "required": [
      "ssl"
   ]
}

Config
  • schema_extra: function = <function BaseComponent.Config.schema_extra at 0x7ff1e41e53a0>

Fields
  • collection_kwargs (Dict[str, Any])

  • collection_name (Optional[str])

  • flat_metadata (bool)

  • headers (Optional[Dict[str, str]])

  • host (Optional[str])

  • persist_dir (Optional[str])

  • port (Optional[str])

  • ssl (bool)

  • stores_text (bool)

field collection_kwargs: Dict[str, Any] [Optional]#
field collection_name: Optional[str] = None#
field flat_metadata: bool = True#
field headers: Optional[Dict[str, str]] = None#
field host: Optional[str] = None#
field persist_dir: Optional[str] = None#
field port: Optional[str] = None#
field ssl: bool [Required]#
field stores_text: bool = True#
add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes to index.

Parameters

nodes – List[BaseNode]: list of nodes with embeddings

classmethod class_name() str#

Get the class name, used as a unique ID in serialization.

This provides a key that makes serialization robust against actual class name changes.

delete(ref_doc_id: str, **delete_kwargs: Any) None#

Delete nodes using with ref_doc_id.

Parameters

ref_doc_id (str) – The doc_id of the document to delete.

classmethod from_collection(collection: Any) ChromaVectorStore#
classmethod from_params(collection_name: str, host: Optional[str] = None, port: Optional[str] = None, ssl: bool = False, headers: Optional[Dict[str, str]] = None, persist_dir: Optional[str] = None, collection_kwargs: dict = {}, **kwargs: Any) ChromaVectorStore#
query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult#

Query index for top k most similar nodes.

Parameters
  • query_embedding (List[float]) – query embedding

  • similarity_top_k (int) – top k most similar nodes

property client: Any#

Return client.