• GenAI – How To Optimize Query Preprocessing & Embedding Component ?

    GenAI – How To Optimize Query Preprocessing & Embedding Component ? Table Of Contents: What Is Query Preprocessing & Embedding Layer. Where Can Latency Happen ? How To Reduce Latency (1) What Is Query Preprocessing & Embedding Layer ? (2) How Text Preprocessing Can Add Latency In The Process? What Is Compiled Regex ? Example-1: import re # Compile The Regex Pattern Once. pattern = re.compile(r'W+') #Use The Compiled pattern clean_text = pattern.sub(' '."This is @ a sample # text") print(clean_text) This is a sample text Example-2: import re non_alpha_pattern = re.compile(r'[^a-zA-Zs') def preprocess_text(): text = text.lower() text = non_alpha_pattern.sub(''

    Read More

  • GenAI – How To Optimize User Query Component ?

    GenAI – How To Optimize User Query Component ? Table Of Contents: What Is Query Input Component? Network Optimization Techniques. Use HTTP/2 or gRPC Compress Payloads Avoid Cold Start Problem (1) What Is Query Input Component ? (2) Network Optimization Techniques. (3) Use HTTP/2 or gRPC (4) Compress Payloads Use Compression (gzip or Brotli) import gzip import requests query = { “user_query”:”…” # a very large string } #Compress JSON compressed_data = gzip.compress(bytes(str(query), ‘utf-8’)) headers = { “Content-Encoding”: “gzip”, “Content-Type”: “application/json” } response = request.post(“http://localhost:8000/rag/query”, data=compressed_data, headers=headers) Use Decompression (gzip or Brotli) from fastapi import FastAPI, Request import gzip import

    Read More

  • GenAI – Scenario Based Q & A

  • GenAI – Approximate Nearest Neighbors (ANN)

    GenAI – Approximate Nearest Neighbors (ANN)

    GenAI – Approximate Nearest Neighbors (ANN) Table Of Contents: Foundational Concepts What is Nearest Neighbor Search (NNS)? Exact vs Approximate Nearest Neighbors Trade-offs: Speed vs Accuracy vs Memory Use cases in GenAI: Semantic Search, RAG, Recommendation Systems Distance Metrics Euclidean Distance Cosine Similarity Manhattan (L1) Distance Dot Product Similarity Choosing the right metric based on data and task Core ANN Algorithms & Techniques Locality-Sensitive Hashing (LSH) Concept and hash function families MinHash, SimHash Hierarchical Navigable Small World Graphs (HNSW) Graph-based ANN Navigation and hierarchy Product Quantization (PQ) Vector compression for large-scale retrieval IVF (Inverted File Index) + PQ Clustering +

    Read More

  • Machine Learning – Approximate Nearest Neighbors(ANNOY)

    Machine Learning – Approximate Nearest Neighbors(ANNOY)

    ML – Approximate Nearest Neighbors. Table Of Contents: What Is ANNOY Algorithm. Use Case Example. How ANNOY Works Step By Step. Trade Off Controls. Advantages Of Annoy. Limitation Of ANNOY. (1) What Is ANNOY Algorithm ? (2) Example Use Cases. (3) How Annoy Works — Step by Step Step-1: Input Data Preparation Step-2: Build Trees Using Random Projections Step-3: Save The Tree To The Desk Step-4: Querying / Searching (4) Trade-Off Controls (5) Advantages of Annoy (6) Limitation

    Read More

  • GenAI – Creative Co-Pilot Tools

  • GenAI – AI for Accessibility

  • GenAI – Crisis Management Simulators (Defense)

  • GenAI – Synthetic Biology & Chemistry Design