Skip to main content
Mixpeek exposes retrievers as tools that any AI agent can call. Pick your framework.

LangChain

The langchain-mixpeek package provides a retriever, tool, and toolkit:
pip install langchain-mixpeek
from langchain_mixpeek import MixpeekRetriever, MixpeekToolkit

retriever = MixpeekRetriever(
    api_key="YOUR_API_KEY",
    retriever_id="ret_xxx",
    namespace_id="ns_xxx"
)

# Use as a retriever in any RAG chain
docs = retriever.invoke("product demo walkthrough")

# Or as a full toolkit with ingest, search, classify, cluster, alert tools
toolkit = MixpeekToolkit(api_key="YOUR_API_KEY", namespace_id="ns_xxx")
tools = toolkit.get_tools()
Available on PyPI and npm.

MCP (Model Context Protocol)

Give Claude, Cursor, or any MCP-compatible agent access to Mixpeek. Four scoped servers available:
ScopeURLTools
Fullhttps://mcp.mixpeek.com/mcp43
Ingestionhttps://mcp.mixpeek.com/ingestion/mcp18
Retrievalhttps://mcp.mixpeek.com/retrieval/mcp11
Adminhttps://mcp.mixpeek.com/admin/mcp14
Add to Claude Desktop or Claude Code config:
{
  "mcpServers": {
    "mixpeek-retrieval": {
      "url": "https://mcp.mixpeek.com/retrieval/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}
For a single-retriever server with typed parameters, use the CLI: mixpeek-mcp-retriever --retriever-id ret_xxx --api-key YOUR_KEY.

OpenAI Function Calling

Define a Mixpeek retriever as a function schema:
import json, openai, requests

def search_documents(query: str) -> list:
    resp = requests.post(
        f"https://api.mixpeek.com/v1/retrievers/{RETRIEVER_ID}/execute",
        headers={"Authorization": f"Bearer {API_KEY}", "X-Namespace": NS_ID, "Content-Type": "application/json"},
        json={"inputs": {"query_text": query}, "limit": 5},
    )
    return resp.json()["results"]

retriever_tool = {
    "type": "function",
    "function": {
        "name": "search_documents",
        "description": "Search the knowledge base using multimodal retrieval",
        "parameters": {
            "type": "object",
            "properties": {"query": {"type": "string", "description": "Natural language search query"}},
            "required": ["query"],
        },
    },
}
Works with Chat Completions API and Assistants API. See the OpenAI integration guide for the complete loop.

Any Framework (REST)

The pattern is the same for CrewAI, LlamaIndex, Haystack, Autogen, or plain HTTP:
def mixpeek_search(query: str, limit: int = 10) -> list:
    resp = requests.post(
        f"https://api.mixpeek.com/v1/retrievers/{RETRIEVER_ID}/execute",
        headers={"Authorization": f"Bearer {API_KEY}", "X-Namespace": NS_ID, "Content-Type": "application/json"},
        json={"inputs": {"query_text": query}, "limit": limit},
    )
    resp.raise_for_status()
    return resp.json()["results"]
Retriever execute API reference →