NEWVectors or files. Pick a path.Start →
    Enhanced

    Content Clustering Pipeline

    Automatically group similar content together using embedding-based clustering. Discover themes, identify duplicates, and organize large content libraries.

    text
    image
    video
    Multi-Tier
    import requests
    from mixpeek import Mixpeek
    client = Mixpeek(api_key="YOUR_API_KEY", namespace="clusters")
    API = "https://api.mixpeek.com/v1"
    HEADERS = {"Authorization": "Bearer YOUR_API_KEY", "X-Namespace": "clusters"}
    # 1. A bucket for articles, and a collection that embeds each one
    bucket = client.buckets.create(
    bucket_name="articles",
    bucket_schema={"properties": {"article": {"type": "text"}}},
    )
    collection = client.collections.create(
    collection_name="articles",
    source={"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},
    feature_extractor={
    "feature_extractor_name": "text_extractor",
    "version": "v1",
    },
    )
    client.buckets.upload(
    bucket["bucket_id"],
    blobs=[{"property": "article", "type": "text", "data": "s3://your-bucket/articles/cloud-costs.md"}],
    )
    client.collections.trigger(collection["collection_id"])
    # 2. A k-means cluster over the embeddings, with LLM-written labels. The SDK has no
    # clusters resource, so this is REST.
    cluster = requests.post(API + "/clusters", headers=HEADERS, json={
    "cluster_name": "article-themes",
    "collection_ids": [collection["collection_id"]],
    "cluster_type": "vector",
    "vector_config": {
    "feature_uris": ["mixpeek://text_extractor@v1/multilingual_e5_large_instruct_v1"],
    "clustering_method": "kmeans",
    "algorithm_params": {"n_clusters": 20},
    },
    "llm_labeling": {"enabled": True, "provider": "openai", "model_name": "gpt-4o-mini-2024-07-18"},
    }).json()
    requests.post(API + "/clusters/" + cluster["cluster_id"] + "/execute", headers=HEADERS, json={})
    # 3. Once the execution finishes, read the groups
    groups = requests.get(API + "/clusters/" + cluster["cluster_id"] + "/groups", headers=HEADERS).json()
    for group in groups["groups"]:
    print(group)

    Feature Extractors

    Text Embedding

    Extract semantic embeddings from documents, transcripts and text content

    Retriever Stages

    Frequently asked questions

    How do I choose the number of clusters?

    Start with 10-20 clusters and adjust based on your content volume. Mixpeek can also auto-detect the optimal number using silhouette analysis.

    Can I cluster across modalities?

    Yes. If documents have multimodal embeddings, clustering works across text, images, and video using shared embedding spaces.

    How are cluster labels generated?

    Mixpeek uses an LLM to analyze representative documents from each cluster and generate descriptive labels automatically.