import CodeBlock from "@theme/CodeBlock";

# Chroma

> [Chroma](https://docs.trychroma.com/getting-started) is a AI-native open-source vector database focused on developer productivity and happiness. Chroma is licensed under Apache 2.0.

<a href="https://discord.gg/MMeYNTmh3x" target="_blank">
  <img src="https://img.shields.io/discord/1073293645303795742" alt="Discord" />
</a>
&nbsp;&nbsp;
<a
  href="https://github.com/chroma-core/chroma/blob/master/LICENSE"
  target="_blank"
>
  <img
    src="https://img.shields.io/static/v1?label=license&message=Apache 2.0&color=white"
    alt="License"
  />
</a>
&nbsp;&nbsp;
<img
  src="https://github.com/chroma-core/chroma/actions/workflows/chroma-integration-test.yml/badge.svg?branch=main"
  alt="Integration Tests"
/>

- [Website](https://www.trychroma.com/)
- [Documentation](https://docs.trychroma.com/)
- [Twitter](https://twitter.com/trychroma)
- [Discord](https://discord.gg/MMeYNTmh3x)

## Setup

1. Run Chroma with Docker on your computer

```
git clone git@github.com:chroma-core/chroma.git
docker-compose up -d --build
```

2. Install the Chroma JS SDK.

```bash npm2yarn
npm install -S chromadb
```

Chroma is fully-typed, fully-tested and fully-documented.

Like any other database, you can:

- `.add`
- `.get`
- `.update`
- `.upsert`
- `.delete`
- `.peek`
- and `.query` runs the similarity search.

View full docs at [docs](https://docs.trychroma.com/js_reference/Collection).

## Usage, Index and query Documents

import FromDocs from "@examples/indexes/vector_stores/chroma/fromDocs.ts";

<CodeBlock language="typescript">{FromDocs}</CodeBlock>

## Usage, Index and query texts

import FromTexts from "@examples/indexes/vector_stores/chroma/fromTexts.ts";

<CodeBlock language="typescript">{FromTexts}</CodeBlock>

## Usage, Query docs from existing collection

import Search from "@examples/indexes/vector_stores/chroma/search.ts";

<CodeBlock language="typescript">{Search}</CodeBlock>

## Usage, delete docs

import Delete from "@examples/indexes/vector_stores/chroma/delete.ts";

<CodeBlock language="typescript">{Delete}</CodeBlock>
