RETURN TO PORTFOLIODEEP CASE STUDY // ARCHITECTURE DOSSIER
FLAGSHIP AI BUILD // SYSTEM ARCHITECTURE

MCP-POWERED RAG
VIDEO INTELLIGENCE PLATFORM

An in-depth technical breakdown of an agentic semantic video search system built with Python, Streamlit, ChromaDB, and Anthropic's Model Context Protocol (MCP) — enabling sub-200ms clip grounding and conversational querying.

SEARCH LATENCYSub-200ms
TOOL PROTOCOLMCP Server
VECTOR DATABASEChromaDB
VERIFIED CERTS08 Badge

1. SYSTEM ARCHITECTURE & PIPELINE DATA FLOW

The platform decomposes long-form video content into temporal transcript chunks and synchronized keyframes. These elements are embedded into a local ChromaDB vector store and exposed via an MCP Server API so autonomous AI agents can invoke video queries directly as standard function tools.

PIPELINE GRAPH SCHEMATICSTRICT TIMESTAMP GROUNDED ✓
CLICK ANY STAGE TO INSPECT ITS INPUT / OUTPUT SPECDATA FLOW 7 STAGES ✓

2. TRADE-OFF ANALYSIS: WHAT WAS TRIED & DISCARDED

DISCARDED APPROACH #1

End-to-End Cloud Multimodal Embeddings

Initially attempted sending every video frame to cloud multi-modal embedding APIs.
Why Discarded: High API request costs ($12+/hr video) and excessive network roundtrip latency (>1.8s per query), rendering interactive chat unusable.

DISCARDED APPROACH #2

Monolithic Synchronous UI Ingestion

Initially ran frame extraction and embedding generation synchronously within the Streamlit UI thread.
Why Discarded: Froze the dashboard UI completely during long video processing runs. Rebuilt as an isolated background task queue with status polling.

3. BENCHMARK METHODOLOGY (SUB-200MS LATENCY CLAIM)

To achieve consistent sub-200ms retrieval bounds, query execution timing was benchmarked across 500 test queries on local NVMe storage using ChromaDB's HNSW index algorithm.

BENCHMARK STAGEAVERAGE LATENCYOPTIMIZATION PATTERN
Query Vector Tokenization14msFast local MiniLM ONNX runtime
ChromaDB Cosine HNSW Search42msIndexed local vector store (top_k=4)
Timestamp Bounds Filter & Deduplication18msIn-memory NumPy clip merge
MCP Tool Protocol Response Assembly35msLightweight JSON RPC tool payload
TOTAL END-TO-END LATENCY BOUND~109ms - 185msPASSED ✓

4. FUTURE ARCHITECTURAL IMPROVEMENTS (WITH MORE TIME)

Cross-Encoder Re-Ranker

Add a secondary cross-encoder re-ranking pass to refine top-k vector search results before sending payload bounds to the LLM.

Streaming SSE Response Chunks

Implement Server-Sent Events (SSE) streaming directly in the MCP tool endpoint so tokens stream to AI agents in real time.

Distributed Vector Sharding

Upgrade local ChromaDB to Qdrant or Milvus cloud cluster for multi-node vector index distribution across millions of video hours.