Skip to content

mixedbread-ai/mixedbread-ai-haystack

Repository files navigation

Mixedbread AI Haystack Integration

PyPI version Python versions

Mixedbread AI integration for Haystack. This package provides seamless access to Mixedbread's multimodal AI capabilities, enabling intelligent search that understands meaning across text, images, code, PDFs, and diverse document types. Use our state of the art embedding and reranking models as part of your haystack workflows.

Components

  • MixedbreadTextEmbedder - State-of-the-art embedding models that generate vectors capturing deep contextual meaning for single texts and queries
  • MixedbreadDocumentEmbedder - Embed full documents using advanced embedding models
  • MixedbreadReranker - Powerful semantic reranking that significantly boosts search relevance
  • MixedbreadDocumentParser - Layout-aware document parsing supporting PDF, PPTX, HTML and more formats
  • MixedbreadVectorStoreRetriever - AI-native search engine that enables conversational queries across multimodal data

Installation

pip install mixedbread-ai-haystack

Quick Start

Get your API key from the Mixedbread Platform and set it as an environment variable:

export MXBAI_API_KEY="your-api-key"

Basic Usage

from mixedbread_ai_haystack import MixedbreadTextEmbedder

embedder = MixedbreadTextEmbedder(model="mixedbread-ai/mxbai-embed-large-v1")
result = embedder.run(text="What is the capital of France?")
embedding = result["embedding"]

Async Support

All components support async operations:

import asyncio

async def embed_text():
    embedder = MixedbreadTextEmbedder()
    result = await embedder.run_async(text="Async embedding example")
    return result["embedding"]

embedding = asyncio.run(embed_text())

Examples

See the examples/ directory for complete usage examples:

Testing

# Install dev dependencies
pip install -e .[dev]

# Run all tests
python run_tests.py all

# Run only unit tests
python run_tests.py unit

# Run only integration tests (requires API key)
python run_tests.py integration

# Run specific test files
python run_tests.py tests/test_text_embedder.py

Documentation

Learn more at mixedbread.com/docs:

License

Apache 2.0 License

About

The Mixedbread Haystack Integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages