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.1.tar.gz (23.0 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.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mixedbread_ai_langchain-1.0.1.tar.gz
  • Upload date:
  • Size: 23.0 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.1.tar.gz
Algorithm Hash digest
SHA256 b300aeedf250eff7a140f94693f190b3bc083a881a6a0bae7957e806f2b74f6e
MD5 29f723b147f4f020bbe33e3ecd87e400
BLAKE2b-256 e704da0cd8a9b9b41b2202717f38c84b411948b4df0668294c7b97b462c151f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mixedbread_ai_langchain-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2fcbe206d878cf5cd4574d9428b6208720907c1e6ec3bbb1b4a6f08350ad4c
MD5 feea6ce604cd7da932c1d74f4aaadbfb
BLAKE2b-256 6f1974e30d36f84fa9e9b4bc4e5e6f869e1b4a3b40059f3f8513c510263380b2

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