## 1. Project Overview & Quickstart (chroma-core/chroma)

## File: README.md

```bash
pip install chromadb # python client
# for javascript, npm install chromadb!
# for client-server mode, chroma run --path /chroma_db_path
```

## Chroma Cloud

Our hosted service, Chroma Cloud, powers serverless vector, hybrid, and full-text search. It's extremely fast, cost-effective, scalable and painless. Create a DB and try it out in under 30 seconds with $5 of free credits.

[Get started with Chroma Cloud](https://trychroma.com/signup)

## API

The core API is only 4 functions (run our [💡 Google Colab](https://colab.research.google.com/drive/1QEzFyqnoFxq7LUGyP1vzR4iLt9PpCDXv?usp=sharing)):

```python
import chromadb
# setup Chroma in-memory, for easy prototyping. Can add persistence easily!
client = chromadb.Client()

# Create collection. get_collection, get_or_create_collection, delete_collection also available!
collection = client.create_collection("all-my-documents")

# Add docs to the collection. Can also update and delete. Row-based API coming soon!
collection.add(
    documents=["This is document1", "This is document2"], # we handle tokenization, embedding, and indexing automatically. You can skip that and add your own embeddings as well
    metadatas=[{"source": "notion"}, {"source": "google-docs"}], # filter on these!
    ids=["doc1", "doc2"], # unique for each doc
)

# Query/search 2 most similar results. You can also .get by id
results = collection.query(
    query_texts=["This is a query document"],
    n_results=2,
    # where={"metadata_field": "is_equal_to_this"}, # optional filter
    # where_document={"$contains":"search_string"}  # optional filter
)
```

Learn about all features on our [Docs](https://docs.trychroma.com)

## Get involved

Chroma is a rapidly developing project. We welcome PR contributors and ideas for how to improve the project.
- [Join the conversation on Discord](https://discord.com/invite/chromadb) - `#contributing` channel
- [Review the 🛣️ Roadmap and contribute your ideas](https://docs.trychroma.com/docs/overview/oss#roadmap)
- [Grab an issue and open a PR](https://github.com/chroma-core/chroma/issues) - [`Good first issue tag`](https://github.com/chroma-core/chroma/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
- [Read our contributing guide](https://docs.trychroma.com/docs/overview/oss#contributing)

**Release Cadence**
We currently release new tagged versions of the `pypi` and `npm` packages on Mondays. Hotfixes go out at any time during the week.

## License

[Apache 2.0](./LICENSE)

---

## File: chromadb/telemetry/README.md

# Telemetry

This directory holds all the telemetry for Chroma.

- `product/` contains anonymized product telemetry which we, Chroma, collect so we can
  understand usage patterns. For more information, see https://docs.trychroma.com/telemetry.
- `opentelemetry/` contains all of the config for Chroma's [OpenTelemetry](https://opentelemetry.io/docs/instrumentation/python/getting-started/)
  setup. These metrics are *not* sent back to Chroma -- anyone operating a Chroma instance
  can use the OpenTelemetry metrics and traces to understand how their instance of Chroma
  is behaving.

---

## File: chromadb/utils/embedding_functions/schemas/README.md

# Embedding Function Schemas

This directory contains JSON schemas for all embedding functions in Chroma. The purpose of having this schema is to support cross language compatibility, and to validate that changes in one client library do not accidentally diverge from others.

## Schema Structure

Each schema follows the JSON Schema Draft-07 specification and includes:

- `version`: The version of the schema
- `title`: The title of the schema
- `description`: A description of the schema
- `properties`: The properties that can be configured for the embedding function
- `required`: The properties that are required for the embedding function
- `additionalProperties`: Whether additional properties are allowed (always set to `false` to ensure strict validation)

## Usage

The schemas can be used to validate the configuration of embedding functions using the `validate_config` function:

```python
from chromadb.utils.embedding_functions.schemas import validate_config

# Validate a configuration
config = {
    "api_key_env_var": "CHROMA_OPENAI_API_KEY",
    "model_name": "text-embedding-ada-002"
}
validate_config(config, "openai")
```

## Adding New Schemas

To add a new schema:

1. Create a new JSON file in this directory with the name of the embedding function (e.g., `new_function.json`)
2. Define the schema following the JSON Schema Draft-07 specification
3. Update the embedding function to use the schema for validation

## Schema Versioning

Each schema includes a version number to support future changes to embedding function configurations. When making changes to a schema, increment the version number to ensure backward compatibility.

---

## File: clients/python/README.md

```bash
pip install chromadb-client # python http-client only library
```

To connect to your server and perform operations using the client only library, you can do the following:

```python
import chromadb
# Example setup of the client to connect to your chroma server
client = chromadb.HttpClient(host="localhost", port=8000)

collection = client.create_collection("all-my-documents")

collection.add(
    documents=["This is document1", "This is document2"],
    metadatas=[{"source": "notion"}, {"source": "google-docs"}], # filter on these!
    ids=["doc1", "doc2"], # unique for each doc
    embeddings = [[1.2, 2.1, ...], [1.2, 2.1, ...]]
)

results = collection.query(
    query_texts=["This is a query document"],
    n_results=2,
    # where={"metadata_field": "is_equal_to_this"}, # optional filter
    # where_document={"$contains":"search_string"}  # optional filter
)
```
## License

[Apache 2.0](./LICENSE)

---

## File: clients/js/examples/node/README.md

# Node Example

This is an example of how to use ChromaDB with Node.js.

## Getting Started

1. Make sure you have Chroma running locally at `http://localhost:8000`
2. Run `pnpm install` to install dependencies
3. Run one of the following commands:

- `pnpm dev` - Run the example with the default bundled package
- `pnpm dev:bundled` - Run the example with the bundled chromadb package
- `pnpm dev:client` - Run the example with the chromadb-client package (peer dependencies)

## Package Options

This example demonstrates both ChromaDB package options:

1. **chromadb** (Bundled Package): Includes all embedding libraries as dependencies.

   - Good for simple projects or when you want everything included.
   - Import with: `const chroma = require("chromadb");`

2. **chromadb-client** (Client Package): Uses peer dependencies.
   - Good for projects that already use specific versions of embedding libraries.
   - Keeps your dependency tree lean if you only need specific embedding libraries.
   - Import with: `const chroma = require("chromadb-client");`

Both packages provide identical functionality and API.

---

## File: clients/js/examples/README.md

# ChromaDB Examples

This directory contains examples for using both ChromaDB package options:

1. `chromadb`: Bundled package with all dependencies included
2. `chromadb-client`: Package with peer dependencies that you install separately

## Node.js Example

The Node.js example demonstrates how to use ChromaDB in a Node.js environment.

```bash
cd node
pnpm install

# Run with the default bundled package
pnpm dev

# Run with the bundled package explicitly
pnpm dev:bundled

# Run with the client package (peer dependencies)
pnpm dev:client
```

## Browser Example

The browser example demonstrates how to use ChromaDB in a browser environment.

```bash
cd browser
pnpm install

# Run with the default bundled package
pnpm dev

# Run with the bundled package explicitly
pnpm dev:bundled

# Run with the client package (peer dependencies)
pnpm dev:client
```

## Differences Between Package Options

- The **bundled package** (`chromadb`) includes all embedding libraries as dependencies, making it easier to get started.
- The **client package** (`chromadb-client`) uses peer dependencies, giving you more control over which versions of embedding libraries you use. It also keeps your dependency tree leaner if you only need specific embedding libraries.

Both packages offer identical functionality and API.

---

## File: clients/js/packages/chromadb-core/src/generated/README.md

## API

This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

Environment

- Node.js
- Webpack
- Browserify

Language level

- ES5 - you must have a Promises/A+ library installed
- ES6

Module system

- CommonJS
- ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))

### Building

To build an compile the typescript sources to javascript use:

```
npm install
npm run build
```

### Publishing

First build the package then run `npm publish`

### Consuming

Navigate to the folder of your consuming project and run one of the following commands:

```shell
npm install PATH_TO_GENERATED_PACKAGE --save
```

---

## File: clients/js/packages/chromadb-client/README.md

# ChromaDB Client

Chroma is the open-source data infrastructure for AI. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.

**Note:** JS client version 3._ is only compatible with chromadb v1.0.6 and newer or Chroma Cloud. For prior version compatiblity, please use JS client version 2._.

**This package provides embedding libraries as peer dependencies**, allowing you to manage your own versions of embedding libraries and keep your dependency tree lean by not bundling dependencies you don't use. For a thick client with bundled embedding functions, install `chromadb`.

## Features

- ✅ Complete TypeScript support
- ✅ Embedding libraries as peer dependencies for a smaller package size
- ✅ Works in both Node.js and browser environments
- ✅ Only install the embedding libraries you need

## Installation

```bash
# npm
npm install chromadb-client

# pnpm
pnpm add chromadb-client

# yarn
yarn add chromadb-client
```

You'll need to install any required embedding libraries separately. For example:

```bash
# For OpenAI embeddings
npm install chromadb-client openai

# For default embeddings
npm install chromadb-client chromadb-default-embed

# For Cohere embeddings
npm install chromadb-client cohere-ai
```

## Getting Started

Chroma needs to be running in order for this client to talk to it. Please see the [Usage Guide](https://docs.trychroma.com/guides) to learn how to quickly stand this up.

```js
import { ChromaClient } from "chromadb-client";

// Initialize the client
const chroma = new ChromaClient({ path: "http://localhost:8000" });

// Create a collection
const collection = await chroma.createCollection({ name: "my-collection" });

// Add documents to the collection
await collection.add({
  ids: ["id1", "id2"],
  embeddings: [
    [1.1, 2.3, 3.2],
    [4.5, 6.9, 4.4],
  ],
  metadatas: [{ source: "doc1" }, { source: "doc2" }],
  documents: ["Document 1 content", "Document 2 content"],
});

// Query the collection
const results = await collection.query({
  queryEmbeddings: [1.1, 2.3, 3.2],
  nResults: 2,
});
```

## Using Embedding Functions

Make sure to install the necessary peer dependencies before using embedding functions:

```js
// First install: npm install chromadb-client openai
import { ChromaClient, OpenAIEmbeddingFunction } from "chromadb-client";

const embedder = new OpenAIEmbeddingFunction({
  openai_api_key: "your-api-key",
  model_name: "text-embedding-ada-002",
});

const chroma = new ChromaClient({ path: "http://localhost:8000" });
const collection = await chroma.createCollection({
  name: "my-collection",
  embeddingFunction: embedder,
});

// Now you can add documents without providing embeddings
await collection.add({
  ids: ["id1"],
  documents: ["Document content"],
});

// And query with text
const results = await collection.query({
  queryTexts: ["similar document"],
  nResults: 2,
});
```

## Available Embedding Functions

This package supports multiple embedding providers as peer dependencies:

- OpenAI (`openai`)
- Cohere (`cohere-ai`)
- Default embeddings (`chromadb-default-embed`)
- Google Generative AI (`@google/generative-ai`)
- Xenova Transformers (`@xenova/transformers`)
- Voyage AI (`voyageai`)
- Ollama (`ollama`)

## Why choose chromadb-client?

- **Smaller package size**: Only install the dependencies you need
- **Flexible dependency versions**: Manage your own versions of embedding libraries
- **Less bloat**: Ideal for production environments where you only use specific embedding providers
- **Same functionality**: Provides identical features as the main `chromadb` package

## Additional Resources

- [📖 Documentation](https://docs.trychroma.com/)
- [💬 Community Discord](https://discord.gg/MMeYNTmh3x)
- [🏠 Homepage](https://www.trychroma.com/)
- [GitHub Repository](https://github.com/chroma-core/chroma)

## License

Apache 2.0

---

## File: clients/js/packages/chromadb/README.md

# ChromaDB JavaScript Client

Chroma is the open-source data infrastructure for AI. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.

**This package includes all embedding libraries as bundled dependencies**, providing a simple installation experience without worrying about dependency management. For a thin client, install `chromadb-client`

## Features

- ✅ Complete TypeScript support
- ✅ All embedding libraries included as bundled dependencies
- ✅ Works in both Node.js and browser environments
- ✅ Simple installation with no peer dependency requirements

## Installation

```bash
# npm
npm install chromadb

# pnpm
pnpm add chromadb

# yarn
yarn add chromadb
```

## Getting Started

Chroma needs to be running in order for this client to talk to it. Please see the [Usage Guide](https://docs.trychroma.com/guides) to learn how to quickly stand this up.

```js
import { ChromaClient } from "chromadb";

// Initialize the client
const chroma = new ChromaClient({ path: "http://localhost:8000" });

// Create a collection
const collection = await chroma.createCollection({ name: "my-collection" });

// Add documents to the collection
await collection.add({
  ids: ["id1", "id2"],
  embeddings: [
    [1.1, 2.3, 3.2],
    [4.5, 6.9, 4.4],
  ],
  metadatas: [{ source: "doc1" }, { source: "doc2" }],
  documents: ["Document 1 content", "Document 2 content"],
});

// Query the collection
const results = await collection.query({
  queryEmbeddings: [1.1, 2.3, 3.2],
  nResults: 2,
});
```

## Using Embedding Functions

This package includes all embedding libraries as bundled dependencies, so you can use them directly:

```js
import { ChromaClient, OpenAIEmbeddingFunction } from "chromadb";

const embedder = new OpenAIEmbeddingFunction({
  openai_api_key: "your-api-key",
  model_name: "text-embedding-ada-002",
});

const chroma = new ChromaClient({ path: "http://localhost:8000" });
const collection = await chroma.createCollection({
  name: "my-collection",
  embeddingFunction: embedder,
});

// Now you can add documents without providing embeddings
await collection.add({
  ids: ["id1"],
  documents: ["Document content"],
});

// And query with text
const results = await collection.query({
  queryTexts: ["similar document"],
  nResults: 2,
});
```

## Additional Resources

- [📖 Documentation](https://docs.trychroma.com/)
- [💬 Community Discord](https://discord.gg/MMeYNTmh3x)
- [🏠 Homepage](https://www.trychroma.com/)
- [GitHub Repository](https://github.com/chroma-core/chroma)

## License

Apache 2.0

---

## File: clients/js/README.md

## chromadb

Chroma is the open-source data infrastructure for AI. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.

This package gives you a JS/TS interface to talk to a backend Chroma DB over REST.

**Note:** JS client version 3._ is only compatible with chromadb v1.0.6 and newer or Chroma Cloud. For prior version compatibility, please use JS client version 2._.

[Learn more about Chroma](https://github.com/chroma-core/chroma)

- [💬 Community Discord](https://discord.gg/MMeYNTmh3x)
- [📖 Documentation](https://docs.trychroma.com/)
- [💡 Colab Example](https://colab.research.google.com/drive/1QEzFyqnoFxq7LUGyP1vzR4iLt9PpCDXv?usp=sharing)
- [🏠 Homepage](https://www.trychroma.com/)

## Package Options

There are two packages available for using ChromaDB in your JavaScript/TypeScript projects:

1. **chromadb**: Includes all embedding libraries as bundled dependencies.

   - Use this if you want a simple installation without worrying about dependency management.
   - Install with: `npm install chromadb` or `pnpm add chromadb`

2. **chromadb-client**: Provides embedding libraries as peer dependencies.
   - Use this if you want to manage your own versions of embedding libraries, or embed outside of Chroma.
   - Keeps your dependency tree lean by not bundling dependencies you don't use.
   - Install with: `npm install chromadb-client` or `pnpm add chromadb-client`
   - You'll need to install any required embedding libraries separately, e.g., `npm install chromadb-client chromadb-default-embed`

Both packages provide identical functionality, differing only in how dependencies are managed.

## Getting started

Chroma needs to be running in order for this client to talk to it. Please see the [🧪 Usage Guide](https://docs.trychroma.com/guides) to learn how to quickly stand this up.

## Small example

```js
import { ChromaClient } from "chromadb"; // or "chromadb-client"
const chroma = new ChromaClient({ path: "http://localhost:8000" });
const collection = await chroma.createCollection({ name: "test-from-js" });
for (let i = 0; i < 20; i++) {
  await collection.add({
    ids: ["test-id-" + i.toString()],
    embeddings: [1, 2, 3, 4, 5],
    documents: ["test"],
  });
}
const queryData = await collection.query({
  queryEmbeddings: [1, 2, 3, 4, 5],
  queryTexts: ["test"],
});
```

## Local development

[View the Development Readme](./DEVELOP.md)

## License

Apache 2.0

## 2. Official Technical Reference & Guides (chroma-core/docs)

## File: README.md

# Deprecated

The docs are now in a monorepo with the rest of the codebase. 

Read the new readme here: 

https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com


***

# Chroma docs

These docs are built using [Docusaurus 2](https://docusaurus.io/)

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Generating Python Docs

1. Have chroma as a sibling to the the docs dir, eg 
```
/docs
/chroma
```

2. Update `pydoc-markdown.yml` if you need to expose more files other than Collection and Client

3. Run `yarn gen-python`

### Deployment

Vercel handles deploying main to https://docs.trychroma.com

### Generating Javascript Docs

1. Have chroma as a sibling to the the docs dir, eg 
```
/docs
/chroma
```

2. Update `scripts/jsDocs.sh`, `sidebar.json` if you need to expose more files other than Collection and Client

3. Run `yarn gen-js`

---

## File: docs/intro.md

---
sidebar_position: 0
slug: /
title: 🏡 Home
hide_title: true
---

# Chroma

**Chroma is the open-source embedding database**. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.

[](https://discord.gg/MMeYNTmh3x)
[](https://GitHub.com/chroma-core/chroma/stargazers/)






Chroma gives you the tools to:

- store embeddings and their metadata
- embed documents and queries
- search embeddings

Chroma prioritizes:

- simplicity and developer productivity
- analysis on top of search
- it also happens to be very quick

Chroma consists of a `Python` client SDK, `JavaScript/TypeScript` client SDK and a server application. Check out the [Colab demo](https://colab.research.google.com/drive/1QEzFyqnoFxq7LUGyP1vzR4iLt9PpCDXv?usp=sharing).(yes, it can run in a notebook 😄)

Chroma is licensed under [Apache 2.0](https://github.com/chroma-core/chroma/blob/main/LICENSE)

### Python
In Python, Chroma can run `in-memory` or in `client/server` (in alpha) mode.
```bash
pip install chromadb
```

### JavaScript
In JavaScript, Chroma runs in `client/server` mode and talks to a Python backend.
```bash
npm install --save chromadb # yarn add chromadb
```


Continue with the full [getting started guide](./getting-started.md).

[🔑 Getting started](./getting-started.md)
[🧪 Usage Guide](./usage-guide.md)
[🧬 Embeddings](./embeddings.md)
[📄 API Reference](./api-reference.md)
[👽 About](./about.md)

[💬 Join Community Discord](https://discord.gg/MMeYNTmh3x) 
[@trychroma](https://twitter.com/trychroma) 


***

### Language Support



|              | in-memory | client |
|--------------|-----------|---------------|
| Python       | ✅        | ✅ (by Chroma)           |
| Javascript   | ➖        | ✅ (by Chroma)          |
| Ruby   | ➖        | ✅ [from @mariochavez](https://github.com/mariochavez/chroma)           |
| Java | ➖  | ✅ [from @t_azarov](https://github.com/amikos-tech/chromadb-java-client) |
| Go | ➖  | ✅ [from @t_azarov](https://github.com/amikos-tech/chroma-go) |
| C#   | ➖        | ✅ [from @microsoft](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.Memory.Chroma)       |
| Rust | ➖ | ✅ [from @Anush008](https://crates.io/crates/chromadb) |
| Elixir | ➖ | ✅ [from @3zcurdia](https://hex.pm/packages/chroma/) |
| Dart | ➖ | ✅ [from @davidmigloz](https://pub.dev/packages/chromadb) |
| PHP | ➖ | ✅ [from @CodeWithKyrian](https://github.com/CodeWithKyrian/chromadb-php) |
| PHP (Laravel) | ➖ | ✅ [from @HelgeSverre](https://github.com/helgeSverre/chromadb)                                                            |
| Other?       | ❓    | ❓            |



We welcome contributions for other languages! 

Learn more on the [Community Discord](https://discord.gg/MMeYNTmh3x).

---

## File: docs/getting-started.md

---
sidebar_position: 2
title: "🔑 Getting Started"
---

# 🔑 Getting started

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Select a language

<Tabs queryString groupId="lang" queryString>
<TabItem value="py" label="Python"></TabItem>
<TabItem value="js" label="JavaScript"></TabItem>
</Tabs>

---

Chroma is a database for building AI applications with embeddings. It comes with everything you need to get started built in, and runs on your machine. A [hosted version](https://airtable.com/shrOAiDUtS2ILy5vZ) is coming soon!

### 1. Install

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

```py
pip install chromadb
```

</TabItem>
<TabItem value="js" label="JavaScript">

```sh
npm install --save chromadb # yarn add chromadb
```

You will need to install the Chroma python package to use the Chroma CLI and backend server.

```sh
pip install chromadb
```

Alternatively, you can use a Docker container to run the Chroma backend server.

</TabItem>

</Tabs>

### 2. Get the Chroma Client

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

```python
import chromadb
chroma_client = chromadb.Client()
```

</TabItem>
<TabItem value="js" label="JavaScript">

Start the Chroma backend server:

```sh
chroma run --path /db_path
```

Then create a client which connects to it:

```js
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'

const client = new ChromaClient();
```

</TabItem>

</Tabs>

### 3. Create a collection

Collections are where you'll store your embeddings, documents, and any additional metadata. You can create a collection with a name:

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

```python
collection = chroma_client.create_collection(name="my_collection")
```

</TabItem>
<TabItem value="js" label="JavaScript">

For this example, we want to generate embeddings from text. OpenAI's `ada-002` model is popular, free, and a quick [signup](https://openai.com/api/). Grab your API key and come back. Chroma's API is polymorphic (it can run in the browser or server-side), but OpenAIs is not. So run this example server-side.

:::caution
Please take steps to secure your API when interacting with frontend systems.
:::

```js
// CJS
const { OpenAIEmbeddingFunction } = require("chromadb");

// ESM
import { OpenAIEmbeddingFunction } from 'chromadb'

const embedder = new OpenAIEmbeddingFunction({
  openai_api_key: "your_api_key",
});
const collection = await client.createCollection({
  name: "my_collection",
  embeddingFunction: embedder,
});
```

</TabItem>

</Tabs>

### 4. Add some text documents to the collection

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

Chroma will store your text, and handle tokenization, embedding, and indexing automatically.

```python
collection.add(
    documents=["This is a document", "This is another document"],
    metadatas=[{"source": "my_source"}, {"source": "my_source"}],
    ids=["id1", "id2"]
)
```

</TabItem>
<TabItem value="js" label="JavaScript">

Chroma will store your text, and handle tokenization, embedding, and indexing automatically.

```js
await collection.add({
  ids: ["id1", "id2"],
  metadatas: [{ source: "my_source" }, { source: "my_source" }],
  documents: ["This is a document", "This is another document"],
});
```

</TabItem>

</Tabs>

If you have already generated embeddings yourself, you can load them directly in:

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

```python
collection.add(
    embeddings=[[1.2, 2.3, 4.5], [6.7, 8.2, 9.2]],
    documents=["This is a document", "This is another document"],
    metadatas=[{"source": "my_source"}, {"source": "my_source"}],
    ids=["id1", "id2"]
)
```

</TabItem>
<TabItem value="js" label="JavaScript">

```js
await collection.add({
  ids: ["id1", "id2"],
  embeddings: [
    [1.2, 2.3, 4.5],
    [6.7, 8.2, 9.2],
  ],
  metadatas: [{ source: "my_source" }, { source: "my_source" }],
  documents: ["This is a document", "This is another document"],
});
```

</TabItem>

</Tabs>

### 5. Query the collection

You can query the collection with a list of query texts, and Chroma will return the `n` most similar results. It's that easy!

<Tabs queryString groupId="lang" className="hideTabSwitcher">
<TabItem value="py" label="Python">

```python
results = collection.query(
    query_texts=["This is a query document"],
    n_results=2
)
```

By default data stored in Chroma is ephemeral making it easy to prototype scripts. It's easy to make Chroma persistent so you can reuse every collection you create and add more documents to it later. It will load your data automatically when you start the client, and save it automatically when you close it. Check out the [Usage Guide](./usage-guide.md) for more info.

Find [chromadb on PyPI](https://pypi.org/project/chromadb/).

</TabItem>
<TabItem value="js" label="JavaScript">

```js
const results = await collection.query({
  nResults: 2,
  queryTexts: ["This is a query document"],
});
```

Find [chromadb on npm](https://www.npmjs.com/package/chromadb).

</TabItem>

</Tabs>

## 📚 Next steps

- Chroma is designed to be simple enough to get started with quickly and flexible enough to meet many use-cases. You can use your own embedding models, query Chroma with your own embeddings, and filter on metadata. To learn more about Chroma, check out the [Usage Guide](./usage-guide.md) and [API Reference](./api-reference.md).
- Chroma is integrated in [LangChain](https://python.langchain.com/docs/integrations/vectorstores/chroma) (`python` and `js`), making it easy to build AI applications with Chroma. Check out the [integrations](./integrations) page to learn more.
- You can [deploy a persistent instance](./deployment) of Chroma to an external server, to make it easier to work on larger projects or with a team.

## Coming Soon

- A hosted version of Chroma, with an easy to use web UI and API
- Multiple datatypes, including images, audio, video, and more