<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harsh Singh on Medium]]></title>
        <description><![CDATA[Stories by Harsh Singh on Medium]]></description>
        <link>https://medium.com/@harshsingh26603?source=rss-139dfad8f6d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fISOnu1J6a025spoq4FDzA.jpeg</url>
            <title>Stories by Harsh Singh on Medium</title>
            <link>https://medium.com/@harshsingh26603?source=rss-139dfad8f6d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 07:25:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshsingh26603/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Multi-Document Agentic Retriever with LlamaIndex]]></title>
            <link>https://medium.com/bayes-labs/building-a-multi-document-agentic-retriever-with-llamaindex-f748aad1c34b?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f748aad1c34b</guid>
            <category><![CDATA[multi-documents]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llamaindex]]></category>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Mon, 05 May 2025 04:25:47 GMT</pubDate>
            <atom:updated>2025-05-05T04:25:47.743Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Note:</em></strong><em> The </em><a href="https://github.com/HaRsH00000007/Agentic_RAG/blob/main/Multi_doc_Agent.ipynb"><em>code</em></a><em> as well as the helping material can be found on my </em><a href="https://github.com/HaRsH00000007/Agentic_RAG"><em>GitHub repo</em></a><em>.</em></p><h3>Introduction</h3><p>Hello coding world !</p><p>So, today guys we are going to create a multi doc agent retriever. So let’s start from :</p><p>What is this thing called multi doc agent retriever?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*Fjxl6a4u134kUSslByr1Xw.png" /></figure><p>A <strong>multi-document agentic retriever</strong> is a system that orchestrates retrieval, summarization, and reasoning across several documents by leveraging a large language model (LLM) and specialized tools. Instead of manually searching each file or building isolated indices, a multi-document retriever agent automates discovery, vector search, contextual summarization, and function calling to meet complex user queries.</p><p>This article walks through the benefits of such an architecture, explains how to build a multi-document agentic retriever using LlamaIndex (formerly GPT-Index), and demonstrates a flexible, open-source-friendly design that you can adapt to your own use cases.</p><h3>Why Use a Multi-Document Agent Retriever?</h3><p>Building a single-document retriever is straightforward — read a file, index it, and answer queries. However, real-world applications often involve dozens or hundreds of files. A multi-doc agent retriever offers several key advantages:</p><ul><li><strong>Unified Query Interface</strong>: Users issue a single query and the agent automatically routes it to the most relevant document(s).</li><li><strong>Scalability</strong>: New documents can be added without rearchitecting the pipeline by just regenerating indices and extend the toolset.</li><li><strong>Contextual Awareness</strong>: By combining vector search with LLM-driven summarization, the agent maintains context across documents, resulting in more coherent and accurate answers.</li><li><strong>Tooling &amp; Function Calling</strong>: LlamaIndex’s FunctionTool and QueryEngineTool abstractions wrap index queries as callable functions, enabling the LLM to dynamically choose when to retrieve or summarize.</li><li><strong>Open‑Source Flexibility</strong>: The core pipeline uses open-source components — sentence-transformers for embeddings, vector stores, and LlamaIndex’s Python SDK — so you can plug in any LLM via HuggingFace, self‑hosted models, or managed APIs.</li></ul><h3>Architectural Overview</h3><p>At a high level, our multi-document agentic retriever consists of two tool types per document:</p><ol><li><strong>Vector Query Tool</strong>: Performs similarity search over document embeddings, optionally filtering by page or metadata.</li><li><strong>Summary Query Tool</strong>: Generates a holistic, tree‑structured summary of the document.</li></ol><p>These tools are registered with an agent runner that supports function calling. When given a user query, the LLM decides whether to invoke a vector search, a summary, or both and then stitches together the final answer.</p><p>Below is an outline of the main components:</p><pre>├── utils.py # Helper for building tools per document<br>│ ├── get_doc_tools() # Returns (vector_query_tool, summary_tool)<br>├── agent_setup.py # Main script<br>│ ├── Load documents # List of PDF paths<br>│ ├── Build tools # Call get_doc_tools for each file<br>│ ├── Initialize agent # Register tools with LLM<br>│ └── Query runner # Ask questions and receive answer</pre><h3>Code Walkthrough</h3><h3>1. Preparing Document Tools (utils.py)</h3><pre>from llama_index.core.node_parser import SentenceSplitter<br>from llama_index.core.tools import QueryEngineTool, FunctionTool<br>from llama_index.core.vector_stores import MetadataFilters, FilterCondition<br>from llama_index.embeddings.huggingface import HuggingFaceEmbedding<br>from llama_index.llms.google_genai import GoogleGenAI<br>from typing import List, Optional<br><br><br>def get_doc_tools(file_path: str, name: str, gemini_api_key: str):<br>    &quot;&quot;&quot;Builds vector and summary tools for a single document.&quot;&quot;&quot;<br>    # 1️ Initialize LLM and embedding model<br>    llm = GoogleGenAI(api_key=gemini_api_key, model=&quot;models/gemini-2.0-flash&quot;)<br>    embed_model = HuggingFaceEmbedding(<br>        model_name=&quot;sentence-transformers/all-MiniLM-L6-v2&quot;<br>    )<br><br>    # 2️ Load and split document into nodes<br>    documents = SimpleDirectoryReader(input_files=[file_path]).load_data()<br>    splitter = SentenceSplitter(chunk_size=1024)<br>    nodes = splitter.get_nodes_from_documents(documents)<br><br>    # 3️ Create vector index<br>    vector_index = VectorStoreIndex(nodes, embed_model=embed_model)<br><br>    # 4️ Define vector search function with optional metadata filters<br>    def vector_query(query: str, page_numbers: Optional[List[str]] = None) -&gt; str:<br>        page_numbers = page_numbers or []<br>        metadata_dicts = [{&quot;key&quot;: &quot;page_label&quot;, &quot;value&quot;: p} for p in page_numbers]<br>        query_engine = vector_index.as_query_engine(<br>            similarity_top_k=2,<br>            filters=MetadataFilters.from_dicts(<br>                metadata_dicts,<br>                condition=FilterCondition.OR<br>            ),<br>            llm=llm<br>        )<br>        return str(query_engine.query(query))<br><br>    # 5️ Wrap vector search as a callable function tool<br>    vector_query_tool = FunctionTool.from_defaults(<br>        name=f&quot;vector_query_{name}&quot;,<br>        fn=vector_query,<br>        description=(<br>            f&quot;Search the &#39;{name}&#39; document. ``query`` and optional ``page_numbers``&quot;<br>        )<br>    )<br><br>    # 6️ Build a summary index and tool<br>    summary_index = SummaryIndex(nodes)<br>    summary_engine = summary_index.as_query_engine(<br>        response_mode=&quot;tree_summarize&quot;,<br>        use_async=True,<br>        llm=llm<br>    )<br>    summary_tool = QueryEngineTool.from_defaults(<br>        name=f&quot;summarize_{name}&quot;,<br>        query_engine=summary_engine,<br>        description=f&quot;Get a holistic summary of the &#39;{name}&#39; document.&quot;<br>    )<br><br>    return vector_query_tool, summary_tool</pre><p><strong>Key Points:</strong></p><ul><li>We inject our API key at runtime, making it easy to swap LLMs.</li><li>Documents are split into semantically coherent chunks (nodes).</li><li>We build both a vector store (for fine-grained retrieval) and a summary index (for overviews).</li><li>Each tool is self-descriptive, enabling the agent’s function-calling mechanism to choose appropriately.</li></ul><h3>2. Orchestrating the Agent (agent_setup.py)</h3><pre>import sys<br>from pathlib import Path<br>import os<br>import nest_asyncio<br>from google.colab import userdata<br>from llama_index.embeddings.huggingface import HuggingFaceEmbedding<br>from llama_index.llms.google_genai import GoogleGenAI<br>from llama_index.core.agent import FunctionCallingAgentWorker, AgentRunner<br>from utils import get_doc_tools<br><br># 1️ Environment and dependency setup\ n<br>nest_asyncio.apply()<br>gemini_api_key = userdata.get(&#39;gemini_api&#39;)<br>os.environ[&#39;GEMINI_API_KEY&#39;] = gemini_api_key<br><br># 2️ Document paths\ n<br>paper_paths = [<br>    &quot;/content/longlora.pdf&quot;,<br>    &quot;/content/selfrag.pdf&quot;,<br>    &quot;/content/metagpt.pdf&quot;<br>]<br><br># 3️ Build tools for each document\ n<br>all_tools = []<br>for path in paper_paths:<br>    name = Path(path).stem<br>    v_tool, s_tool = get_doc_tools(path, name, gemini_api_key)<br>    all_tools.extend([v_tool, s_tool])<br><br># 4️ Initialize agent with all tools\ n<br>llm = GoogleGenAI(api_key=gemini_api_key, model=&quot;models/gemini-2.0-flash&quot;)<br>agent_worker = FunctionCallingAgentWorker.from_tools(<br>    tools=all_tools,<br>    llm=llm,<br>    verbose=True<br>)<br>agent = AgentRunner(agent_worker)<br><br># 5️ Querying\ n<br>response = agent.query(&quot;Tell me summary of self rag&quot;)<br>print(response)</pre><p><strong>Highlights:</strong></p><ul><li>We iterate over all paper paths and dynamically generate tools.</li><li>The agent is capable of function calling — behind the scenes it decides whether to call vector_query_&lt;name&gt; or summarize_&lt;name&gt; or both.</li><li>Verbose mode logs the function calls and raw outputs, aiding debugging.</li></ul><h4><strong>Output:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bC1ZtpRnRQgYeoYnwGNFQ.png" /></figure><h3>Conclusion</h3><p>A multi-document agentic retriever abstracts away the complexity of indexing, retrieval, and summarization across multiple files. By leveraging LlamaIndex’s tooling and modern LLMs (open source or API‑based), you can build powerful, scalable retrieval systems in just a few steps:</p><ol><li><strong>Create</strong> vector and summary tools per document.</li><li><strong>Register</strong> these tools with a function‑calling agent.</li><li><strong>Query</strong> the agent, letting the LLM orchestrate retrieval and reasoning.</li></ol><p>This pattern is broadly applicable — from research assistants and internal knowledge bases to customer support bots and beyond. Explore swapping in your favorite open‑source LLMs, enrich metadata filters, or integrate new data sources to tailor the system to your domain.</p><p>For your better understanding and practical implementation here’s my github : <a href="https://github.com/HaRsH00000007/Agentic_RAG/blob/main/Multi_doc_Agent.ipynb"><strong>Multi Doc Agent Retriever Code</strong></a></p><p>That’s it for today guys, Hope you liked this article please give a clap for the article till then Happy Coding Techies .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f748aad1c34b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/building-a-multi-document-agentic-retriever-with-llamaindex-f748aad1c34b">Building a Multi-Document Agentic Retriever with LlamaIndex</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Multi-Agent RAG with LlamaIndex and Open-Source Tools]]></title>
            <link>https://medium.com/bayes-labs/building-a-multi-agent-rag-with-llamaindex-and-open-source-tools-bf8ca8cf55d6?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8ca8cf55d6</guid>
            <category><![CDATA[calling-tool]]></category>
            <category><![CDATA[llamaindex]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 04:38:28 GMT</pubDate>
            <atom:updated>2025-03-28T12:01:19.599Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building RAG with LlamaIndex and Open-Source Tools</h3><p><strong><em>Note:</em></strong><em> The </em><a href="https://colab.research.google.com/drive/1sdJrjDbufYxOGRRJJTZb1_-yiIkKsAgw?usp=sharing"><em>code</em></a><em> as well as the helping material can be found on my </em><a href="https://github.com/HaRsH00000007/Agentic_RAG"><em>GitHub repo.</em></a></p><p>Let’s start from , what <strong>Retrieval-Augmented Generation (RAG)</strong> is and why it is used.</p><p>Large Language Models (LLMs) rely on static, pre-trained knowledge, which means they can generate outdated information and even hallucinate facts. RAG solves this by dynamically retrieving relevant external data in real time, improving factual accuracy and reducing hallucinations. This makes AI systems more reliable, scalable, and cost-efficient for real-world applications like chatbots, legal research, and medical AI.</p><p>So now let’s deep dive into this RAG thing ,RAG is a technique that enhances LLMs by retrieving external knowledge before generating responses. Instead of relying solely on pre-trained data, it pulls relevant information from sources like PDFs or databases, ensuring more accurate and up-to-date outputs. However, basic RAG systems have some limitations — they always retrieve data, even when summarization might be a better option, and they lack decision-making capabilities.</p><p>Then here comes Agents into action , Let me introduce you with agents guys:</p><p>Agents are autonomous systems that can <strong>perceive, reason, and take actions</strong> based on their environment. Unlike traditional AI models that follow a fixed path, <strong>agents enhance adaptability</strong> by dynamically selecting the best approach for a given task just like a human brain. In the context of RAG, agents play a crucial role in improving efficiency by deciding <strong>when to retrieve, summarize, or both</strong>.</p><p>An <strong>Agentic RAG (Retrieval-Augmented Generation)</strong> is an advanced version of traditional RAG that integrates <strong>intelligent agents</strong> to dynamically handle user queries. Unlike basic RAG, which follows a fixed retrieval process, <strong>Agentic RAG makes decisions</strong> on whether to retrieve, summarize, or combine both strategies based on the query’s intent.</p><p>The <strong>key innovation</strong> in Agentic RAG is its ability to <strong>route queries</strong> efficiently. Instead of always retrieving text chunks, it first <strong>understands the nature of the question</strong> and then selects the best approach — summarization, retrieval, or both. This enhances response accuracy, efficiency, and adaptability.</p><p>Agentic RAG improves upon traditional RAG by offering:</p><ul><li><strong>Smart Query Handling</strong> — Dynamically chooses the best method (retrieval or summarization) instead of blindly fetching documents.</li><li><strong>Better Efficiency</strong> — Reduces unnecessary retrievals, making responses <strong>faster and more relevant</strong>.</li><li><strong>Higher Adaptability</strong> — Adjusts responses based on different types of queries rather than following a rigid retrieval structure.</li><li><strong>Improved Accuracy</strong> — Prevents hallucinations by ensuring that <strong>only the most relevant information</strong> is used for generation.</li></ul><h4><strong>Basic RAG / Agentic RAG</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1rYn-CL-U7dlsvnsEycGJw.png" /></figure><h4><strong>Step-by-Step Implementation of Agentic RAG</strong></h4><p>To build an <strong>Agentic RAG system</strong>, follow these steps:</p><ul><li><strong>Step 1️: Setting Up the Environment</strong> — Install dependencies (llama-index, sentence-transformers, google-generativeai) and configure the <strong>Gemini API key</strong> for LLM integration.</li><li><strong>Step 2️: Loading &amp; Chunking Data</strong> — Load a <strong>PDF or text document</strong> using SimpleDirectoryReader and split it into <strong>smaller chunks</strong> using SentenceSplitter.</li><li><strong>Step 3️: Creating Indexes</strong> — Use <strong>Summary Index</strong> for summarization and <strong>Vector Store Index</strong> for semantic search.</li><li><strong>Step 4️: Configuring Query Engines</strong> — The <strong>Summary Query Engine</strong> generates concise summaries, while the <strong>Vector Query Engine</strong> retrieves relevant context.</li><li><strong>Step 5️: Building the Agentic Query Engine</strong> — Using <strong>Router Query Engine</strong>, the system intelligently routes queries to either <strong>summarization or retrieval</strong> based on the user’s input, making the responses smarter and more efficient.</li></ul><h4>RAG’s Anatomy: A Peek Inside the System!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uQLCr7fV7YHihbQoTWqbA.png" /></figure><h4>RAG in Action: Because Theory Alone Won’t Save Us!</h4><h4>Step 1: Installing Dependencies</h4><pre>!pip install llama-index<br>!pip install llama-index-llms-gemini<br>!pip install llama-index-embeddings-huggingface<br>!pip install sentence-transformers<br>!pip install transformers<br>!pip install google-generativeai</pre><p><strong>1. llama-index</strong></p><ul><li><strong>What it does:</strong> LlamaIndex (formerly GPT Index) is a framework for connecting LLMs with external data sources (like documents, databases, or APIs).</li><li><strong>Why we are using:</strong> It helps structure and index our data efficiently, making retrieval fast and effective.</li></ul><p><strong>2. llama-index-llms-gemini</strong></p><ul><li><strong>What it does:</strong> This is a plugin that allows Google Gemini to be used as the LLM within LlamaIndex.</li><li><strong>Why we are using:</strong> It enables us to run queries and generate responses using Gemini in our RAG pipeline.</li></ul><p><strong>3. llama-index-embeddings-huggingface</strong></p><ul><li><strong>What it does:</strong> This plugin integrates Hugging Face embeddings into LlamaIndex.</li><li><strong>Why we are using:</strong> It lets us use pre-trained Hugging Face models (sentence-transformers) to embed text for retrieval.</li></ul><p><strong>4. sentence-transformers</strong></p><ul><li><strong>What it does:</strong> A library for generating high-quality text embeddings .</li><li><strong>Why we are using:</strong> These embeddings help measure the semantic similarity between queries and documents.</li><li><strong>What we are using: </strong>We will be using <a href="https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2">sentence-transformers/all-MiniLM-L6-v2</a> because it’s easy to load and it’s completely open source.</li><li><strong>all-MiniLM-L6-v2: </strong>This is a <a href="https://www.sbert.net/">sentence-transformers</a> model, It maps sentences &amp; paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.</li></ul><p><strong>5. transformers</strong></p><ul><li><strong>What it does:</strong> Hugging Face’s core library for loading and using transformer models .</li><li><strong>Why we are using:</strong> It allows us to load LLMs and embedding models from Hugging Face.</li></ul><p><strong>6. google-generativeai</strong></p><ul><li><strong>What it does:</strong> Google’s official library for interacting with Gemini models via the API.</li><li><strong>Why we are using:</strong> It provides tools for sending prompts and retrieving responses from Google Gemini.</li></ul><h4><strong>Step 2: Setting Up API Access for Google Gemini</strong></h4><pre>import os<br>from google.colab import userdata<br>gemini_api_key = userdata.get(&#39;gemini_api&#39;)<br>os.environ[&quot;gemini_api&quot;] = gemini_api_key</pre><p>Before we dive into building our Retrieval-Augmented Generation (RAG) system, we need to set up access to Google Gemini, which will serve as our LLM (Large Language Model) for generating responses.</p><h4><strong>Step 3: Loading Data and Splitting It into Chunks</strong></h4><pre># Working Environment Setup<br>import os<br>from google.colab import userdata<br><br># If you are using jupyter notebook --&gt; to make asynch play nice with jupyter notebook<br># import nest_asyncio<br># nest_asyncio.apply()<br><br># Load Data/ Documents<br>from llama_index.core import SimpleDirectoryReader<br>documents = SimpleDirectoryReader(input_files=[&quot;/content/Data Science.pdf&quot;]).load_data()<br><br># Define Node Splitter<br>from llama_index.core.node_parser import SentenceSplitter<br>splitter = SentenceSplitter(chunk_size=1024)<br>nodes = splitter.get_nodes_from_documents(documents)<br><br># Set up Gemini LLM and HuggingFace Sentence Transformer for embeddings<br>from llama_index.core import Settings<br>from llama_index.llms.gemini import Gemini<br># Try the correct import path<br>from llama_index.embeddings.huggingface import HuggingFaceEmbedding<br><br># If the above doesn&#39;t work, try this alternative import<br># from llama_index.core.embeddings import HuggingFaceEmbedding<br><br># Configure Settings with Gemini for LLM and Sentence Transformer for embeddings<br>Settings.llm = Gemini(api_key=gemini_api_key, model=&quot;models/gemini-1.5-flash&quot;)<br>Settings.embed_model = HuggingFaceEmbedding(model_name=&quot;sentence-transformers/all-MiniLM-L6-v2&quot;)</pre><p><strong>Load the Document</strong></p><ul><li>Uses SimpleDirectoryReader to read <a href="https://drive.google.com/file/d/1Qkd4-Gs6RIXiJYUlxUP8CctHYaJhbq1D/view?usp=sharing"><strong>Data Science.pdf</strong></a> into memory.</li></ul><p><strong>Split the Document into Chunks</strong></p><ul><li>SentenceSplitter breaks the document into <strong>1024-token chunks</strong> for better retrieval.</li></ul><p><strong>Set Up the LLM (Gemini 1.5 Flash)</strong></p><ul><li>Configures <strong>Google Gemini</strong> as the LLM for fast response generation.</li></ul><p><strong>Set Up Embeddings (Hugging Face)</strong></p><ul><li>Uses <strong>sentence-transformers/all-MiniLM-L6-v2</strong> to convert text into vector embeddings for retrieval.</li></ul><h4><strong>Step 4: Creating Indexes for Retrieval</strong></h4><pre>from llama_index.core import SummaryIndex, VectorStoreIndex<br><br>summary_index = SummaryIndex(nodes)<br>vector_index = VectorStoreIndex(nodes)</pre><p>In this step, we create two types of indexes to efficiently retrieve information from our document.</p><ol><li><strong>SummaryIndex(nodes) — </strong>Summarization Index</li></ol><p>Creates a summary-based index by condensing information from document chunks.</p><p>Useful when you need a high-level overview instead of retrieving specific details.</p><p><strong>2. VectorStoreIndex(nodes) — </strong>Vector Index for Semantic Search</p><p>Converts chunks into vector embeddings for efficient semantic search.</p><p>Helps the LLM retrieve relevant text based on meaning, not just keywords.</p><p><strong>Why Use Both?</strong></p><ul><li><strong>SummaryIndex → </strong>Useful for generating concise summaries.</li><li><strong>VectorStoreIndex → </strong>Ideal for retrieving precise, contextually relevant information.</li></ul><h4><strong>Step 5: Creating Query Engines</strong></h4><pre>summary_query_engine = summary_index.as_query_engine(<br>    response_mode=&quot;tree_summarize&quot;,<br>    use_async=True,<br>)<br>vector_query_engine = vector_index.as_query_engine()</pre><p>Now that we have built SummaryIndex and VectorStoreIndex, we configure query engines to retrieve information from them.</p><ol><li><strong>summary_index.as_query_engine() — </strong>Summarization Engine</li></ol><p>1.1 Uses <strong>tree-based summarization</strong> to generate a <strong>high-level summary</strong> of the document.</p><p>1.2<strong> response_mode=”tree_summarize”</strong> — Organizes responses hierarchically for better summarization.</p><p>1.3<strong> use_async=True</strong> — Enables asynchronous execution for faster responses.</p><p><strong>2. vector_index.as_query_engine() — </strong>Semantic Search Engine</p><p>2.1 Retrieves <strong>semantically relevant</strong> chunks from the <strong>vector index</strong> based on user queries.</p><p>2.2 Works like a <strong>search engine</strong> that finds the most relevant passages instead of summarizing.</p><p><strong>Why Use Both?</strong></p><ul><li><strong>Summarization Engine</strong> → Best for generating summaries.</li><li><strong>Vector Search Engine</strong> → Best for retrieving <strong>specific</strong> information based on meaning.</li></ul><h4><strong>Step 6: Converting the above Query Engine to Query tools</strong></h4><pre>from llama_index.core.tools import QueryEngineTool<br><br>summary_tool = QueryEngineTool.from_defaults(<br>    query_engine=summary_query_engine,<br>    description=(<br>        &quot;Useful for summarization questions related to dataset&quot;<br>    ),<br>)<br><br>vector_tool = QueryEngineTool.from_defaults(<br>    query_engine=vector_query_engine,<br>    description=(<br>        &quot;Useful for retrieving specific context from the dataset.&quot;<br>    ),<br>)</pre><p>In this step, we convert the query engines into tools using QueryEngineTool, making them easily accessible for answering different types of questions.</p><p><strong>1 . Summarization Tool</strong></p><p>1.1 Wraps the Summarization Query Engine into a tool.</p><p>1.2 Best suited for high-level summaries of the document.</p><p>1.3 Why? → If a user asks for a summary, this tool provides a concise overview.</p><p><strong>2. Vector Search Tool</strong></p><ol><li>Wraps the Vector Query Engine into a tool.</li><li>Best for retrieving specific details from the document.</li><li>Why? → If a user needs precise information, this tool fetches the most relevant passages.</li></ol><h4><strong>Step 7: Implementing a Router Query Engine</strong></h4><pre>from llama_index.core.query_engine.router_query_engine import RouterQueryEngine<br>from llama_index.core.selectors import LLMSingleSelector<br><br><br>query_engine = RouterQueryEngine(<br>    selector=LLMSingleSelector.from_defaults(),<br>    query_engine_tools=[<br>        summary_tool,<br>        vector_tool,<br>    ],<br>    verbose=True<br>)<br><br># First query<br>response1 = query_engine.query(&quot;What is the summary of the document? \n&quot;)<br>print(response1.response.replace(&quot;. &quot;, &quot;.\n&quot;))<br><br># Second query<br>response2 = query_engine.query(&quot;What are Query Engines \n&quot;)<br>print(response2.response.replace(&quot;. &quot;, &quot;.\n&quot;))<br><br># Third Query<br>response3 = query_engine.query(&quot;Tell me about an idealized model \n&quot;)<br>print(response3.response.replace(&quot;. &quot;, &quot;.\n&quot;))</pre><p>In this final step, we combine both query engines into a <strong>Router Query Engine</strong>, which intelligently selects the best tool based on the user’s question.</p><p><strong>How It Works?</strong></p><ol><li><strong>Router Query Engine</strong></li></ol><p>1.1 Uses LLMSingleSelector to <strong>automatically decide</strong> whether to use the <strong>summarization tool</strong> or <strong>vector search tool</strong>.</p><p>1.2 Routes the query to the most <strong>relevant</strong> tool based on the question.</p><p><strong>2. Query Handling</strong></p><p>2.1 If the user asks for a <strong>summary</strong>, it directs the query to the <strong>summary tool</strong>.</p><p>2.2 If the user asks for <strong>specific details</strong>, it directs the query to the <strong>vector tool</strong> for retrieval.</p><p><strong>3. Displaying the Response</strong></p><p>3.1 Runs query_engine.query(“What is the summary of the document?”) to generate a response.</p><p>3.2 Formats the output for better readability by adding new lines after each sentence.</p><h4><strong>Final Output:</strong></h4><pre># Output of our First query<br>Selecting query engine 0: The question directly asks for a summary of the document, which aligns with the description of choice 1: &#39;Useful for summarization questions related to dataset&#39;..This book covers the theory expected to be useful in data science over the next 40 years.<br>It emphasizes probability, statistics, and numerical methods, and uses modern data representation as vectors with many components.<br>The book covers high-dimensional spaces, singular value decomposition (SVD), Markov chains, machine learning (including algorithms like Perceptron, stochastic gradient descent, boosting, and deep learning), <br>algorithms for massive data problems, clustering, random graphs, topic models, nonnegative matrix factorization, hidden Markov models, graphical models, and wavelets.<br>The appendix provides background material and exercises.<br>The book uses consistent notation, with lower-case letters for scalars, bold lower-case for vectors, and upper-case for matrices.<br>It also explains the concepts of &quot;almost surely&quot; and logarithmic notation.</pre><pre># Output of our Second query<br>Selecting query engine 1: Query engines are used to retrieve specific information from a dataset based on a query..<br>Based on the provided text, search engines solve two problems at query time:  (i) finding all webpages containing the <br>search terms and (ii) ranking those webpages.<br>The ranking is done offline for efficiency.</pre><pre># Output of our Third query<br>Selecting query engine 0: An idealized model is a concept or description, not a specific piece of context within a dataset.  Therefore, <br>a summary of information related to the concept of an idealized model would be more relevant than retrieving specific context from a dataset..<br>In an idealized topic model, each document is purely on a single topic, meaning each document&#39;s topic mixture vector has only one non-zero entry.<br>Additionally, the sets of terms that occur in different topics are disjoint, meaning each term appears in only one topic.<br>This results in a block structure in the term-document matrix, simplifying the problem of inferring the term-topic and topic-document matrices.</pre><blockquote><strong><em>Conclusion</em></strong></blockquote><p>In this article you’ve learnt about agentic <em>RAG </em>starting from building a router agent to tool calling to building your own agent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8ca8cf55d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/building-a-multi-agent-rag-with-llamaindex-and-open-source-tools-bf8ca8cf55d6">Building a Multi-Agent RAG with LlamaIndex and Open-Source Tools</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Text-to-Image Generation with Latest Models]]></title>
            <link>https://medium.com/bayes-labs/a-comprehensive-guide-to-text-to-image-generation-with-latest-models-3b995cc8743e?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b995cc8743e</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Mon, 30 Dec 2024 05:42:51 GMT</pubDate>
            <atom:updated>2024-12-30T06:10:10.490Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Text-to-image generation has emerged as one of the most fascinating applications of generative AI. This technology allows machines to create realistic or artistic images from textual descriptions, bridging the gap between natural language processing and computer vision. In this article, we’ll explore the latest models driving innovations in this field, their accuracy, and links to learn more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*857JgQ-73dv5G5QJ0RbgiQ.png" /></figure><h3>What is Text-to-Image Generation?</h3><p>Text-to-image generation involves training models to translate textual input into visual representations. This requires an understanding of the semantics of the text and its visual correlates. The applications are vast, ranging from creative design to accessibility and education.</p><h3>Latest Models in Text-to-Image Generation</h3><h3>1. DALL·E 3</h3><ul><li><strong>Developer</strong>: OpenAI</li><li><strong>Key Features</strong>: Enhanced realism, improved understanding of textual context, and better handling of complex prompts compared to its predecessors.</li><li><strong>Accuracy</strong>: DALL·E 3 has shown significant improvements in fidelity and coherence, achieving state-of-the-art results on benchmark datasets.</li><li><strong>Link</strong>: <a href="https://openai.com/dall-e">OpenAI DALL·E</a></li></ul><h3>2. Stable Diffusion XL (SDXL)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hcBOnTM0ZiIKHMVJYEKRA.png" /></figure><ul><li><strong>Developer</strong>: Stability AI</li><li><strong>Key Features</strong>: High-quality image generation, scalability for large prompts, and faster inference times.</li><li><strong>Accuracy</strong>: Outperforms previous versions on user-defined quality metrics and has a higher Image Fidelity Score.</li><li><strong>Link</strong>: <a href="https://stability.ai/">Stability AI SDXL</a></li></ul><h3>3. DeepFloyd IF</h3><ul><li><strong>Developer</strong>: DeepMind</li><li><strong>Key Features</strong>: Multi-modal capabilities integrating text and image generation, strong performance in detail-oriented prompts.</li><li><strong>Accuracy</strong>: Demonstrated exceptional results in generating photorealistic images with high semantic alignment.</li><li><strong>Link</strong>: <a href="https://huggingface.co/DeepFloyd/IF-I-M-v1.0">DeepFloyd</a></li></ul><h3>4. Imagen</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jZfTnPNyvWNrU_kNVbkHw.png" /></figure><ul><li><strong>Developer</strong>: Google Research</li><li><strong>Key Features</strong>: Focused on generating photorealistic images with a deep understanding of text semantics using diffusion models.</li><li><strong>Accuracy</strong>: Benchmarked with superior FID (Fréchet Inception Distance) scores compared to other leading models.</li><li><strong>Link</strong>: <a href="https://cloud.google.com/use-cases/text-to-image-ai#how-it-works">Google Imagen</a></li></ul><h3>Evaluation Metrics</h3><p>To assess the performance of text-to-image models, researchers rely on the following key metrics:</p><ul><li><strong>Fréchet Inception Distance (FID)</strong>: Measures the similarity between generated images and real images.</li><li><strong>CLIP Score</strong>: Evaluates alignment between generated images and text prompts using CLIP embeddings.</li><li><strong>Human Evaluation</strong>: Subjective assessments of image quality and relevance.</li></ul><h3>Practical Applications</h3><ul><li><strong>Creative Design</strong>: Assists artists in generating concept art, illustrations, and storyboards.</li><li><strong>Education</strong>: Creates visual aids for better understanding of complex topics.</li><li><strong>Entertainment</strong>: Generates immersive visuals for video games and films.</li><li><strong>Accessibility</strong>: Helps visually impaired users visualize textual content.</li></ul><h3>Conclusion</h3><p>Text-to-image generation continues to evolve, offering increasingly realistic and contextually relevant outputs. Models like DALL·E 3, Stable Diffusion XL, DeepFloyd IF, and Imagen exemplify the state of the art. These advancements not only push the boundaries of creativity but also pave the way for significant societal impact. From enabling inclusive designs for accessibility to revolutionizing content creation, the potential of text-to-image generation is immense.</p><p>As research continues, we can anticipate models with even greater contextual understanding, higher resolution outputs, and reduced computational costs. Additionally, the integration of ethical AI practices will be critical in ensuring that this technology is used responsibly. Future developments may also involve the blending of text-to-image generation with other modalities, such as audio and video synthesis, to create richer, multi-sensory experiences.</p><p>The journey of text-to-image generation is just beginning, and its applications will likely redefine how we interact with AI, creativity, and technology in the years to come. Keeping an eye on the latest innovations and exploring these tools can provide a significant advantage for developers, researchers, and enthusiasts alike.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*y6SOZXNPI-NtplddSVEBMw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b995cc8743e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/a-comprehensive-guide-to-text-to-image-generation-with-latest-models-3b995cc8743e">A Comprehensive Guide to Text-to-Image Generation with Latest Models</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revolutionizing Travel: Alaska Airlines’ AI-Powered Conversational Search]]></title>
            <link>https://medium.com/bayes-labs/revolutionizing-travel-alaska-airlines-ai-powered-conversational-search-7f7c31f4fd84?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f7c31f4fd84</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 12:20:42 GMT</pubDate>
            <atom:updated>2024-12-20T12:27:42.536Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*_LL3CL47borZ_QhM1uRy2w.png" /></figure><h3>Introduction</h3><p>In the ever-evolving world of travel, customer experience is a cornerstone of success. Alaska Airlines, a pioneer in innovative solutions, is setting new benchmarks by integrating cutting-edge AI technology to redefine how travelers interact with its services. By introducing a natural language search chatbot, the airline is transforming its customer service into an intuitive, conversational experience that mirrors interactions with a seasoned travel agent. This initiative is not just about streamlining travel bookings but also about deepening customer engagement and reinforcing Alaska Airlines’ commitment to excellence.</p><h3>Key Features of the AI-Powered Chatbot</h3><ol><li><strong>Conversational Search:</strong> The chatbot allows travelers to ask questions and make bookings using natural language, eliminating the need to navigate complex menus or search interfaces.</li><li><strong>Personalized Recommendations:</strong> Leveraging AI, the chatbot analyzes user preferences, travel history, and real-time data to suggest tailored travel options.</li><li><strong>Real-Time Assistance:</strong> From flight queries to baggage policies, the chatbot provides instant and accurate responses, ensuring seamless communication.</li><li><strong>Multi-Platform Accessibility: </strong>Available on the website, mobile app, and messaging platforms, the chatbot ensures accessibility across devices.</li><li><strong>Integration with Existing Systems:</strong> It integrates seamlessly with Alaska Airlines’ existing booking and customer service systems, creating a unified experience for users.</li></ol><h3>Benefits of the AI-Powered Chatbot</h3><ol><li><strong>Enhanced User Experience</strong>: The natural language interface makes travel planning simpler and more intuitive for users.</li><li><strong>Time Efficiency</strong>: By providing instant responses and personalized options, the chatbot significantly reduces the time required to plan and book travel.</li><li><strong>Cost-Effective Customer Support</strong>: Automating routine queries allows Alaska Airlines to allocate resources to more complex customer needs, optimizing operational efficiency.</li><li><strong>Increased Engagement</strong>: The interactive and user-friendly nature of the chatbot encourages greater engagement with the brand.</li><li><strong>Data-Driven Insights</strong>: Interactions with the chatbot provide valuable data, enabling the airline to understand customer needs better and refine its offerings.</li></ol><h3>Why This Innovation is Important</h3><p>The travel industry is highly competitive, and customer expectations are continually rising. Alaska Airlines’ AI-powered chatbot addresses several key challenges:</p><ul><li><strong>Meeting Modern Expectations</strong>: Travelers today expect services to be fast, personalized, and easily accessible. The chatbot meets these demands by offering a conversational interface that adapts to individual needs.</li><li><strong>Reinforcing Brand Loyalty</strong>: By providing exceptional customer experiences, Alaska Airlines strengthens its relationship with travelers, fostering long-term loyalty.</li><li><strong>Pioneering Innovation</strong>: As one of the first airlines to embrace natural language AI for customer interaction, Alaska Airlines positions itself as a leader in technological adoption, setting a precedent for the industry.</li></ul><h3>Broader Implications for the Industry</h3><p>The integration of AI in customer interactions is not just a technological advancement but a paradigm shift for the travel industry. It highlights the potential of AI to:</p><ul><li>Simplify complex processes like flight booking and itinerary planning.</li><li>Bridge communication gaps between travelers and service providers.</li><li>Drive innovation in ancillary services like travel insurance, hotel bookings, and more.</li></ul><h3>Conclusion</h3><p>Alaska Airlines’ venture into AI-powered conversational search marks a significant milestone in the evolution of travel experiences. By leveraging the capabilities of natural language processing and machine learning, the airline is not only simplifying travel planning but also redefining customer service standards. This initiative exemplifies how technology, when used thoughtfully, can create meaningful connections and memorable journeys for travelers. As Alaska Airlines leads the way, it’s clear that the future of travel is conversational, intelligent, and deeply personalized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f7c31f4fd84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/revolutionizing-travel-alaska-airlines-ai-powered-conversational-search-7f7c31f4fd84">Revolutionizing Travel: Alaska Airlines’ AI-Powered Conversational Search</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The HeyGen Revolution: Transforming Content Creation with AI]]></title>
            <link>https://medium.com/bayes-labs/the-heygen-revolution-transforming-content-creation-with-ai-cfa7c7b01be3?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfa7c7b01be3</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Tue, 03 Dec 2024 14:42:50 GMT</pubDate>
            <atom:updated>2024-12-03T14:50:18.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*HTqPZF3J2VOEgfddCuZxVA.png" /></figure><p>In the fast-paced world of content creation, staying ahead means leveraging the latest in artificial intelligence (AI). Enter <strong>HeyGen</strong>, a groundbreaking platform that is revolutionizing the way businesses, creators, and marketers produce video content. From its seamless workflows to its innovative capabilities, HeyGen is setting a new benchmark for AI-powered video generation.</p><h3>What is HeyGen?</h3><p>HeyGen is an advanced AI-based video generation platform that empowers users to create high-quality videos with minimal effort. It uses state-of-the-art algorithms to turn text into engaging video content, complete with customizable avatars, multilingual voiceovers, and an array of creative editing options. Whether you’re crafting a marketing pitch, an educational tutorial, or an interactive story, HeyGen provides tools that cater to diverse industries.</p><h3>Key Features of HeyGen</h3><ul><li><strong>AI-Powered Avatars</strong><br>HeyGen allows users to generate hyper-realistic avatars that mimic natural human expressions and gestures. These avatars can be tailored to represent your brand, delivering messages with a personal touch.</li><li><strong>Text-to-Video Generation</strong><br>One of HeyGen’s standout features is its ability to turn scripts into full-fledged videos. You simply input your text, and the platform handles the rest, including visuals, animations, and voiceovers.</li><li><strong>Multilingual Support</strong><br>With support for over 40 languages, HeyGen makes creating localized content seamless. It also provides options for accents, ensuring your video resonates with diverse audiences.</li><li><strong>Dynamic Video Editing</strong><br>HeyGen’s intuitive interface allows users to customize video templates, add text overlays, adjust backgrounds, and include logos, making the final product truly unique.</li><li><strong>Ease of Use</strong><br>No prior video editing experience? No problem. HeyGen’s user-friendly platform is designed for beginners and professionals alike, enabling anyone to produce professional-quality videos in minutes.</li></ul><h3>Why is HeyGen Booming in the Market?</h3><p>HeyGen’s rise to prominence can be attributed to its ability to address pain points in traditional video production. Here’s why it has become a sensation:</p><ul><li><strong>Cost-Effectiveness</strong>: Traditional video production is often expensive and time-consuming. HeyGen eliminates the need for studio setups, actors, and post-production teams, significantly reducing costs.</li><li><strong>Scalability</strong>: Businesses can produce multiple videos quickly, allowing them to scale their marketing efforts and reach wider audiences effortlessly.</li><li><strong>Engagement</strong>: Personalized, AI-generated avatars make content more relatable and engaging, leading to higher viewer retention rates.</li><li><strong>Global Reach</strong>: The multilingual feature enables businesses to break language barriers and connect with audiences worldwide.</li></ul><h3>A Market Revolution</h3><p>HeyGen is not just a tool; it’s a revolution in content creation. It democratizes video production, making it accessible to small businesses, freelancers, educators, and even individuals. By eliminating barriers like cost and complexity, it enables users to focus on creativity and messaging.</p><p>Moreover, HeyGen represents a broader shift in how AI is integrated into creative industries. It’s a testament to the growing trend of <strong>AI-driven democratization of tools</strong>, where complex technologies become easy to use and widely available.</p><h3>Final Thoughts</h3><p>As we navigate a world where content is king, platforms like HeyGen are proving to be game-changers. Whether you’re a marketer aiming to enhance your outreach or an educator looking to simplify communication, HeyGen offers unparalleled capabilities.</p><p>In essence, HeyGen is more than a platform; it’s a movement toward smarter, faster, and more inclusive video creation. The future of content is here, and it’s powered by HeyGen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfa7c7b01be3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/the-heygen-revolution-transforming-content-creation-with-ai-cfa7c7b01be3">The HeyGen Revolution: Transforming Content Creation with AI</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI is Powering the 10-Minute Delivery Revolution: The Case of Blinkit]]></title>
            <link>https://medium.com/bayes-labs/how-ai-is-powering-the-10-minute-delivery-revolution-the-case-of-blinkit-8abf541b85e1?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8abf541b85e1</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 04:10:33 GMT</pubDate>
            <atom:updated>2024-11-18T07:09:44.261Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*9JI_fWH1H1KjYfDoPy5l3w.png" /></figure><h3>Introduction</h3><p>In an era where customer expectations for convenience are higher than ever, the demand for ultra-fast delivery has led startups like Blinkit, Swiggy Instamart, and Zomato to pioneer 10-minute delivery services. While this speed is highly attractive, achieving it is challenging due to the complexities of supply chain logistics, inventory management, and delivery route optimization. Artificial Intelligence (AI) is at the forefront of making this model feasible, optimizing every step of the process to deliver goods in under 10 minutes.</p><h3>The Challenge of 10-Minute Delivery</h3><p>The 10-minute delivery model faces several challenges:</p><ul><li><strong>Stock Management:</strong> Ensuring that the right items are always available.</li><li><strong>Predicting Demand:</strong> Accurately forecasting demand to avoid understocking or overstocking.</li><li><strong>Route Optimization:</strong> Planning the fastest route considering traffic and other obstacles.</li><li><strong>Warehouse Proximity:</strong> Ensuring delivery locations are close enough to fulfill promises.</li><li><strong>Labor Management:</strong> Scheduling and managing delivery staff to maintain service levels.</li></ul><p>Without AI, the coordination of these elements would be nearly impossible to achieve at scale.</p><h3>How AI is Enabling 10-Minute Delivery</h3><p>AI has become the backbone of ultra-fast delivery, helping startups address various operational challenges:</p><ol><li><strong>Demand Forecasting:</strong> AI models analyze historical data, seasonal trends, and local preferences to predict which items will be in demand at specific times. This data helps maintain optimal inventory levels and prevents stockouts.</li><li><strong>Inventory Optimization:</strong> Machine learning algorithms identify fast-moving items and arrange them to be more accessible. This helps reduce the time taken to pack and dispatch orders.</li><li><strong>Real-Time Route Optimization:</strong> AI-driven route optimization algorithms use traffic data, weather conditions, and even road closures to plan the fastest route, ensuring that drivers can meet the 10-minute window.</li><li><strong>Labor Scheduling and Management:</strong> AI optimizes labor by predicting peak times and scheduling delivery staff accordingly, ensuring that drivers are available during high-demand periods.</li><li><strong>Personalization and Recommendations:</strong> AI algorithms can personalize recommendations based on users’ past orders, increasing the likelihood of repeat purchases and enhancing the customer experience.</li><li><strong>Fraud Detection and Risk Management:</strong> AI helps to detect fraudulent orders or unusual behavior, reducing the risk and cost associated with these incidents.</li></ol><h3>Case Study: How Blinkit Uses AI to Power 10-Minute Delivery</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*El5BPSw9PONN6q8iAXIhNQ.png" /></figure><p>Blinkit, one of India’s leading ultra-fast delivery startups, leverages AI in several ways to fulfill its 10-minute delivery promise:</p><ol><li><strong>Hyperlocal Micro-Warehouses</strong> Blinkit has set up numerous micro-warehouses strategically located near high-demand zones. These micro-warehouses stock only the most in-demand products in the area, which AI identifies through a combination of demand forecasting and data analytics. By using AI-driven predictive analytics, Blinkit ensures that items are stocked where they’re most needed, optimizing fulfillment times.</li><li><strong>Dynamic Inventory Management</strong> Blinkit’s AI systems continuously track and update the stock in each warehouse. By analyzing real-time sales data and trends, AI models adjust inventory levels dynamically, ensuring popular items are always in stock. This automated replenishment system not only reduces human error but also cuts down on the time needed to restock.</li><li><strong>Demand Prediction Algorithms</strong> To maintain efficiency, Blinkit utilizes machine learning algorithms to predict demand at various times of the day and for different locations. This prediction model helps them keep the right inventory on hand, reducing both the risk of running out of stock and the cost of overstocking items that aren’t in demand.</li><li><strong>AI-Driven Route Optimization</strong> Blinkit employs real-time route optimization using AI to find the fastest paths for delivery riders. By factoring in current traffic, road conditions, and even the number of riders available in an area, Blinkit ensures the quickest delivery routes. These algorithms are continuously learning and improving, so they get better over time at predicting traffic patterns and avoiding delays.</li><li><strong>Customer Personalization</strong> Blinkit’s AI system also tailors product recommendations for customers based on their order history, which not only enhances the user experience but also increases order volume. This personalization is a key component in keeping users engaged with the platform and making the 10-minute delivery model sustainable.</li><li><strong>Quality Control and Real-Time Feedback</strong> AI tools monitor the quality of delivered goods by analyzing customer feedback. If a pattern emerges, such as complaints about a particular product or delivery timing, the AI flags this data for review, allowing Blinkit to address the issue quickly.</li></ol><h3>The Future of AI in Ultra-Fast Delivery</h3><p>AI’s role in 10-minute delivery is indispensable, enabling Blinkit and similar startups to meet growing customer expectations while operating efficiently. As AI technology continues to evolve, the ultra-fast delivery model will likely become even more sophisticated, with improved demand predictions, further route optimization, and enhanced customer personalization. Blinkit’s AI-driven approach to logistics is setting new standards in the delivery industry, offering a glimpse into a future where customers can get what they need almost instantly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8abf541b85e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/how-ai-is-powering-the-10-minute-delivery-revolution-the-case-of-blinkit-8abf541b85e1">How AI is Powering the 10-Minute Delivery Revolution: The Case of Blinkit</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PUMA: EMPOWERING UNIFIED MLLM WITH MULTI GRANULAR VISUAL GENERATION]]></title>
            <link>https://medium.com/bayes-labs/puma-empowering-unified-mllm-with-multi-granular-visual-generation-875c67cfd070?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/875c67cfd070</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 03:33:19 GMT</pubDate>
            <atom:updated>2024-11-07T07:59:32.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*GNaePHHCRVOf_63cjb3h6w.png" /></figure><h3>Introduction</h3><p>The rise of <strong>multimodal AI models</strong> has transformed how we interact with visual and textual data, pushing the boundaries of <strong>artificial intelligence</strong> and moving closer to <strong>artificial general intelligence (AGI)</strong>. These models are capable of generating images from text, understanding visual content, and even editing images based on simple prompts. However, creating a unified model that excels across a range of tasks — like <strong>image generation, editing, and understanding </strong>— remains a major challenge due to the need for <strong>both diversity and controllability</strong> in visual outputs.</p><p>Enter <strong>PUMA</strong>: a novel multimodal large language model (MLLM) designed to bridge the gap between diverse image generation and precise image manipulation. In this blog, we’ll explore the challenges that existing models face, how <strong>PUMA addresses these issues</strong>, and the <strong>potential future applications </strong>of this groundbreaking model.</p><h3>Key Challenges in Multimodal Visual Generation</h3><p>While multimodal models are increasingly capable, achieving a balance between <strong>diversity</strong> and <strong>controllability</strong> across different visual tasks is complex. Below are some of the main challenges:</p><ol><li><strong>Diverse vs. Controllable Generation:</strong> Generating diverse images from a single text prompt and achieving controllable image edits each demand unique model capabilities. For diverse generation, the model must capture broad, high-level semantics without being overly specific, allowing it to produce multiple variations of an idea — like generating various interpretations of “a sunny landscape.” In contrast, controllable generation tasks, such as image editing or inpainting, require high precision and fidelity to the original image. These tasks involve specific modifications, like object removal or subtle style adjustments, where fine-grained control is essential to maintain the integrity of the original content while applying precise changes.</li><li><strong>Single-Granularity Limitation:</strong> Previous models, such as <strong>SEED-LLaMA</strong> and <strong>SEED-X</strong>, use <strong>single granular visual representations</strong>, where images are processed and generated at one fixed level of detail. This leads to a trade-off: if optimized for high detail, models struggle with generating diverse images; if optimized for diversity, they often lack the precision needed for tasks like editing.</li><li><strong>Unified Framework Complexity:</strong> A unified model capable of excelling at both image generation and understanding presents a technical challenge. Tasks like <strong>image inpainting</strong> and <strong>conditional generation</strong> require handling multiple levels of detail while still being efficient and user-friendly. Achieving this within one framework remains an unmet need in the field of multimodal AI.</li></ol><h3><strong>How PUMA Solves These Challenges</strong></h3><p>The <strong>PUMA </strong>model (emPowering Unified MLLM with Multi-grAnular Visual Generation) introduces a <strong>multi-granular framework</strong> to overcome the limitations of single-granularity models. Here’s how PUMA effectively addresses each of these challenges:</p><ol><li><strong>Multi-Granular Visual Decoding:</strong></li></ol><p><strong>a.</strong> PUMA introduces a <strong>multi-granularity approach</strong> that extracts image features at different levels of detail, from the finest (f0 scale) to the most abstract (f4 scale). By employing these varying scales, PUMA is capable of adjusting the detail level to meet the requirements of each specific task:</p><p><strong>i. f0 Scale:</strong> Used for tasks requiring fine-grained control, such as detailed image editing.</p><p><strong>ii. f4 Scale:</strong> Employed for high-level, diverse image generation tasks, where the model captures overall shapes and semantics rather than specific details.</p><p><strong>b.</strong> This multi-granular approach allows PUMA to balance <strong>diversity and precision</strong> across a variety of visual tasks within a single, unified framework.</p><p><strong>2. Task-Specific Instruction Tuning:</strong></p><p><strong>a.</strong> After initial pretraining on multimodal datasets, PUMA undergoes a <strong>task specific instruction tuning</strong> phase. This fine-tuning adapts the model for specialized tasks, ensuring optimal performance:</p><p>i. For <strong>text-to-image generation</strong>, PUMA is tuned on aesthetically focused datasets to generate diverse, high-quality images from text.</p><p>ii. For <strong>image manipulation</strong> and<strong> conditional image generation</strong> (e.g., inpainting and colorization), PUMA is trained to maintain fidelity to the original image while making precise modifications.</p><p><strong>b.</strong> This two-phase training process — multimodal pretraining followed by instruction tuning — enables PUMA to handle a broad range of tasks effectively.</p><p><strong>3. Unified Model for Diverse Applications:</strong></p><p><strong>a.</strong> Unlike SEED-LLaMA and SEED-X, which are primarily optimized for either diversity or control, <strong>PUMA is designed to handle both</strong>. Its architecture includes a <strong>diffusion-based decoder </strong>that reconstructs images at different granularities, enabling it to maintain high-quality outputs regardless of the task’s granularity requirements.</p><p><strong>b. </strong>PUMA’s flexibility allows it to excel in tasks like <strong>image understanding</strong> (visual question answering), <strong>conditional generation</strong>, and <strong>fine-grained image reconstruction</strong>. The model is thus capable of performing a wide range of multimodal tasks within a single framework, making it a major advancement toward AGI.</p><h3>Future Work and Potential Developments</h3><p>The development of PUMA is an exciting step, but there are still areas where future research and improvements can push the boundaries further:</p><ol><li><strong>Real-Time Performance and Optimization:</strong></li></ol><p>While PUMA’s multi-granular framework is powerful, optimizing it for real time applications remains a challenge. Reducing computational costs without sacrificing quality could make PUMA applicable for interactive applications like live video editing or real-time image manipulation.</p><p><strong>2. Extended Multimodal Capabilities:</strong></p><p>Future iterations of PUMA could integrate <strong>audio</strong>, <strong>3D modeling</strong>, or <strong>even video data</strong>, enabling the model to work across a wider array of multimedia inputs and outputs. This would expand its potential use cases in fields such as virtual reality, film production, and immersive gaming.</p><p><strong>3. Enhanced Task-Specific Tuning:</strong></p><p>Task-specific tuning could be extended to more complex tasks, such as <strong>medical imaging</strong> or<strong> scientific visualization</strong>. By training on domain specific datasets, PUMA could become a specialized tool for high-stakes fields requiring precision and control.</p><p><strong>4. Personalized Visual Generation:</strong></p><p>Incorporating a layer for <strong>user-specific preferences</strong> in visual generation could allow PUMA to produce images based on personal styles or specific artistic requirements, enhancing its utility for creative industries like digital art, graphic design, and fashion.</p><p><strong>5. Improved User Interface and Accessibility:</strong></p><p>Building a more user-friendly interface around PUMA’s capabilities would make it accessible to a broader range of users, from artists and designers to researchers and educators. Simplified controls for setting granularities or selecting output diversity could be developed for a seamless user experience.</p><h3>Conclusion</h3><p>PUMA represents a significant advancement in multimodal AI, setting a new standard for how models can approach visual generation tasks with both diversity and precision. By incorporating multi-granular visual decoding and a comprehensive two-phase training process, PUMA effectively addresses the challenges that have limited previous models. With ongoing research and optimization, PUMA holds the potential to unlock even more applications across creative, scientific, and interactive domains, bringing us closer to the goal of truly versatile artificial general intelligence.</p><h3>References</h3><ol><li><strong>Primary Research Paper</strong>:</li></ol><ul><li>Fang, R., Duan, C., Wang, K., Li, H., Tian, H., Zeng, X., Zhao, R., Dai, J., Li, H., Liu, X. (2024). <em>PUMA: Empowering Unified MLLM with Multi-Granular Visual Generation</em>. <a href="https://arxiv.org/abs/2410.13861">Available Here</a>.</li></ul><p><strong>2. Related Works on Multimodal Models</strong>:</p><ul><li>Liu, H., Li, C., Wu, Q., Lee, Y. J. (2024). <em>LLaVA: Enhancing Vision-Language Understanding with Large Language Models</em>. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.</li><li>Zhu, J., Chen, X., Shen, X., Li, X., Elhoseiny, M. (2023). <em>MiniGPT-4: Advancing Vision-Language Models with LLM Integration</em>.<a href="https://arxiv.org/abs/2304.10592"> Available Here</a>.</li></ul><p><strong>3. Foundational Concepts</strong>:</p><ul><li>Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., Chen, M. (2022). <em>Hierarchical Text-Conditional Image Generation with CLIP Latents</em>. Available at <a href="https://arxiv.org/abs/2204.06125">arXiv</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=875c67cfd070" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/puma-empowering-unified-mllm-with-multi-granular-visual-generation-875c67cfd070">PUMA: EMPOWERING UNIFIED MLLM WITH MULTI GRANULAR VISUAL GENERATION</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revolutionizing Global Logistics with Swoop Aero’s End-to-End Drone Platform]]></title>
            <link>https://medium.com/bayes-labs/revolutionizing-global-logistics-with-swoop-aeros-end-to-end-drone-platform-b5022162fb08?source=rss-139dfad8f6d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5022162fb08</guid>
            <dc:creator><![CDATA[Harsh Singh]]></dc:creator>
            <pubDate>Mon, 04 Nov 2024 10:20:44 GMT</pubDate>
            <atom:updated>2024-11-06T13:04:11.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X48fhqJI603GNbaGTy9cHg.png" /></figure><p>In many remote regions, access to essential medical supplies and timely healthcare support remains a significant challenge. Limited infrastructure, challenging terrain, and regulatory restrictions often make it nearly impossible for healthcare systems to reach underserved populations consistently. These gaps in logistics and accessibility lead to delayed medical responses, increasing health risks and mortality rates in areas that cannot afford these delays. Bridging this “last mile” in healthcare delivery has become an urgent global need.</p><p><strong>Swoop Aero</strong>, a Melbourne-based startup that is revolutionizing logistics through drone technology. Founded in 2017, Swoop Aero has developed the world’s only end-to-end drone logistics platform, designed to overcome infrastructure limitations and make essential supplies available where they’re needed most. Operating across six continents and serving millions, Swoop Aero’s mission is to provide life-saving healthcare and supplies to hard-to-reach areas with the goal of reaching one billion people by 2030. Their innovative approach combines cutting-edge drone technology with strategic partnerships to reimagine the future of global logistics.</p><p>With a focus on healthcare, Swoop Aero has already made significant strides in delivering vaccines, medications, and essential supplies to underserved areas. Their comprehensive approach not only supports faster, more reliable deliveries but also reshapes healthcare access for remote communities. Through each flight, Swoop Aero is helping close critical gaps in global healthcare logistics, setting new standards for responsive and sustainable supply chain solutions.</p><h3><strong>1. Need for Accessible and Efficient Logistics</strong></h3><ul><li><strong>Limited Healthcare Access:</strong> Many remote and underserved regions lack the infrastructure to access essential healthcare supplies, including vaccines, blood, and medicines, due to harsh terrains and insufficient road networks.</li><li><strong>Critical Gaps in Medical Supply Chains:</strong> Conventional logistics systems are often unable to meet the needs of populations in remote areas, resulting in inadequate medical supplies and emergency response times.</li><li><strong>Potential of Drone Technology:</strong> Swoop Aero identified that drones could bypass these logistical barriers by providing an aerial delivery solution, bridging supply gaps where traditional transportation falls short.</li><li><strong>Healthcare Impact:</strong> The timely and reliable delivery of medical supplies via drones has the potential to improve health outcomes and save lives in regions with limited healthcare infrastructure.</li></ul><h3><strong>2. Challenges in Reaching Remote Populations</strong></h3><ul><li><strong>Regulatory Hurdles:</strong> Operating drones internationally requires navigating various airspace regulations and obtaining approvals, which vary significantly across different countries and regions.</li><li><strong>Environmental Challenges:</strong> Drones deployed by Swoop Aero must withstand diverse weather conditions, from hot deserts to humid tropics, requiring durable design and adaptability.</li><li><strong>Precision in Cargo Handling:</strong> Transporting sensitive healthcare supplies involves ensuring that medicines, vaccines, and blood products are handled carefully to maintain quality during transit, which demands strict control over temperature and handling.</li><li><strong>Network Reliability:</strong> Ensuring drones operate consistently and efficiently in remote locations requires reliable infrastructure for continuous tracking, maintenance, and monitoring.</li></ul><h3>3. Swoop Aero’s Approach to Integrated Drone Logistics</h3><ul><li><strong>Innovative Drone Design (Kite™):</strong> Swoop Aero’s Kite™ drone is built for endurance, capable of flying over 180 kilometers per charge and carrying up to 5 kg, designed to suit diverse operational environments.</li><li><strong>Advanced Technology Platform:</strong> Drones are integrated into a real-time tracking and logistics platform that offers visibility into each drone’s position and enables efficient route planning and adjustments.</li><li><strong>Digital Twin Technology:</strong> The AI-powered Digital Twin system, based at Swoop Aero’s Melbourne HQ, tracks the operational health of each drone, predicting maintenance needs and ensuring safe, efficient operations.</li><li><strong>Scalable Logistics Infrastructure:</strong> The platform is designed to scale across multiple regions and integrate with local healthcare systems, making it versatile and adaptable for various logistics needs.</li></ul><h3>4. Solutions and Impact</h3><ul><li><strong>Healthcare Support:</strong> Swoop Aero has proven essential in delivering healthcare supplies to remote regions, especially during the COVID-19 pandemic, where it transported test samples and vaccines to areas with limited access.</li><li><strong>Disaster and Environmental Response:</strong> The platform also supports disaster relief, coastal monitoring, and environmental conservation, showcasing the flexibility and range of drone logistics in varied settings.</li><li><strong>Global Health Benefits:</strong> By ensuring the timely and efficient delivery of critical resources, Swoop Aero’s network significantly enhances healthcare accessibility, reducing response times and improving outcomes.</li><li><strong>Future Scalability:</strong> As the platform grows, it has potential applications in emergency management, search and rescue, and further healthcare support, underscoring its commitment to sustainable logistics solutions that can meet evolving global needs.</li></ul><h3>5. Looking Forward: A Vision for 2030</h3><ul><li><strong>Ambitious Expansion Goals:</strong> By 2030, Swoop Aero aims to reach a billion people globally, positioning itself as a key player in the healthcare and logistics sectors, especially in underserved regions.</li><li><strong>Expansion into Developed Markets:</strong> Swoop Aero is pursuing FAA certification for its Kite™ aircraft, which will allow operations in the U.S. and other developed regions, expanding its reach and operational capabilities.</li><li><strong>Long-Term Impact on Global Healthcare Logistics:</strong> By building a large-scale, safe, and reliable drone logistics network, Swoop Aero is setting a standard for how healthcare and emergency supplies can be distributed, particularly in areas with limited traditional infrastructure.</li><li><strong>Commitment to Innovation:</strong> With a focus on continuous improvement and industry leadership, Swoop Aero is dedicated to advancing drone logistics as a viable solution to pressing global challenges in healthcare and beyond. Through this comprehensive model, Swoop Aero is transforming healthcare logistics and driving a vision of global access to essential services, one drone flight at a time.</li></ul><h3>6.References</h3><ul><li>Swoop Aero’s Operations and Global Reach: Overview of Swoop Aero’s goal to serve one billion people by 2030 and operations in partnership with Mater Pathology in Queensland, delivering medical supplies faster to remote areas (<a href="https://swoop.aero/news/drones-to-deliver-faster-medical-testing-for-queenslanders-2/">Swoop Aero, 2022</a>) Swoop Aero</li><li>KORE IoT Partnership: Integration of KORE’s IoT connectivity and eSIM technology in Swoop Aero drones to enhance reliability, enabling efficient healthcare deliveries in rural regions (<a href="https://swoop.aero/news/drones-to-deliver-faster-medical-testing-for-queenslanders-2/">KORE, 2021</a>)Swoop Aero</li><li>Global Impact and Healthcare Focus: Swoop Aero’s commitment to using drones to bridge infrastructure gaps and expand healthcare access worldwide (<a href="https://swoop.aero/news/drones-to-deliver-faster-medical-testing-for-queenslanders-2/">Swoop Aero, 2023</a>) Swoop Aero</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5022162fb08" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bayes-labs/revolutionizing-global-logistics-with-swoop-aeros-end-to-end-drone-platform-b5022162fb08">Revolutionizing Global Logistics with Swoop Aero’s End-to-End Drone Platform</a> was originally published in <a href="https://medium.com/bayes-labs">Bayes Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>