> ## Documentation Index
> Fetch the complete documentation index at: https://llm-tools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cohere

The library supports usage of [Cohere-AI](https://cohere.com) `embed-english-v2.0` embedding model out of the box. This model returns vectors with dimension 4096.

Here's what you have to do to use it -

* Sign up for an account with Cohere-AI, go to the [API Keys](https://dashboard.cohere.ai/api-keys) section and copy / create an API\_KEY.

* Set the key in the environment variable `COHERE_API_KEY`

```bash theme={null}
COHERE_API_KEY="<YOUR_KEY>"
```

## Install Cohere addon

```bash theme={null}
npm install @llm-tools/embedjs-cohere
```

## Usage

```ts theme={null}
import { RAGApplicationBuilder } from '@llm-tools/embedjs';
import { CohereEmbeddings } from '@llm-tools/embedjs-cohere';
import { HNSWDb } from '@llm-tools/embedjs-hnswlib';

const app = await new RAGApplicationBuilder()
.setEmbeddingModel(new CohereEmbeddings())
```
