InspirationIn modern enterprise environments, up to 80% of data exists as unstructured information—ranging from technical documentation (PDFs, Markdown) and corporate diagrams (flowcharts, architecture schematics) to audio recordings of all-hands meetings and instructional videos. Traditional search engines rely heavily on keyword matching (BM25) or pure text-embedding retrieval, leaving non-text assets isolated in data silos.We were inspired to bridge this gap by building an Enterprise-Grade Multimodal Knowledge Base & Intelligent Retrieval System. Our goal was to create a unified platform capable of seamlessly ingesting, understanding, and retrieving information across text, image, audio, and video formats using Large Language Models (LLMs) and advanced Vision-Language Models (VLMs), enabling employees to query complex enterprise data using natural language.How We Built ItThe platform follows a modular, cloud-native RAG (Retrieval-Augmented Generation) and Multimodal Ingestion Architecture designed for scale, security, and low latency:Multimodal Ingestion Pipeline:Text & Documents: Extracted using OCR and document parsing tools (e.g., Unstructured, PyMuPDF) into clean text blocks.Images & Schematics: Processed through Vision-Language Models (e.g., GPT-4o / CLIP) to generate detailed semantic descriptions, contextual tags, and structural metadata.Audio & Video: Transcribed via Whisper AI with timestamps, followed by automated chunking based on semantic topic shifts.Unified Embedding & Hybrid Vector Storage:Text fragments and generated multimodal descriptions are mapped into a unified vector space using domain-adapted dense embedding models.Embeddings are stored in a high-performance vector store (Qdrant / Milvus) alongside a full-text sparse index (Elasticsearch) to support Hybrid Search.Hybrid Retrieval & Reranking Strategy:Combined Dense Retrieval (cosine similarity over vector embeddings) with Sparse Retrieval (BM25 keyword matching) using Reciprocal Rank Fusion (RRF).Passed the top-$K$ candidates to a Cross-Encoder Reranker model to optimize semantic relevance before context injection.Generation & Guardrails:Formatted context is passed to an LLM with strict enterprise guardrails to ensure factual grounding, hallucination minimization, and source attribution (citation links directly to source page/timestamp).Mathematical & Algorithmic Foundations1. Hybrid Search Fusion via Reciprocal Rank Fusion (RRF)To balance semantic understanding with exact match precision, we fuse dense vector ranks $R_{\text{dense}}(d)$ and sparse BM25 ranks $R_{\text{sparse}}(d)$ for a document $d$:$$RRF_Score(d \in D) = \sum_{m \in M} \frac{1}{k + R_m(d)}$$Where $M = {\text{dense}, \text{sparse}}$ and $k$ is a smoothing constant (typically set to $60$).2. Vector Cosine SimilarityFor semantic matching between query embedding $\mathbf{q}$ and chunk embedding $\mathbf{v}$:$$\text{Similarity}(\mathbf{q}, \mathbf{v}) = \frac{\mathbf{q} \cdot \mathbf{v}}{\Vert{}\mathbf{q}\Vert{}2 \Vert{}\mathbf{v}\Vert{}_2} = \frac{\sum{i=1}^{n} q_i v_i}{\sqrt{\sum_{i=1}^{n} q_i^2} \sqrt{\sum_{i=1}^{n} v_i^2}}$$Challenges We FacedCross-Modal Alignment & Noise: Extracting precise context from high-resolution PDF diagrams and dense architectural flowcharts without hallucinatory descriptive text proved difficult. We resolved this by implementing pre-processing region-of-interest (ROI) detection before passing image crops to the VLM.Latency Optimization in Reranking: Combining hybrid retrieval with a multi-stage reranker introduced unacceptable latency for real-time querying. We optimized this by applying asynchronous parallel retrieval and batching the Cross-Encoder inference.Chunking Strategies Across Media: Fixed-size text chunking failed on transcripts and multi-page manuals. Implementing dynamic, semantic-boundary chunking significantly improved context continuity.What We LearnedHybrid Search is Non-Negotiable: Dense vector search excels at conceptual intent, but fails on precise product codes, serial numbers, and enterprise jargon. A robust hybrid pipeline with BM25 + Cross-Encoder reranking is essential for enterprise production reliability.Metadata Richness Drives Retrieval Accuracy: Adding rich metadata (file hierarchy, modification dates, access permissions, media timestamps) during the ingestion phase drastically improves downstream filtering and access-control validation.

Built With

Share this project:

Updates

Submission history