Skip to main content

Mixedbread AI Langchain Integration

PyPI version Python versions

Mixedbread AI integration for LangChain. 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 langchain workflows.

Components

  • MixedbreadEmbeddings - State-of-the-art embedding models that generate vectors capturing deep contextual meaning, with full async support and batch processing capabilities for transforming unstructured data into intelligent search
  • MixedbreadReranker - Powerful semantic reranking that significantly boosts search relevance by applying sophisticated models to reorder initial search results, essential for optimizing RAG applications and improving precision
  • MixedbreadDocumentLoader - Layout-aware document parsing supporting PDF, PPTX, HTML and more formats, providing structured output with detailed content elements for high-quality downstream processing
  • MixedbreadVectorStoreRetriever - AI-native search engine that enables conversational queries across multimodal data, supporting millions of documents with natural language understanding across multiple languages.

Installation

pip install mixedbread-ai-langchain

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_langchain import MixedbreadEmbeddings

embeddings = MixedbreadEmbeddings(model="mixedbread-ai/mxbai-embed-large-v1")
result = embeddings.embed_query("Who is German and likes bread?")

Async Support

All components support async operations:

import asyncio

async def embed_text():
    embeddings = MixedbreadEmbeddings()
    result = await embeddings.aembed_query("Async embedding example")
    return result

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 unit tests only (no API key required)
python run_tests.py unit

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

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

Documentation

Learn more at mixedbread.com/docs:

License

Apache 2.0 License

Metadata

Release files for mixedbread-ai-langchain 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mixedbread-ai-langchain 1.0.2
File Size Uploaded
mixedbread_ai_langchain-1.0.2.tar.gz 23.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mixedbread-ai-langchain 1.0.2
File Interpreter ABI Platform
mixedbread_ai_langchain-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 52.4 kB

Release files / mixedbread_ai_langchain-1.0.2.tar.gz

Download URL mixedbread_ai_langchain-1.0.2.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c9f2c99fb3aa9374a89b153847c81065a0a1f79e18b0c954d3a6700017c82b84
BLAKE2b-256 checksum
How to use checksums
0228068c398332749d030f53504aa4c85b5aaac9cd764a25dcda282ed51618db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / mixedbread_ai_langchain-1.0.2-py3-none-any.whl

Download URL mixedbread_ai_langchain-1.0.2-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fedd9eae9804810fe1d3ee89befe7e2143df1a7f0ffbd6a24037035535b5f1b9
BLAKE2b-256 checksum
How to use checksums
9367aa59ead224d605a1742068e17cda8d70793a1c7c87d799c9ec8e41e1f6d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page