MIVAA API Documentation

Version: 2.5.0 Last Updated: 2025-12-30 Base URL: https://v1api.materialshub.gr


πŸ“š Interactive Documentation


🎯 Latest Enhancement: Image Re-classification (v2.5.0)

New in v2.5.0:

Previous Enhancement: Multi-Vector Search (v2.3.0)

Overview

The multi-vector search has been significantly enhanced to be the single comprehensive search solution for the MIVAA platform.

What's New

βœ… 7 Specialized Embeddings (SigLIP2 / SLIG + Voyage AI, updated 2026-04)

Note (2026-04): All image embeddings now live exclusively in the VECS collections (vecs.image_*_embeddings, halfvec). The former dual-store columns on document_images (visual_clip_embedding_512, color_embedding_256, texture_embedding_256, application_embedding_512, multimodal_fusion_embedding_2688) were dropped — they had been broken since the CLIP→SLIG dimension change. Presence is tracked via boolean flags on document_images (has_slig_embedding, has_understanding_embedding, has_color_slig, has_texture_slig, has_style_slig, has_material_slig) for O(1) lookup. Text embeddings remain in document_chunks.text_embedding.

βœ… JSONB Metadata Filtering

βœ… Query Understanding (ENABLED BY DEFAULT)

Performance

Metric Value
Response Time 250-350ms (with query understanding), 200-300ms (without)
Accuracy Improvement 30-40% for complex queries
Cost $0.0001 per query
Recommended For 95% of all queries

Example Usage

What happens with query understanding (DEFAULT):

  1. GPT-4o-mini parses the query
  2. Extracts filters:
    • material_type: "ceramic tiles"
    • properties: ["waterproof", "outdoor"]
    • finish: "matte"
    • colors: ["light beige"]
    • application: "patio"
  3. Multi-vector search executes with 6 embeddings + filters
  4. Returns highly accurate, filtered results

πŸ” Search Strategies

Multi-Vector Search (⭐ RECOMMENDED DEFAULT)

Endpoint: POST /api/rag/search?strategy=multi_vector

Features:

When to use: 95% of all queries

Performance: ~250-350ms (with query understanding), ~200-300ms (without)


Other Strategies

Strategy Use Case Performance
semantic Fast text-only search ~80ms
vector Pure similarity matching ~100ms
hybrid Semantic + keyword ~120ms
material Property filtering only ~50ms
image Visual similarity ~150ms
color Color-specific search ~100ms
texture Texture-specific search ~100ms
style Style-specific search ~100ms
material_type Material type search ~100ms
all ⚠️ DEPRECATED - Use multi_vector ~800ms

πŸ” Authentication

All API endpoints require JWT authentication via the Authorization: Bearer YOUR_JWT_TOKEN header.

Get your token from:

  1. Frontend application (automatic)
  2. Supabase authentication
  3. /auth/login endpoint

πŸ“Š Response Format

All endpoints return JSON with a consistent structure indicating success/failure, results array, processing metadata, weights applied, filters applied, and the search type used.


πŸš€ Getting Started

  1. Get API Access

  2. Make Your First Request

    • POST to https://v1api.materialshub.gr/api/rag/search?strategy=multi_vector with your query and workspace_id
  3. Explore Interactive Docs


πŸ“– Additional Resources


Questions? Contact support or check the interactive documentation at /docs.