# Chromadb

### Chromadb

This is the default database used when no vectordb is specified . We create a temp directory and persist the embeddings there using the PersistentClient of Chromadb by default.

This is for experimentation purposes when the user wants a quick headstart and wants to experiment with things quickly.

**Compulsory arguments:**

* class\_name => The name of the index under which documents are stored

Here are some sample configurations:

\=> Chromadb with embedding specification

```
"vectordb": {
    "name": "chromadb",
    "class_name": "genai_stack",
    "embedding": {
        "name": "HuggingFaceEmbeddings",
        "fields": {
            "model_name": "sentence-transformers/all-mpnet-base-v2",
            "model_kwargs": { "device": "cpu" }
        }
    }
}
```

\==> Chromadb without embedding specification. Without any embedding specification we use the default embedding which is HuggingFaceEmbeddings

```
"vectordb": {
    "name": "chromadb",
    "class_name": "genai_stack"
}
```

**Python Usage:**

```
from genai_stack.vectordb.chromadb import ChromaDB

config = {"class_name": "MyIndexName"}
vectordb = ChromaDB.from_kwargs(config)
vectordb.search("Your question")

# Output 
# <Documents closest to your question>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://genaistack.aiplanet.com/v0.1.0/components/vector-database/chromadb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
