Skip to main content

Give your LangChain agents eyes, ears, and memory — multimodal search, ingestion, and monitoring for video, images, audio, and documents

Project description

langchain-mixpeek

PyPI - Version PyPI - Downloads PyPI - License Python Tests

AI agents are blind. Mixpeek gives them eyes, ears, and memory.

The official LangChain integration for Mixpeek — the infrastructure layer that lets AI agents search video, images, audio, and documents through one API.

Quick install

pip install langchain-mixpeek

What's inside

Component Class What it does
Retriever MixpeekRetriever Search across video, images, audio, documents — returns LangChain Document objects
Tool MixpeekTool Standalone agent tool for search — returns JSON for LLM consumption
Toolkit MixpeekToolkit 6-tool suite: search, ingest, process, classify, cluster, alert
VectorStore MixpeekVectorStore Full CRUD — ingest any file type, search, and manage platform features
Async AsyncMixpeekRetriever Non-blocking retriever for async chains and agents

Usage

Retriever

from langchain_mixpeek import MixpeekRetriever

retriever = MixpeekRetriever(
    api_key="mxp_...",
    retriever_id="ret_abc123",
    namespace="my-namespace",
)
docs = retriever.invoke("find the red cup")

One-line agent tool

tool = retriever.as_tool()  # that's it — retriever becomes an agent tool

Agent with 6 capabilities

from langchain_mixpeek import MixpeekToolkit
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

toolkit = MixpeekToolkit(
    api_key="mxp_...",
    namespace="brand-protection",
    bucket_id="bkt_...",
    collection_id="col_...",
    retriever_id="ret_...",
)

agent = create_react_agent(
    ChatAnthropic(model="claude-sonnet-4-20250514"),
    toolkit.get_tools(),
)

result = agent.invoke({
    "messages": [("user", "Scan these product URLs and alert me about counterfeits")]
})

The toolkit gives your agent:

Tool Capability
mixpeek_search Search video, images, audio, documents by natural language
mixpeek_ingest Upload text, images, video, audio, PDFs, spreadsheets
mixpeek_process Trigger feature extraction (embedding, OCR, transcription, face detection)
mixpeek_classify Run taxonomy classification on documents
mixpeek_cluster Group similar documents (kmeans, dbscan, hdbscan)
mixpeek_alert Monitor content with webhook, Slack, or email notifications

Scope what your agent can do:

toolkit.get_tools(actions=["search"])                         # search only
toolkit.get_tools(actions=["search", "ingest", "process"])    # search + upload
toolkit.get_tools()                                           # all 6 tools

VectorStore — ingest any file type

from langchain_mixpeek import MixpeekVectorStore

store = MixpeekVectorStore(
    api_key="mxp_...",
    namespace="my-namespace",
    bucket_id="bkt_...",
    collection_id="col_...",
    retriever_id="ret_...",
)

# Eyes: images and video
store.add_images(["https://example.com/photo.jpg"])
store.add_videos(["https://example.com/clip.mp4"])

# Ears: audio
store.add_audio(["https://example.com/recording.mp3"])

# Memory: text, PDFs, spreadsheets
store.add_texts(["product description..."])
store.add_pdfs(["https://example.com/doc.pdf"])
store.add_excel(["https://example.com/data.xlsx"])

# Process everything (embedding, OCR, face detection, transcription)
store.trigger_processing()

# Search across all modalities
docs = store.similarity_search("red cup on the table")

Convert between interfaces anytime:

retriever = store.as_retriever()
tool = store.as_tool()
toolkit = store.as_toolkit()

RAG chain

from langchain_core.prompts import ChatPromptTemplate
from langchain_anthropic import ChatAnthropic
from langchain_mixpeek import MixpeekRetriever

retriever = MixpeekRetriever(api_key="mxp_...", retriever_id="ret_...", namespace="ns")
llm = ChatAnthropic(model="claude-sonnet-4-20250514")

prompt = ChatPromptTemplate.from_template(
    "Answer using this context:\n{context}\n\nQuestion: {question}"
)

chain = {"context": retriever, "question": lambda x: x} | prompt | llm
response = chain.invoke("what happens at 2 minutes?")

Multi-retriever agent

from langchain_mixpeek import MixpeekTool
from langgraph.prebuilt import create_react_agent

video_search = MixpeekTool(
    api_key="mxp_...", retriever_id="ret_video", namespace="archive",
    name="search_videos", description="Search video archive for scenes or faces.",
)
image_search = MixpeekTool(
    api_key="mxp_...", retriever_id="ret_images", namespace="catalog",
    name="search_images", description="Search product images by visual similarity.",
)

agent = create_react_agent(llm, [video_search, image_search])

Configuration

Parameter Type Default Description
api_key str required Mixpeek API key (mxp_...)
retriever_id str required Retriever ID for search (ret_...)
namespace str required Namespace to operate in
bucket_id str required* Bucket for uploads (bkt_...)
collection_id str required* Collection for processing (col_...)
top_k int 10 / 5 Max results (retriever / tool)
content_field str "text" Field to use as page_content
filters dict None Attribute filters for retriever

*Required for ingest/processing. Not needed for search-only via from_retriever().

Platform features

The VectorStore and Toolkit expose the full Mixpeek platform beyond search:

  • Taxonomies — create and run classification pipelines on your documents
  • Clusters — group similar content with kmeans, dbscan, hdbscan, or spectral clustering
  • Alerts — monitor for matches and notify via webhook, Slack, or email
  • Plugins — manage and test custom feature extractors

Documentation

License

MIT

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

langchain_mixpeek-0.4.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

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

langchain_mixpeek-0.4.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_mixpeek-0.4.2.tar.gz.

File metadata

  • Download URL: langchain_mixpeek-0.4.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for langchain_mixpeek-0.4.2.tar.gz
Algorithm Hash digest
SHA256 a6f701ae53330ca916299c00400a3d2e47e9b83d42ca5bdef3de520cee1b761b
MD5 15236d84364cfea2e3770f97d7126961
BLAKE2b-256 86cd2ba0af3028c93f65fb5c8a4a14923250e281a8c7e00f339aa7643e2edb5f

See more details on using hashes here.

File details

Details for the file langchain_mixpeek-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_mixpeek-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e3f5afc3f628d2f48077f4f2a3c05d6dd2f85ad0bd2576348cd6808a1461fdd
MD5 858592e96647d3005440ba9de61ae3cd
BLAKE2b-256 21d3bb03adb125178c082be13c7dadd441cc067e9cbc2db46514c401883363f9

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