MixedbreadAI
Welcome to the mixedbread embeddings guide! This guide will help you use the mixedbread ai's API to generate embeddings for your text documents, ensuring you get the most relevant information, just like picking the freshest bread from the bakery.
To find out more about the latest features, updates, and available models, visit mixedbread.ai.
Table of Contents
Setup
Next, sign up for an API key at mixedbread.ai. Once you have your API key, you can import the necessary modules and create a new instance of the MixedbreadAIEmbeddings
class.
Usage with LlamaIndex
This section will guide you through integrating mixedbread embeddings with LlamaIndex for more advanced usage.
Step 1: Load and Index Documents
For this example, we will use a single document. In a real-world scenario, you would have multiple documents to index, like a variety of breads in a bakery.
Step 2: Create a Query Engine
Combine the retriever and the embed model to create a query engine. This setup ensures that your queries are processed to provide the best results, like arranging the bread in the order of freshness and quality.
Models can require prompts to generate embeddings for queries, in the 'mixedbread-ai/mxbai-embed-large-v1' model's case, the prompt is Represent this sentence for searching relevant passages:
.
Embeddings with Custom Parameters
This section will guide you through generating embeddings with custom parameters and usage with f.e. matryoshka and binary embeddings.
Step 1: Create an Instance of MixedbreadAIEmbeddings
Create a new instance of the MixedbreadAIEmbeddings
class with custom parameters. For example, to use the mixedbread-ai/mxbai-embed-large-v1
model with a batch size of 64, normalized embeddings, and binary encoding format:
Step 2: Define Texts
Define the texts you want to generate embeddings for.
Step 3: Generate Embeddings
Use the embedDocuments
method to generate embeddings for the texts.
API Reference
Last updated on