Skip to content

Cohere Embeddings

Cohere Embeddings turns text into a numeric fingerprint of its meaning using Cohere models. With that fingerprint, NappAI can find the documents that say something similar to what you are looking for, even when they use different words, for example in a knowledge base.

You connect the component to a vector database, which uses it both to store your documents and to search them. Use it if your company works with Cohere.

When to use it

  • Give an agent the knowledge in your manuals, contracts or FAQs by storing them in a vector database.
  • Build an internal search that finds documents by their meaning, not only by exact words.
  • Your company already has a Cohere account.
  • You have documents in several languages and want to use a multilingual Cohere model.

Configuration

FieldWhat it does
Credential (required)The credential of the service Cohere API. Pick one with Choose an option or create one with Add new credential. See Credentials.

The model is chosen in the Advanced tab.

Advanced options

FieldWhat it does
ModelThe Cohere model that calculates the fingerprints: embed-english-v2.0, embed-multilingual-v2.0, embed-english-light-v2.0 or embed-multilingual-light-v2.0. Default: embed-english-v2.0.
TruncateWhat Cohere does with texts longer than the model accepts: START cuts the beginning, END cuts the end and NONE does not cut and returns an error. Empty, Cohere applies its default option.
Max RetriesHow many times a failed request is retried. Default: 3.
Request TimeoutMaximum waiting time for each request, in seconds. Empty, Cohere’s own is used.
User AgentThe name the component uses to identify itself to Cohere. You do not need to change it.

Batch processing

With the Batch Mode switch on, the component runs once for each item of the list you connect to Batch Input and returns all the results together as a list. Parallel Executions sets how many items are processed at the same time (1 to 5). Skip if Empty Batch Input skips the component when the list arrives empty, and Skip Branch if Empty Output stops the following components when the result is empty. More in Key concepts.

Output

Example

A hotel chain, Hoteles Mirador, wants its assistant to answer using its booking and cancellation policies in Spanish and English.

  1. In a loading flow, split the documents into chunks with Recursive Character Text Splitter and pass them to Chroma DB with Operation set to Add.
  2. Add Cohere Embeddings (in Advanced, Model set to embed-multilingual-v2.0) and connect its Embeddings output to the Embedding input of Chroma DB.
  3. In the assistant flow, use the same Chroma DB collection with the same Cohere Embeddings component to find the chunks that answer each question.

Good practices

  • The default model is designed for English text. If your documents are in Spanish or in several languages, choose embed-multilingual-v2.0 or embed-multilingual-light-v2.0.