Multimodal Knowledge Base
Consolidate documents, videos, images, and audio into a single searchable knowledge base with RAG capabilities. Supports natural language Q&A across all content types, with citations linking back to the exact source document, video timestamp, or image.
from mixpeek import Mixpeekfrom openai import OpenAIclient = Mixpeek(api_key="YOUR_API_KEY")openai = OpenAI(api_key="YOUR_OPENAI_KEY")# Create collections for each content typedocs_col = client.collections.create(namespace_id="ns_your_namespace",name="knowledge_docs",extractors=["document-graph-extractor", "text-extractor"])videos_col = client.collections.create(namespace_id="ns_your_namespace",name="knowledge_videos",extractors=["multimodal-extractor", "text-extractor"])# Build unified retriever spanning all collectionsretriever = client.retrievers.create(namespace_id="ns_your_namespace",name="knowledge_base",collection_ids=["col_knowledge_docs", "col_knowledge_videos"],stages=[{"type": "feature_search", "top_k": 50},{"type": "rerank", "top_k": 10},{"type": "rag_prepare"}])# Ask a question across all contentresults = client.retrievers.execute(retriever_id=retriever["retriever_id"],query={"text": "What is our company policy on remote work?"})context = "\n".join([f"[{i+1}] {doc['text']} (Source: {doc['root_object_id']}, Type: {doc['modality']})"for i, doc in enumerate(results["documents"])])response = openai.chat.completions.create(model="gpt-4o",messages=[{"role": "system", "content": f"Answer from this knowledge base:\n{context}"},{"role": "user", "content": "What is our company policy on remote work?"}])print(response.choices[0].message.content)
Feature Extractors
Retriever Stages
rerank
Rerank documents using cross-encoder models for accurate relevance
summarize
Condense multiple documents into a summary using an LLM
Related Recipes & Resources
Explore these related resources to deepen your understanding and discover more powerful features
Metadata Enrichment Pipeline
Automatically enrich your data with extracted metadata: entities, topics, sentiment, language, and custom attributes. Transform raw content into structured, queryable data.
Document RAG Pipeline
Retrieval-augmented generation for document collections. Extracts text, tables, and figures from PDFs using OCR and layout analysis, then retrieves relevant page sections to answer natural language questions with precise page and section citations.
Multimodal Hybrid Search Pipeline
Combine vector search with keyword search (BM25) across text, images, and video for the most comprehensive multimodal retrieval system.
Multimodal RAG Pipeline
Build a retrieval-augmented generation system that works with text, images, and video. Feed relevant multimodal context to LLMs for grounded responses.
Taxonomy Enrichment Pipeline
Automatically classify and tag content using custom taxonomies. Map your content to IAB categories, custom hierarchies, or industry-specific classifications.
Content Clustering Pipeline
Automatically group similar content together using embedding-based clustering. Discover themes, identify duplicates, and organize large content libraries.