MistralAI Embeddings
The MistralAI Embeddings component turns your text into numerical vectors (embeddings) using MistralAI’s powerful language models. These vectors can be used to compare documents, find similar content, or feed into other AI tools.
How it Works
When you provide text to this component, it sends the data to MistralAI’s API. The API processes the text with the selected model (by default “mistral‑embed”) and returns a set of numbers that represent the meaning of the text. The component then outputs these numbers as an Embeddings object that you can use in the rest of your workflow.
Inputs
Credential
Before you can use the component, you must set up a Mistral AI API credential in Nappai’s credentials section. Once the credential is created, select it in the component’s Credential field. This keeps your API key safe and separate from the workflow.
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
- API Endpoint: The URL of the MistralAI API. The default is
https://api.mistral.ai/v1/
. - Mapping Mode: Toggle to enable batch processing of multiple records.
- Max Concurrent Requests: How many API calls can run at the same time. Default is 64.
- Max Retries: Number of times the component will retry a failed request. Default is 5.
- Model: The specific MistralAI model to use. The only available option is
mistral-embed
. - Request Timeout: How long (in seconds) to wait for a response before timing out. Default is 120.
Outputs
- Embeddings: A set of numerical vectors that represent the input text. These can be passed to a vector store, used for similarity searches, or fed into other AI components.
Usage Example
- Set up the credential: In Nappai’s credentials panel, create a new Mistral AI API credential and paste your API key.
- Add the component: Drag the MistralAI Embeddings component onto the canvas.
- Select the credential: In the component’s Credential field, choose the credential you just created.
- Provide text: Connect the output of a Text Splitter (or any text source) to the component’s input. If you’re processing a single piece of text, use the Fixed mode and type the text directly.
- Use the embeddings: Connect the Embeddings output to a Vector Store component or any downstream AI tool that accepts embeddings.
Related Components
- Text Splitter – Breaks long documents into smaller chunks before embedding.
- OpenAI Embeddings – Generates embeddings using OpenAI models.
- Vector Store – Stores and retrieves embeddings for similarity search.
Tips and Best Practices
- Keep the default model (
mistral-embed
) unless you have a specific reason to change it. - Adjust Max Concurrent Requests based on your system’s capacity to avoid overloading the API.
- Use Mapping Mode when you need to process large batches of text efficiently.
- Store your API key in a credential, never hard‑code it in the workflow.
Security Considerations
- The API key is stored securely in Nappai’s credential store, not in the workflow itself.
- Always use the Credential field to reference your API key; avoid exposing it in any text fields.
- Monitor your API usage in the MistralAI console to detect any unexpected activity.