Platform Flows & User Workflows
Complete guide to all user workflows and feature flows in the Material Kai Vision Platform.
📋 Table of Contents
- PDF Processing Flow
- Search & Discovery Flow
- Data Import Flow
- 3D Generation Flow
- Knowledge Base Flow
- Agent Chat Flow
- VR World Generation Flow ✨ NEW
1. PDF Processing Flow
Purpose: Transform material catalog PDFs into searchable, intelligent knowledge
User Journey:
- User uploads PDF file
↓
- Frontend uploads to Supabase Storage
↓
- MIVAA API creates background job
↓
- 14-Stage Processing Pipeline:
- Stage 0A: Product Discovery (Claude/GPT-4o)
- Stage 0B: Entity Discovery (Certificates, Logos, Specs)
- Stage 1: Focused Extraction (product pages only)
- Stage 2: Text Extraction (PyMuPDF4LLM)
- Stage 3: Semantic Chunking
- Stage 4: Text Embeddings (Voyage AI 1024D)
- Stage 5: Image Extraction
- Stage 6: Image Analysis (Qwen Vision)
- Stages 7-10: Multi-Vector SLIG 768D Embeddings (5 types) + Voyage 1024D understanding
- Stage 11: Product Creation & Entity Linking
- Stage 12: Entity Relationship Mapping
- Stage 13: Quality Enhancement
- Stage 14: Cleanup & Completion
↓
- Real-time progress updates to frontend
↓
- Results displayed in Materials Catalog
API Endpoint: POST /api/rag/documents/upload
Frontend Component: EnhancedPDFProcessor.tsx
Documentation: pdf-processing-pipeline.md
2. Search & Discovery Flow
Purpose: Find materials using text, images, or natural language
User Journey:
- User enters search query or uploads image
↓
- Frontend calls MIVAA search API
↓
- Query processing:
- Text: Generate embedding (Voyage AI 1024D)
- Image: Generate SLIG embedding (768D)
- Natural language: AI query enhancement
↓
- Multi-vector similarity search (pgvector)
↓
- Results ranked by:
- Relevance (40%)
- Quality (30%)
- Semantic similarity (20%)
- Recency (10%)
↓
- Optional AI re-ranking (Claude Sonnet 4.5)
↓
- Results displayed with:
- Product cards
- Images
- Metadata
- Relevance scores
API Endpoint: POST /api/rag/search
Frontend Component: SearchHub.tsx
Documentation: search-strategies.md
4. Data Import Flow
Purpose: Import materials from XML files or web scraping
User Journey (XML Import):
- User uploads XML file
↓
- Edge Function parses XML and detects fields
↓
- AI suggests field mappings (Claude Sonnet 4.5)
↓
- User reviews and confirms mappings
↓
- Edge Function creates import job
↓
- Python API processes job in batches:
- Parse XML entries
- Download images concurrently
- Create products in database
- Link images to products
- Queue text processing (async)
↓
- Job marked as completed
↓
- Results displayed in Import History
API Endpoint: POST /api/data-import/xml
Frontend Component: DataImportHub.tsx
Documentation: data-import-system.md
5. 3D Designer Flow
Purpose: Interactive 3D room designer for material visualization
User Journey:
- User accesses /designer route
↓
- DesignerLayout loads with:
- Asset Library Panel (materials, furniture)
- 3D Canvas (React Three Fiber)
- Properties Panel (object properties)
- Toolbar (transform tools)
↓
- User can:
- Drag and drop materials/objects
- Transform objects (move, rotate, scale)
- Adjust room dimensions
- Configure lighting
↓
- Real-time 3D rendering with:
- Camera controls (orbit, pan, zoom)
- Grid snapping
- Material previews
Frontend Component: DesignerPage.tsx → DesignerLayout.tsx
Route: /designer
6. Knowledge Base Flow
Purpose: Create and manage documentation with AI assistance
User Journey:
- User creates new document or uploads PDF
↓
- For text input:
- User writes content in markdown editor
- AI assistant provides suggestions
- Auto-save with version history
↓
- For PDF upload:
- PyMuPDF extracts text
- Content converted to markdown
- User reviews and edits
↓
- User attaches to products (optional)
↓
- AI generates embeddings (Voyage AI 1024D)
↓
- Document saved to knowledge_base table
↓
- Available in semantic search
API Endpoint: POST /api/knowledge-base/documents
Frontend Component: KnowledgeBaseHub.tsx
Documentation: knowledge-base-implementation.md
7. Agent Chat Flow
Purpose: Interactive AI assistance for various tasks
User Journey:
- User selects agent type:
- PDF Processor
- Search Assistant
- Product Expert
- Admin Helper
↓
- User sends message (text, images, or PDF)
↓
- Frontend calls agent-chat Edge Function
↓
- Mastra Agent processes request:
- Loads agent-specific prompt from database
- Analyzes user input
- Executes tools (search, PDF processing, etc.)
- Generates response
↓
- Response streamed to frontend
↓
- User continues conversation
Edge Function: agent-chat
Frontend Component: AgentHub.tsx
AI Model: Claude Sonnet 4.5
Documentation: agent-system.md
8. VR World Generation Flow
Purpose: Generate explorable 3D worlds from interior design images
User Journey:
- User generates interior design image via Agent
↓
- User clicks "Generate VR" button on DesignCanvas
↓
- AgentHub calls vrWorldService.generateVRWorld()
↓
- Edge function (generate-vr-world) orchestrates:
- Authenticates user
- Debits credits (50 mini / 200 plus)
- Inserts vr_worlds row (status: uploading)
- Uploads design image to WorldLabs (signed URL)
- Calls WorldLabs worlds:generate API
- Polls operations endpoint with backoff (2s → 10s)
- Extracts asset URLs (SPZ, GLB, panorama, thumbnail)
- Updates vr_worlds row (status: completed)
↓
- New assistant message added to chat with WorldViewer
↓
- WorldViewer polls vr_worlds table for status
↓
- On completion: Spark.js loads SPZ and renders 3D scene
↓
- User explores world:
- Orbit mode: drag to rotate, scroll to zoom
- First-person mode: WASD to move, mouse to look
- Quality selector: Draft / Standard / Full
- Fullscreen toggle
Edge Function: generate-vr-world
Frontend Component: WorldViewer.tsx
Service: vrWorldService.ts
External API: WorldLabs Marble (marble-0.1-mini, marble-0.1-plus)
Documentation: vr-world-generation.md
📊 Flow Summary
| Flow |
Entry Point |
AI Models |
Processing Time |
Output |
| PDF Processing |
Upload PDF |
Claude, GPT-4o, Qwen |
2-10 min |
Products, Images, Metadata |
| Search |
Search query |
OpenAI, Claude |
<1 sec |
Ranked results |
| Data Import |
Upload XML |
Claude |
1-5 min |
Products, Images |
| 3D Generation |
Text prompt |
Stable Diffusion |
10-30 sec |
3D models, Images |
| Knowledge Base |
Create doc |
OpenAI |
<1 sec |
Searchable docs |
| Agent Chat |
Send message |
Claude |
1-3 sec |
AI responses |
| VR World ✨ |
Generate VR button |
WorldLabs Marble |
30s-5min |
Explorable 3D world |
| Flow Automation ✨ |
Admin flow canvas |
Claude (actions) |
Real-time |
Automated actions |
| Interior Video ✨ |
Video type + image |
Veo-2/Kling/Wan/Runway |
1-5 min |
MP4 video |
| Virtual Staging ✨ |
Empty room image |
Replicate proplabs |
~56s |
Furnished render |
| Social Publish ✨ |
Post content + account |
Claude + Late.dev |
<5s |
Published post |
| Background Agent ✨ |
Cron / event / manual |
Claude + MIVAA API |
Varies |
Enriched data |
9. Flow Automation Flow
Purpose: Execute multi-step automated workflows in response to triggers
User Journey (Cron-triggered flow):
- Admin builds flow on xyflow canvas at
/admin/flows
↓
- Flow saved to
flows table (nodes + edges JSON)
↓
flow-scheduler-cron (every minute) detects flow is due
↓
- Invokes
flow-engine with action: 'execute-flow'
↓
- Engine walks the graph:
- Trigger node: extracts input data
- Condition nodes: evaluate if_else / switch / filter
- Action nodes: send SMS, send email, HTTP call, create notification
↓
- Execution result written to
flow_runs
User Journey (Webhook-triggered flow):
- External system POSTs to
flow-webhook?flow_id=<uuid>
↓
- Payload passed as
trigger.data to flow-engine
↓
- Same graph execution as above
Edge Functions: flow-engine, flow-scheduler-cron, flow-webhook
Frontend Component: Flow canvas at /admin/flows
Documentation: flow-engine.md
10. Social Media Publishing Flow
Purpose: Generate and publish AI content to social platforms
User Journey:
- User connects social account at
/profile (Social Accounts tab)
↓
late-oauth redirects to Late.dev OAuth → returns late_account_id
↓
- Account stored in
social_accounts
↓
- User (or KAI agent) generates content:
- Caption:
generate-social-content (2cr) → 3 variants
- Image:
generate-social-image (5-10cr) → stored in Supabase Storage
- Video:
generate-social-video (15-30cr) → stored in Supabase Storage
↓
- User selects caption variant + media → clicks Publish or Schedule
↓
late-publish action: publish_now or schedule with scheduled_at
↓
- Late.dev publishes to connected platform
↓
late-analytics syncs engagement metrics back to social_post_analytics
Edge Functions: late-oauth, generate-social-content, generate-social-image, generate-social-video, late-publish, late-analytics
Admin UI: /admin/social-media/accounts
Documentation: social-media-system.md
Last Updated: March 2026
Version: 3.5.0
Status: Production