Skip to main content

The official Mixedbread AI integration for LangChain.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mixedbread_ai_langchain-1.0.2.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mixedbread_ai_langchain-1.0.2-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file mixedbread_ai_langchain-1.0.2.tar.gz.

File metadata

  • Download URL: mixedbread_ai_langchain-1.0.2.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mixedbread_ai_langchain-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c9f2c99fb3aa9374a89b153847c81065a0a1f79e18b0c954d3a6700017c82b84
MD5 99af39309dfc91fe62f3bee51ea8c250
BLAKE2b-256 0228068c398332749d030f53504aa4c85b5aaac9cd764a25dcda282ed51618db

See more details on using hashes here.

File details

Details for the file mixedbread_ai_langchain-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mixedbread_ai_langchain-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fedd9eae9804810fe1d3ee89befe7e2143df1a7f0ffbd6a24037035535b5f1b9
MD5 e80ca2f011539c82ce6c47917ad57e54
BLAKE2b-256 9367aa59ead224d605a1742068e17cda8d70793a1c7c87d799c9ec8e41e1f6d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page