<?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[Red Buffer - Medium]]></title>
        <description><![CDATA[Turning your AI vision into a success story. Our medium page is a premium selection of articles about developments and practices in artificial intelligence and machine learning, written by our engineers, who love to code and talk tech. - Medium]]></description>
        <link>https://medium.com/red-buffer?source=rss----8d86c116b0ef---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Red Buffer - Medium</title>
            <link>https://medium.com/red-buffer?source=rss----8d86c116b0ef---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 17 May 2026 07:03:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/red-buffer" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Private, Scalable LLM Inference for Data Compliance: vLLM & SGLang]]></title>
            <link>https://medium.com/red-buffer/private-scalable-llm-inference-for-data-compliance-vllm-sglang-539ad81af04f?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/539ad81af04f</guid>
            <category><![CDATA[llm-deployment]]></category>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[sglang]]></category>
            <dc:creator><![CDATA[Ahmad Faraz Sheikh]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 06:31:31 GMT</pubDate>
            <atom:updated>2026-04-27T06:31:29.572Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Open source inference engines give you what commercial APIs cannot: complete data sovereignty, production scale throughput, and zero vendor lock-in for enterprise LLM workloads.</em></p><p>A developer on your team pastes a customer contract into an LLM prompt. The model returns a clean summary in two seconds. The problem is that the contract just left your network, crossed an international border, landed on a third-party server, and may have been logged for up to 30 days. For companies in regulated industries, that single API call can trigger a compliance violation under GDPR, HIPAA, or sector-specific data residency laws.</p><p>This is not a hypothetical edge case. According to Kong’s 2025 Enterprise AI report, 44 percent of organizations identify data privacy and security as the top barrier to LLM adoption. Gartner predicts that by 2027, more than 40 percent of AI-related data breaches will stem from improper cross-border use of generative AI.</p><p>Enterprise API tiers from OpenAI, Anthropic, and Google offer contractual protections: data processing agreements, zero data retention policies, SOC 2 certifications. These protections are real. But for a growing number of organizations, they are not enough. The European Data Protection Board’s Opinion 28/2024 establishes that AI models trained on personal data are subject to GDPR in most cases, specifically because of memorization capabilities. The EU AI Act becomes fully applicable on August 2, 2026, adding obligations for high-risk AI systems. India’s Digital Personal Data Protection Act, in its enforcement phase since late 2025, mandates encryption, masking, and one-year activity log retention.</p><p>For organizations in finance, healthcare, defense, or legal services, the fundamental architectural problem remains: sensitive data leaves the enterprise perimeter on every API call. Data residency laws in the EU, India, Saudi Arabia, and Brazil require certain data categories to stay within national boundaries. Every prompt sent to a third party LLM is a processing event that may require a Data Protection Impact Assessment, a legal basis under GDPR, and a transfer mechanism like Standard Contractual Clauses. At enterprise volume, thousands or millions of prompts daily, this creates a governance surface most organizations cannot manage.</p><p>This is where open source inference engines change the equation like vLLM and SGLang let you run large language models entirely on your own infrastructure, at production throughput, with zero data leaving your network, and zero ambiguity about who controls it.</p><h3>How Self-Hosted Inference Solves the Compliance Equation</h3><p>Self-hosting an LLM with vLLM or SGLang changes the compliance architecture in four ways:</p><ul><li><strong>Data never leaves your network.</strong> Prompts, completions, and intermediate computations stay on infrastructure you control. No third-party processor, no cross-border transfer, no retention ambiguity.</li><li><strong>No training on your data.</strong> Open weight models like Llama, Mistral, Qwen, and DeepSeek are downloaded once and served locally. The question of whether your inputs improve someone else’s model simply does not arise.</li><li><strong>Audit trails you own.</strong> You decide what to log, where to store it, and how long to retain it, which is essential for GDPR data subject requests and sector-specific audits.</li><li><strong>Jurisdictional flexibility.</strong> Deploy inference instances wherever your infrastructure lives, keeping data processing inside the boundaries your regulators require. Gartner expects 35 percent of countries to be locked into region-specific AI platforms by 2027, making this increasingly non-optional.vLLM vs SGLang: Performance, Architecture, and When to Use each.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*XXo2pEBOQuF1IJ2q3bHHpA.png" /><figcaption>c</figcaption></figure><h3>Enter vLLM and SGLang: What They Are and Why They Exist</h3><p>vLLM and SGLang are open source inference engines purpose-built for serving large language models at production scale. Both originated from research at UC Berkeley. vLLM was introduced in a 2023 paper centered on the PagedAttention algorithm, which applies the concept of virtual memory paging from operating systems to manage GPU memory for LLM inference. SGLang followed with the paper “Efficient Execution of Structured Language Model Programs,” introducing RadixAttention, a mechanism that stores and reuses cached computation across requests sharing common prefixes.</p><p>These are not research prototypes. vLLM powers production inference at Meta, Mistral AI, Cohere, IBM, and Red Hat. SGLang is deployed across over 400,000 GPUs at organizations including xAI, AMD, NVIDIA, Intel, LinkedIn, Cursor, and major cloud providers, including Oracle Cloud, Google Cloud, Microsoft Azure, and AWS. Both expose <strong>OpenAI-compatible API endpoints</strong>, which means existing applications built against the OpenAI SDK can migrate to self-hosted infrastructure by changing a single URL, with no code modifications required.</p><p>The practical result is that any organization with access to GPU infrastructure, whether on premises, in a private cloud, or through a dedicated cloud instance, can run a state-of-the-art language model without sending a single byte of data to a third party.</p><p>With the compliance case established, the practical question becomes how actually to run these engines. Both vLLM and SGLang are designed to get you from zero to a working inference server in minutes, not days, though each takes a different architectural path to production performance.</p><h4>vLLM :</h4><p>vLLM’s core innovation is <strong>PagedAttention</strong>. Traditional LLM inference allocates contiguous GPU memory for each request’s key-value cache, which wastes 60 to 80 percent of memory through fragmentation. PagedAttention breaks the KV cache into fixed-size non-contiguous blocks and uses an indirection layer, similar to virtual memory in operating systems. Combined with continuous batching, which lets new requests join an in-progress batch as soon as a slot opens, early benchmarks showed throughput 14 to 24 times higher than HuggingFace Transformers on the same hardware.</p><h4>vLLM Setup</h4><p>Getting a vLLM server running takes three commands:</p><pre># Install<br>pip install vllm<br><br># Launch an OpenAI-compatible server<br>vllm serve meta-llama/Llama-3.1-8B-Instruct \<br>  --dtype bfloat16 \<br>  --gpu-memory-utilization 0.9 \<br>  --port 8000</pre><p>For multi-GPU deployment, add --tensor-parallel-size 2 (or 4, 8) to distribute the model across GPUs. For Docker-based production, vLLM publishes an official image:</p><pre>docker run --gpus all -p 8000:8000 \<br>  -v ~/.cache/huggingface:/root/.cache/huggingface \<br>  vllm/vllm-openai:latest \<br>  --model meta-llama/Llama-3.1-8B-Instruct</pre><p>Once running, any OpenAI SDK client works by pointing to your endpoint:</p><pre>from openai import OpenAI<br>client = OpenAI(base_url=&quot;http://your-server:8000/v1&quot;, api_key=&quot;your-key&quot;)<br>response = client.chat.completions.create(<br>    model=&quot;meta-llama/Llama-3.1-8B-Instruct&quot;,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Summarize this contract...&quot;}]<br>)</pre><p>That is it. No cloud account, no per-token billing, no data leaving your infrastructure.</p><h4>SGLang :</h4><p>SGLang’s core innovation is <strong>RadixAttention</strong>. Where vLLM manages memory efficiently, SGLang manages content efficiently. Traditional engines discard the KV cache after each request completes. SGLang stores cached prefixes in a radix tree, a data structure that represents shared token sequences. When a new request arrives with a matching prefix, such as the same system prompt, conversation history, or few-shot examples, SGLang reuses the cached computation instead of recalculating it. This produces cache hit rates of 85 to 95 percent for few-shot learning and 75 to 90 percent for multi-turn chat.</p><p>On NVIDIA H100 GPUs running Llama 3.1 8B with bfloat16 precision, SGLang delivers approximately 16,200 tokens per second versus vLLM’s 12,500 with FlashInfer, a 29 percent throughput gap. For multi-turn workloads, SGLang gains another 10 to 20 percent from cache hits. Its compressed finite state machine for constrained decoding makes JSON and XML generation up to 3 times faster than unconstrained generation with post-processing.</p><h4><strong>SGLang Setup :</strong></h4><p>Setup is comparably simple:</p><pre># Install<br>pip install sglang[all]</pre><pre># Launch an OpenAI-compatible server<br>python -m sglang.launch_server \<br>  --model-path meta-llama/Llama-3.1-8B-Instruct \<br>  --port 30000 \<br>  --mem-fraction-static 0.9</pre><p>For multi-GPU, add --tp 2 (tensor parallel size). Docker deployment uses the official image:</p><pre>docker run --gpus all -p 30000:30000 \<br>  -v ~/.cache/huggingface:/root/.cache/huggingface \<br>  lmsysorg/sglang:latest \<br>  python -m sglang.launch_server \<br>  --model-path meta-llama/Llama-3.1-8B-Instruct \<br>  --host 0.0.0.0</pre><p>The server exposes the same OpenAI-compatible API, so the same client code works by changing the base URL to port 30000.</p><h4>Choosing Between Them</h4><p>With both engines running the same models behind the same API surface, the decision comes down to workload pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*NFOBltQxPSmIvTbJEGmjKg.png" /></figure><p><em>PagedAttention manages memory in blocks. RadixAttention manages content in trees.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*nPJbcj-sb0W9bCAC7oyGXQ.png" /></figure><p>Start with vLLM if you need the broadest model compatibility, the largest community for troubleshooting, or if your workload is primarily single-turn requests across heterogeneous GPU hardware. Choose SGLang if your workload involves multi-turn conversations, agent-based reasoning with tool calling, heavy use of structured outputs, or if you run dedicated GPU clusters where throughput per dollar is the primary metric.</p><h4>Scaling From Proof of Concept to Production</h4><p>Both engines ship with Docker images and support Kubernetes deployment behind standard GPU operators. Horizontal scaling uses request queue depth or GPU utilization as the autoscaling signal, the same pattern any containerized service uses.</p><p>The cost case strengthens as volume grows. Enterprise LLM API spending doubled to $8.4 billion in 2025, and per-token pricing scales linearly with usage. Self-hosted infrastructure has higher fixed costs but sublinear scaling. For multi-turn RAG applications, SGLang’s RadixAttention cache reuse can cut GPU footprint by nearly 30 percent versus vLLM, which translates to roughly $15,000 in monthly savings at one million requests per day.</p><p>Both engines handle multi-GPU deployment natively. vLLM has been deployed at Stripe-scale (50 million daily requests on a third of their original GPU fleet), and SGLang has been documented running DeepSeek across 96 H100s.</p><h3>What Self-Hosting Does Not Give You</h3><p>Self-hosting is not free of tradeoffs. Running inference infrastructure requires GPU procurement or cloud GPU allocation, driver and CUDA management, model version updates, performance monitoring, and security hardening. Stripe reportedly achieved 73 percent inference cost reduction by migrating to vLLM, but they also had a dedicated ML platform team to manage the transition.</p><p>Model quality is another consideration. Open weight models such as Llama 3.3 70B, Qwen 3.5, DeepSeek V3, and Mistral Large 3 are competitive with proprietary models on many tasks, but frontier capabilities from GPT-4o or Claude Opus may still exceed what is available in the open weight ecosystem for certain specialized benchmarks. The gap has narrowed substantially, and for the vast majority of enterprise use cases, including summarization, classification, extraction, code generation, and conversational AI, open weight models deliver production-quality results.</p><p>Organizations without existing GPU infrastructure or ML engineering capacity should consider managed self-hosting platforms that deploy on your cloud instances while handling operational complexity, or start with a proof of concept on a single GPU before committing to full-scale deployment.</p><h3>Key Takeaways</h3><ol><li>Commercial LLM APIs create an inherent compliance exposure for regulated industries. Self-hosted inference eliminates data leaving your network entirely.</li><li>vLLM (PagedAttention) and SGLang (RadixAttention) are production-grade engines used by Meta, xAI, NVIDIA, LinkedIn, and hundreds of other organizations at scale.</li><li>SGLang leads on raw throughput (~16,200 tok/s on H100) and excels at multi-turn, agentic, and structured output workloads. vLLM offers the broadest model and hardware compatibility.</li><li>Both engines expose OpenAI-compatible APIs, making migration from commercial APIs a configuration change, not a rewrite.</li><li>Start with vLLM for breadth and stability; move to SGLang when multi-turn performance and prefix caching drive measurable cost savings.</li></ol><h3>Where to Go Next</h3><p>If this article moved you from curious to committed, these are the resources worth bookmarking.</p><p><strong>vLLM</strong></p><ul><li>Official documentation: <a href="https://docs.vllm.ai">docs.vllm.ai</a></li><li>GitHub repository: <a href="https://github.com/vllm-project/vllm">github.com/vllm-project/vllm</a></li><li>Supported models list: <a href="https://docs.vllm.ai/en/latest/models/supported_models.html">docs.vllm.ai/en/latest/models/supported_models.html</a></li></ul><p><strong>SGLang</strong></p><ul><li>Official documentation: <a href="https://docs.sglang.ai">docs.sglang.ai</a></li><li>GitHub repository: <a href="https://github.com/sgl-project/sglang">github.com/sgl-project/sglang</a></li><li>LMSYS blog (release notes and benchmarks): <a href="https://lmsys.org/blog">lmsys.org/blog</a></li></ul><p><strong>Compliance references cited in this article</strong></p><ul><li>EDPB Opinion 28/2024 on AI models and personal data: <a href="https://www.edpb.europa.eu">edpb.europa.eu</a></li><li>EU AI Act full text: <a href="https://artificialintelligenceact.eu">artificialintelligenceact.eu</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=539ad81af04f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/private-scalable-llm-inference-for-data-compliance-vllm-sglang-539ad81af04f">Private, Scalable LLM Inference for Data Compliance: vLLM &amp; SGLang</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harder Than It Sounds: An Introduction to Voice Agents]]></title>
            <link>https://medium.com/red-buffer/harder-than-it-sounds-an-introduction-to-voice-agents-ca8312cdf190?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/ca8312cdf190</guid>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[voice-agent]]></category>
            <dc:creator><![CDATA[Aamina Binte Khurram]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 06:21:32 GMT</pubDate>
            <atom:updated>2026-04-21T07:10:30.624Z</atom:updated>
            <content:encoded><![CDATA[<p>Voice agents are a kind of conversational AI that use generative models to power human-like conversations. In this article, we’ll unpack what voice agents are, and take a look under the hood to see the systems that make this technology possible.</p><p>Before diving in, it helps to understand the two building blocks behind voice agents: agentic AI and conversational AI.</p><h3>Agentic AI</h3><p>An agent can be loosely defined as an entity (human or otherwise) that pursues goals and makes decisions to achieve them. In doing so, it operates autonomously, is capable of understanding its environment, reasoning and using the right tools to act effectively. (Think less chatbot, more undercover operative — but without the sunglasses and trench coat of course.)</p><p>An AI agent is simply a software system that applies these principles: it uses artificial intelligence to reason, take actions and pursue goals.</p><h3>Conversational AI</h3><p>If agentic AI is about doing, conversational AI is about talking. It refers to technologies that enable machines to understand and respond to human language in a natural, dialogue-based way. At the core of conversational AI are techniques from Natural Language Processing (NLP) and Natural Language Understanding (NLU), which help systems interpret intent, context, and sentiment in human speech or text.</p><h3>Voice Agents</h3><p>Voice agents are the best of both worlds. They are the voice-modality branch of conversational AI, but they also have agentic capabilities.</p><p>For example, imagine calling a restaurant to make a reservation. Instead of waiting for a staff member or navigating multiple menus, you speak naturally: “I’d like to make a reservation for tomorrow evening.” The voice agent at the other end understands your request, checks availability, asks follow-up questions, and books the slot, all within a fluid conversation.</p><p>In other words, voice agents don’t just talk; they can take actions, make decisions, and help complete tasks, all through natural spoken interaction.</p><h3>Architectural Overview</h3><p>To understand the architecture of a voice agent, we can follow along with the conceptual model of an actual human conversation. Imagine two people trying to decide on a movie to watch. In the interest of brevity (a virtue we’ll immediately abandon), let’s call them Person A and Person B.</p><p>Person A is a sci-fi fan, Person B is not. Person A makes several passionate arguments about why watching a sci-fi film will be an incredible experience, Person B makes several equally passionate arguments about why watching a sci-fi film will be an incredibly boring experience, and eventually manages to convince Person A that a new bank robbery movie is the better option.</p><p>During this exchange, Person A and B both thought of things to say, verbalised them, listened to what the other person said, understood the other person’s speech, adjusted their responses based on the content and style of the other person’s speech, and so on. Because choosing the right movie mattered to them both very much, Person A and Person B got a little impassioned at times, even cutting each other off at moments. But despite all the pauses and interruptions, they were able to continue conversing.</p><p>This cycle repeats every time we speak with others, and it all happens so fast we don’t even realise it. Asking a machine to perform all these tasks is certainly not a short order, and as we’ll discover shortly, there’s a lot going on behind the scenes to make a machine “conversant”.</p><p>When a user speaks to a voice agent, the first challenge is that LLMs (the AI programs at the heart of voice agents, capable of understanding and generating text) don’t actually understand speech. So before anything else, we need to convert the user’s speech into text. This is the job of a speech-to-text, or STT, model. Think of it as a transcriber, listening and converting spoken words into text the LLM can work with.</p><p>Once the LLM receives that text, it acts as the “brain” of the operation: understanding what the user said, deciding what to respond, and calling any relevant external tools where needed. It then produces a textual response. But of course, a voice agent doesn’t hand you a written note, it speaks. For this step, we use a text-to-speech, or TTS, model. Think of it as a narrator bringing the LLM’s response to life.</p><p>One shortcut worth noting is real-time LLMs. Unlike standard LLMs, they are multi-modal, capable of taking speech as input and producing speech as output. In some cases, this reduces the need for a strict STT-LLM-TTS pipeline, and can lower overall latency by removing intermediate steps. However, in most production voice systems today, the traditional pipeline is still widely used. It offers more control, modularity, and flexibility, especially when different components need to be swapped, tuned, or optimized independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*f3u4satiXsP8pyIpP0psFQ.png" /><figcaption>From <a href="https://livekit.com/voice-agents">https://livekit.com/voice-agents</a></figcaption></figure><p>That’s a lot of steps. To feel human-like, all this has to happen very, very fast. But speed alone doesn’t solve everything. Pauses and interruptions are central to natural conversation, and handling them gracefully is one of the trickier engineering challenges in voice AI. This brings us to perhaps the most underappreciated challenge in voice AI, and why getting conversation to feel natural is harder than it sounds.</p><h3>Why Voice Is Hard</h3><p>Human conversation is characterised by rapid turn-taking, with silent gaps between speakers typically around 200 milliseconds. Although producing language takes longer than this, we maintain the pace by predicting when the other person is about to finish speaking and preparing a response in advance.</p><p>For a voice agent to feel natural, it must do something similar: keep the delay between a user finishing their sentence and the agent beginning its response as short as possible, while still ensuring that the response is accurate and relevant.</p><p>This is harder than it sounds. Every interaction has to pass through multiple steps (speech-to-text, language understanding, and text-to-speech) and each of these introduces latency. Even small delays compound into noticeable conversational lag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*ksYNHfepXowU4pG5aSlmYg.png" /><figcaption>From: <a href="https://livekit.com/blog/voice-agent-architecture-stt-llm-tts-pipelines-explained">https://livekit.com/blog/voice-agent-architecture-stt-llm-tts-pipelines-explained</a></figcaption></figure><p>Latency, however, is only part of the problem. The more subtle challenge is turn-taking.</p><p>Let’s return to our earlier example. Imagine Person A enthusiastically explaining the plot of <em>Star Trek</em> in an attempt to convert Person B into a sci-fi fan (an effort we already know doesn’t succeed). This explanation won’t be a continuous monologue; Person A will pause frequently: to breathe, to emphasise a point, or to check that Person B is following along. Person B, in turn, will respond during these pauses, asking questions, adding comments, or occasionally interrupting altogether.</p><p>Now consider what happens if the timing is off:</p><ul><li>If Person B asks a question and Person A takes too long to respond, the delay feels awkward.</li><li>If Person A pauses briefly mid-sentence and Person B immediately jumps in, it feels like an interruption.</li></ul><p>In natural conversation, we handle this seamlessly. We instinctively know when to speak, when to wait, and when to stop if interrupted. Even when overlaps happen, they are brief and one person quickly yields the floor to the other.</p><p>For a machine however, this is much harder to get right.</p><p>Voice agents rely on Voice Activity Detection (VAD) to determine when a user has started or stopped speaking. These models are trained to detect patterns in audio that indicate speech boundaries. But real conversations are messy. A short pause to catch a breath can be mistaken for the end of a sentence, causing the agent to respond too early and cut the user off. On the other hand, waiting too long to be sure the user has finished speaking increases latency and makes the system feel sluggish.</p><p>On top of this, well-designed voice agents support barge-in, allowing users to interrupt the agent while it is speaking. This requires the system to immediately stop its output, process the new input, and shift context, all in real time.</p><p>Balancing these factors — latency, turn-taking, interruptions, and continuous audio processing — is what makes voice systems fundamentally more complex than their text-based counterparts.</p><h3>A Deeper Dive: What’s Under the Hood</h3><h3>STT</h3><p>Speech-to-text (STT) models, also known as Automatic Speech Recognition (ASR) models, convert a user’s spoken input into text, which can then be processed by the next stage of the voice agent pipeline: the LLM.</p><p>When you speak to a voice agent, the system doesn’t wait for you to finish your sentence before it starts processing. Instead, it continuously ingests audio and incrementally converts a stream of sound into text that the rest of the system can work with.</p><p><strong>How it works</strong></p><p>At a high level, an STT model takes a raw audio signal as input and transforms it into text through a series of steps. The audio waveform is first processed into acoustic features, which capture patterns in speech such as frequency and timing. These features are then passed through a neural model that predicts the most likely sequence of words corresponding to the input audio.</p><p>Modern STT systems combine acoustic modeling (understanding how speech sounds) with language modeling (understanding which word sequences are likely), allowing them to remain robust to noise and ambiguous speech.</p><p><strong>Streaming</strong></p><p>In voice agents, STT systems typically operate in streaming mode, meaning they transcribe audio in real time as it is being spoken. Rather than waiting for a complete utterance, the model produces interim (partial) transcripts that are continuously updated as more audio arrives.</p><p>This streaming behaviour is critical for reducing latency. By producing partial transcripts early, the system can begin processing a user’s intent before they have finished speaking. However, it also introduces new challenges. Interim transcripts can change as more audio arrives, and deciding when a transcription is “final” becomes a non-trivial problem closely tied to turn-taking.</p><h3>LLM</h3><p>Once a user’s speech has been converted into text, the next step is to understand what was said and come up with an appropriate response. This is where the large language model (LLM) comes in.</p><p>The LLM acts as the core reasoning engine of a voice agent. It takes in the transcribed user input, along with any relevant conversation history, and generates an appropriate response. It can also decide to call external tools or APIs to perform actions such as retrieving information or completing tasks.</p><p><strong>How it works</strong></p><p>At a high level, an LLM is trained to predict the next token in a sequence of text, given the tokens that came before it. By repeatedly applying this process, it generates coherent responses one token at a time.</p><p>In a conversational setting, the input to the model typically includes:</p><ul><li>the current user utterance (from the STT)</li><li>prior conversation turns</li><li>system-level instructions (e.g. how the agent should behave)</li></ul><p>The model processes this context and produces a response incrementally, token by token, which can then be passed downstream for speech generation.</p><p><strong>What matters for voice agents</strong></p><p>While LLMs are often used in text-based systems, deploying them in a real-time voice setting introduces additional constraints.</p><p><em>1. Latency and streaming</em></p><p>Voice agents cannot wait for a full response before speaking. Instead, LLMs stream tokens as they are generated, allowing downstream components like the TTS model to begin producing audio early. Even small delays in token generation can introduce noticeable pauses, making latency a critical factor.</p><p><em>2. Response style</em></p><p>Voice interactions favour concise, natural responses. Outputs that are too long or overly structured may be acceptable in text, but can feel unnatural when spoken aloud. Prompts and system design in voice agents therefore aim to keep responses short and conversational.</p><p><em>3. Decision-making and context</em></p><p>The LLM is not just generating text, it is deciding what to do next. This may involve calling external tools or APIs and incorporating the results into its response. At the same time, it must maintain conversational context across turns, balancing relevance with the latency and cost of passing large conversational histories.</p><h3>TTS</h3><p>A text-to-speech (TTS) model is used to convert the LLM’s textual output into audio, allowing the agent to respond in speech. If the STT model is how the system listens, the TTS model is how it speaks, and it is often the most user-visible part of a voice agent’s pipeline.</p><p><strong>How it works</strong></p><p>At a high level, a TTS model takes text as input and generates a corresponding audio waveform. Modern neural TTS models first convert text into intermediate representations (such as phonemes or spectrograms), and then generate speech that captures not just the words, but also aspects like timing, pitch, and intonation.</p><p><strong>What matters for voice agents</strong></p><p><em>1. Time to first audio and streaming</em></p><p>Voice agents must begin speaking quickly. Rather than waiting for the full response, TTS systems generate audio in chunks, allowing playback to start while the rest of the response is still being synthesized. This significantly reduces perceived latency.</p><p><em>2. Naturalness and prosody</em></p><p>The quality of the generated voice — including its tone, pacing, and expressiveness — has a direct impact on user experience. Even correct responses can feel unnatural if the speech sounds robotic or poorly timed.</p><p><em>3. Interruptibility</em></p><p>In real conversations, speakers can be interrupted. Voice agents must support this as well, meaning TTS output needs to be stoppable mid-generation so the system can respond to new user input without delay.</p><h3>Conclusion</h3><p>Building a voice agent quickly reveals that most of the hard problems are not about generating correct outputs, but about doing so under strict latency constraints while maintaining a natural conversational flow. Small issues in transcription delay, response length, or speech timing can significantly affect how “human” the system feels, even when each individual component is functioning correctly. In practice, the difference between a working system and a genuinely good voice experience is not just model quality, but how well the pieces are orchestrated under real-time pressure.</p><p>The stakes of getting this right become especially clear in high-sensitivity contexts. Consider a voice agent collecting medical information before a patient consultation. In such a use case, every component’s limitations carry real weight. A transcription error means the clinician receives inaccurate information. A hallucinated LLM response could mislead a patient about their condition. A robotic or poorly timed TTS voice can feel cold in a moment that calls for warmth and reassurance.</p><p>These issues are not unique to healthcare; they appear in almost any real-world voice interface. Unlike traditional GUIs, where the designer controls the interaction pathways, voice agents operate in open-ended territory. You cannot predict every way a user will phrase a request, and you cannot fully constrain what the model will say in response. Building well means accepting that uncertainty and designing for it. In practice, this requires careful prompting, continuous iteration, and a clear understanding of what each component in the pipeline can and cannot do reliably.</p><p>Have anything to add or improve? Please feel free to reach out on <a href="https://www.linkedin.com/in/aamina-binte-khurram/">LinkedIn</a>!</p><p>References:</p><ul><li><a href="https://livekit.com/blog/voice-agent-architecture-stt-llm-tts-pipelines-explained">Voice Agent Architecture: STT, LLM, and TTS Pipelines Explained</a></li><li><a href="https://www.freshworks.com/freshdesk/ai-agent/vs-conversational-ai/">Agentic AI vs Conversational AI: Key Differences Explained</a></li><li><a href="https://www.ibm.com/think/topics/ai-agents">What Are AI Agents? | IBM</a></li><li><a href="https://cloud.google.com/discover/what-are-ai-agents">What are AI agents? Definition, examples, and types</a></li><li><a href="https://docs.langchain.com/oss/python/langchain/voice-agent">Build a voice agent with LangChain - Docs by LangChain</a></li><li><a href="https://vapi.ai/blog/what-is-speech-to-text">Speech-to-Text: What It Is, How It Works, &amp; Why It Matters - Vapi AI Blog</a></li><li><a href="https://www.ibm.com/think/topics/text-to-speech">What is Text to Speech? | IBM</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca8312cdf190" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/harder-than-it-sounds-an-introduction-to-voice-agents-ca8312cdf190">Harder Than It Sounds: An Introduction to Voice Agents</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LangChain vs LangGraph: Choosing the Right AI Workflow Framework]]></title>
            <link>https://medium.com/red-buffer/langchain-vs-langgraph-choosing-the-right-ai-workflow-framework-1718e21199f0?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/1718e21199f0</guid>
            <dc:creator><![CDATA[Tauseefahmed Tam]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 06:40:00 GMT</pubDate>
            <atom:updated>2026-02-10T06:39:59.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6pTZp0HvU0ZBBUUSRsVSBw.png" /></figure><p>Large language model (LLM) frameworks now offer multiple ways to structure your pipelines. LangChain and LangGraph come from the same ecosystem but serve different needs.</p><p><strong>LangChain</strong> is a linear, chain-of-operations framework ideal for straight line workflows you already understand.</p><p><strong>LangGraph</strong> is a low level, graph based orchestrator for complex, stateful agent systems. The choice isn’t automatic: for clear sequential tasks, LangChain’s simplicity is often faster and more efficient.</p><h4>Architecture &amp; Primitives</h4><blockquote><em>LangChain </em>primarily optimized for linear workflows<em>; LangGraph routes state through a branching graph of nodes.</em></blockquote><p>LangChain is designed around linear pipelines, where prompts, models, retrievers, and tools are executed in a fixed sequence. This makes it well-suited for simple, well-defined workflows like retrieval followed by summarization and answering. LangGraph, on the other hand, represents workflows as stateful graphs, allowing nodes to branch, loop, and revisit earlier steps. By passing a shared state through the graph, LangGraph natively supports conditional logic, retries, checkpoints, and human-in-the-loop interactions capabilities that are difficult to model cleanly with linear chains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hAKmUsoyVMkJSAC8m8fawg.png" /><figcaption>Figure: Simplified architectural patterns. (Left) A LangChain pipeline executes each component in order. (Right) A LangGraph workflow is cyclic/graph-based, with an LLM agent node, conditional “Need tool?” logic, and the possibility of looping.</figcaption></figure><p>Under the hood, LangChain provides building blocks like prompt templates, memory modules, vector retrievers and tool interfaces, all composed into chains or agents.</p><blockquote>The mental model is like Lego blocks: small operations fit together in a fixed sequence.</blockquote><p>LangGraph, by contrast, is very low-level and <strong>stateful. </strong>You define <em>state schemas</em> and <em>graph nodes</em> in code. The framework guarantees <em>durable execution</em>: on failure or pause, you can checkpoint and resume from the last state. It even offers streaming outputs, long-term memory(enables persistence and checkpointing, but memory storage still needs to be designed explicitly), and visual debugging tools for production agents.</p><p>In short, LangChain’s in DAG looping or revisiting steps is possible but awkward compared to LangGraph, whereas LangGraph’s directed graph explicitly allows revisiting prior steps or branching off; a powerful but heavier abstraction.</p><h4>When to Stick with LangChain</h4><ul><li><strong>Linear Pipelines:</strong> LangChain is ideal for straightforward, sequential workflows like text transformation or RAG, where each step feeds cleanly into the next and no mid-pipeline decision-making is required.</li><li><strong>Simple RAG and Q&amp;A Systems:</strong> Static knowledge-base applications such as FAQ bots or document summarizers fit naturally into LangChain’s model, requiring only retrieval, prompting, and optional short-term memory.</li><li><strong>Fast Prototyping:</strong> LangChain minimizes boilerplate and cognitive overhead, making it easier to iterate quickly compared to heavier agent or graph-based frameworks.</li><li><strong>Lower Operational Overhead:</strong> For short-lived or single-shot requests, LangChain avoids the additional orchestration complexity introduced by stateful graph execution.</li><li><strong>Latency-Sensitive Use Cases:</strong> Simpler execution paths generally result in lower end-to-end latency, making LangChain better suited for real-time or “quick hit” queries.</li><li><strong>Stateless or Lightly Stateful Systems:</strong> When requests are independent and long-term state or branching logic isn’t required, LangChain is typically the more efficient and pragmatic choice.</li></ul><h4>When LangGraph Shines</h4><ul><li><strong>Stateful, Long-Running Workflows:</strong> LangGraph is well-suited for systems that require persistent state across steps or sessions, such as virtual assistants or multi-turn reasoning workflows, with built-in checkpointing and recovery.</li><li><strong>Conditional Logic and Loops:</strong> Native support for branching, retries, and looping allows workflows to adapt dynamically based on outcomes, without embedding complex control logic throughout the codebase.</li><li><strong>Multi-Agent Coordination:</strong> Graph-based execution enables multiple specialized agents or tools to operate in parallel or sequence, making complex task orchestration natural and maintainable.</li><li><strong>Human-in-the-Loop Workflows:</strong> LangGraph supports pausing execution for review, approval, or intervention, with full state visibility and resumability built in.</li><li><strong>Production-Grade Resilience:</strong> Designed for durable, mission-critical systems, LangGraph offers crash recovery, detailed tracing, and scalability features that reduce operational risk in complex AI applications.</li></ul><h4>Performance and Complexity Trade-offs</h4><p>LangChain has a lighter execution and cognitive footprint, making it well-suited for short-lived, low-latency, and retrieval-heavy workloads where additional orchestration would add unnecessary overhead. For simple queries or linear pipelines, LangChain — or even direct LLM calls — often delivers better performance and faster iteration. LangGraph introduces extra per-step overhead through state management and scheduling, but this cost pays off when workflows require branching, retries, persistence, or re-planning. In those cases, LangGraph outperforms ad-hoc chain-based solutions both in clarity and execution. From a productivity standpoint, LangChain is easier to learn and reason about, while LangGraph’s graph and state-machine model carries higher upfront complexity, making it a poor fit for simple tasks where it would slow teams down rather than accelerate them. As one experienced engineer puts it:</p><blockquote><em>“Avoid implementing a full graph when no loops or persistent state are needed. Over-engineering reduces clarity and increases maintenance cost.”</em></blockquote><p>On the other hand, when an application truly needs a multi-turn agent or fine-grained control, trying to hack it with LangChain often leads to fragile code and hidden bugs.</p><h3>Decision Checklist</h3><p>A quick heuristic often helps teams decide:</p><ul><li><strong>Single-pass vs Multi-pass:</strong> If your workflow is a one-shot pipeline with known steps (e.g. RAG answering or document Q&amp;A), choose <strong>LangChain</strong>. If you foresee multiple decision points or a loop-until-done pattern, lean <strong>LangGraph</strong>.</li><li><strong>Statefulness:</strong> Do you need to remember information across user interactions or iterations? If yes (long chat memory, task lists, session state), LangGraph is preferable. If each call is independent or only uses short-term memory, LangChain (with a simple memory module) is sufficient.</li><li><strong>Error Handling:</strong> For pipelines that must retry or continue on errors, LangGraph has built‑in support (checkpoints, retry edges). In LangChain you’d have to manually catch exceptions and re-call chains.</li><li><strong>Complexity vs Speed:</strong> If rapid prototyping or iteration speed is critical, start with LangChain; it gets you un-stuck faster. Only graduate to LangGraph once your requirements demand it (branching logic, long sessions, human steps).</li><li><strong>Operational Concerns:</strong> Consider deployment. LangChain’s ease to be deployed in stateless enironment design fits well in simple serverless or containerized setups. LangGraph (with its persistent threads) may need additional infrastructure (like a managed agent platform). If your environment is constrained, factor that in.</li><li><strong>Trends:</strong> The community feedback is clear: <strong>there’s no one-size-fits-all standard</strong> anymore. Use LangChain when its abstraction cuts your work; use LangGraph when you’re tackling long-lived, agentic workflows that really need it.</li></ul><h4>Conclusion</h4><p>Avoid over-engineering. If a plain chain does the job, run with it. Only graphify your architecture once your requirements grow beyond the capabilities of a simple chain. By aligning the framework to the problem complexity, teams can move faster and stay focused on building value, not wrestling with unnecessary abstraction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1718e21199f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/langchain-vs-langgraph-choosing-the-right-ai-workflow-framework-1718e21199f0">LangChain vs LangGraph: Choosing the Right AI Workflow Framework</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic AI Systems with Integrated XAI: Building Smarter, Transparent, and Trustworthy AI]]></title>
            <link>https://medium.com/red-buffer/agentic-ai-systems-with-integrated-xai-building-smarter-transparent-and-trustworthy-ai-087502181fd0?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/087502181fd0</guid>
            <dc:creator><![CDATA[Tauseefahmed Tam]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 07:35:34 GMT</pubDate>
            <atom:updated>2026-02-06T07:35:33.972Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BThywYG3Nts04Q27twvnww.png" /></figure><p>Artificial Intelligence (AI) has evolved from simple predictive models into agentic systems. Agentic systems are AI entities that can reason, plan, and take autonomous actions. But as AI becomes more capable, one critical question arises:</p><blockquote>How do we trust its decisions?</blockquote><p>This is where Explainable AI (XAI) enters the stage. By integrating XAI into agentic AI systems, we can build agents that not only act but also explain why they act the way they do.</p><h4>🧠 What are Agentic AI Systems?</h4><p>An agentic AI system is more than just a machine learning model. Unlike traditional ML models that passively output predictions (e.g., “spam” vs. “not spam”), an agentic system can:</p><p>Perceive its environment (through inputs like text, images, or sensor data)</p><p><em>Reason about goals and constraints</em></p><p><em>Plan a sequence of actions</em></p><p><em>Act autonomously to achieve objectives</em></p><p><em>Learn and Adapt from new data and outcomes</em></p><p>Think of ChatGPT with internet access, or a trading bot that adjusts strategies dynamically. These are agentic because they operate like intelligent decision-makers.</p><h4>🔎 Why Do We Need XAI (Explainable AI)?</h4><p>The more autonomy we give to AI, the more important <strong>trust and accountability</strong> become.</p><p>Imagine:</p><ul><li>A healthcare agent suggests a treatment plan.</li><li>A financial agent executes trades on your behalf.</li><li>A legal agent reviews contracts.</li></ul><p>Would you follow their advice blindly? Probably not.</p><p>This is why <strong>Explainable AI (XAI)</strong> is critical: it makes decisions <strong>transparent</strong> by showing reasoning, evidence, and trade-offs.</p><p>Benefits of integrating XAI into agents:</p><ul><li><strong>Trust</strong> → Users can see <em>why</em> a decision was made</li><li><strong>Debugging</strong> → Engineers can identify biases or flaws</li><li><strong>Compliance</strong> → Regulations (like GDPR) require explanation of automated decisions</li><li><strong>Adoption</strong> → People are more likely to use AI they understand</li></ul><h4>⚙️ Architecture of Agentic AI with XAI</h4><p>An <strong>agentic AI system with XAI</strong> typically has these 5 layers:</p><ol><li><strong>Perception Layer</strong> → Collects input (text, data, sensors)</li><li><strong>Cognition Layer (Reasoning Engine)</strong> → Uses ML + symbolic reasoning</li><li><strong>Decision Layer</strong> → Plans and selects best action</li><li><strong>Action Layer</strong> → Executes the decision</li><li><strong>XAI Layer (Transparency Module)</strong> → Generates human-readable explanations</li></ol><pre>[Input Data] → [Perception] → [Reasoning/Planning] → [Decision] → [Action]<br>                                                    ↘ [XAI Explanation]</pre><h4>💻 Coding a Simple Agent with XAI</h4><p>Let’s build a <strong>toy AI agent</strong> that:</p><ul><li>Takes a <strong>goal</strong> (e.g., recommend a movie)</li><li>Makes a <strong>decision</strong> using ML</li><li>Provides a <strong>human-friendly explanation</strong> with SHAP (SHapley Additive exPlanations)</li></ul><p><strong>Step 1: Build a simple recommendation agent</strong></p><pre>import shap<br>import numpy as np<br>from sklearn.datasets import load_iris<br>from sklearn.ensemble import RandomForestClassifier<br><br># Step 1: Environment perception (load dataset)<br>data = load_iris()<br>X, y = data.data, data.target<br><br># Step 2: Cognition (train ML model)<br>model = RandomForestClassifier(n_estimators=50)<br>model.fit(X, y)<br><br># Step 3: Agent makes a decision<br>sample = X[42].reshape(1, -1)<br>prediction = model.predict(sample)[0]<br>decision = data.target_names[prediction]<br><br>print(f&quot;Agent&#39;s decision: Recommend &#39;{decision}&#39;&quot;)</pre><h4>Step 2: Add XAI explanation with SHAP</h4><pre># Explain WHY the decision was made<br>explainer = shap.TreeExplainer(model)<br>shap_values = explainer.shap_values(sample)<br>shap_values_for_class = shap_values[prediction][0]<br><br># Handle case where number of SHAP values doesn&#39;t match number of features<br>if len(shap_values_for_class) != n_features:<br>    # Pad SHAP values with zeros to match number of features<br>    padded_shap = np.zeros(n_features)<br>    padded_shap[:len(shap_values_for_class)] = shap_values_for_class<br>    shap_values_for_class = padded_shap<br><br>print(&quot;\nExplanation (Top features influencing decision):&quot;)<br>for i, feature_name in enumerate(feature_names):<br>    if i &lt; len(shap_values_for_class):<br>        shap_value = shap_values_for_class[i]<br>    else:<br>        shap_value = 0.0  # Default if SHAP value is missing<br>    print(f&quot;{feature_name}: {shap_value:.3f}&quot;)</pre><p><strong>Output Example:</strong></p><pre>Agent&#39;s decision: Recommend &#39;setosa&#39;<br><br>Explanation (Top features influencing decision):<br>sepal length (cm): 0.066<br>sepal width (cm): -0.039<br>petal length (cm): -0.028<br>petal width (cm): 0.000</pre><p>This means the agent didn’t just pick a flower but it also explained that petal length and petal width were the most important features.</p><h4>🌍 Real-World Applications</h4><p>Healthcare Agents → AI diagnosis systems explaining risk factors for diseases</p><p>Financial Agents → Trading bots that justify investment moves</p><p>Legal Agents → Contract analysis with traceable reasoning</p><p>Customer Service Agents → Transparent recommendations, not “black box” replies</p><p>Autonomous Vehicles → Explaining navigation decisions in case of accidents</p><h4>🚀 Future of Agentic AI with XAI</h4><p>The future is moving towards self-reflective agents systems that:</p><p>Explain their decisions in natural language</p><p>Audit themselves for bias</p><p>Provide confidence levels for their outputs</p><p>Learn user preferences to give personalized explanations</p><p>Imagine a world where your AI assistant doesn’t just tell you what to do but also explains why it’s the best option for you specifically.</p><blockquote>With more AI comes more explanation — ML Engineer</blockquote><h4>Conclusion</h4><p>Agentic AI is shaping the next generation of intelligent systems that are autonomous, adaptive, and action-driven. But without explainability, they risk becoming black boxes we can’t trust. The combination of Agentic AI + XAI paves the way for responsible, ethical, and human-aligned AI.</p><p>Code notebook: <a href="https://colab.research.google.com/drive/1gV-Ca5Lzt7mWPm_zMkdgPU58ZS9Xqm3_?usp=sharing">https://colab.research.google.com/drive/1gV-Ca5Lzt7mWPm_zMkdgPU58ZS9Xqm3_?usp=sharing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=087502181fd0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/agentic-ai-systems-with-integrated-xai-building-smarter-transparent-and-trustworthy-ai-087502181fd0">Agentic AI Systems with Integrated XAI: Building Smarter, Transparent, and Trustworthy AI</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Python Apps on Google Cloud Run using Gitlab pipelines(CI/CD)]]></title>
            <link>https://medium.com/red-buffer/deploying-python-apps-on-google-cloud-run-using-gitlab-pipelines-ci-cd-702508b3d1eb?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/702508b3d1eb</guid>
            <dc:creator><![CDATA[Abdul Rehman Raja]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 09:34:18 GMT</pubDate>
            <atom:updated>2026-02-03T09:34:17.151Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d7rLIlvjr-c29LR2.png" /></figure><p>If you are a software developer, you must have heard about the CI/CD buzzwords. Today let’s break this down and understand how to implement CI/CD pipeline for deploying your python applications on Google Cloud Run’s serverless architecture using Gitlab pipelines.</p><h3>CI/CD</h3><p>CI /CD stands for continuous integration and continuous Delivery / Deployment. Continuous integration (CI) refers to the practice of automatically and frequently integrating code changes into a shared source code repository. Continuous delivery and/or deployment (CD) is a 2 part process that refers to the integration, testing, and delivery of code changes. Continuous delivery stops short of automatic production deployment, while continuous deployment automatically releases the updates into the production environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*lYAhJjTq8mTSX1uv" /></figure><h3>Google Cloud Run</h3><p>Google Cloud Run is a fully managed serverless platform that allows developers to deploy and scale containerized applications easily. As GCR is serverless so you do not have to worry about managing and scaling the compute resources, Google handles it for you.</p><h3>Gitlab</h3><p>Gitlab is a web-based platform developed on git (a distributed version control system) that helps development / Engineering teams manage their code. It provides following features:</p><ol><li>Source Code Management</li><li>Continuous integration and delivery (CI/CD)</li><li>Code Review</li><li>Security</li><li>AI-powered workflows</li><li>Data Analytics</li></ol><h3>Prerequisites</h3><p>Before getting started with our CI/CD journey, here are the prerequisites for our exercise:<br>1. Gitlab Repository<br>2. Google Cloud Platform (GCP) Account with billing setup<br>3. Docker</p><p>Now lets dive into implementing our first CI/CD pipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KitHU87siUgQwzLaAOilg.png" /></figure><h3>1. Install and Authenticate Google Cloud SDK</h3><p>Run these commands:</p><pre>snap install google-cloud-cli</pre><p>This command will download google cloud CLI on your ubuntu system. It might be different for Mac and windows. Now authenticate your GCP account using:</p><pre> gcloud auth login</pre><p>This should redirect you to google’s login page where you can choose or add your account for logging into google cloud.</p><h3>2. Setup Artifact Registry and Cloud Build API</h3><p>On your GCP Console, click on API &amp; Services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*jObMmuD-JpTZzsOSpqbgvw.png" /></figure><p>Search Artifact Registry API and Enable it if not already</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*hYcogMX6QGu1xIJImkj6KQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*0Fg7h0gjCsAgkv7Rq0TT8g.png" /></figure><p>Now Search Artifact Registry in the search tab and create a new repository as shown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yxTIDu5wFFVRM7CKefwJ2A.png" /></figure><p>Similarly Search Cloud Build API and Enable it from the API &amp; Services section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*eGer-vmgpcGERuEJDT5-fg.png" /></figure><h3>3. Setup Sevice Account</h3><p>Go to IAM &amp; Admin and click Service Accounts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*CjmHk23lKUsTJLKNgq2N3A.png" /></figure><p>Click on + Create Service Account and then follow these steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*1ALRh6KNpfdQ3Na1HMQdRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*W4FB6uBJ7Uml4SG24qQFVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*Z940R9XEX2GDpIXwRlk-Lg.png" /></figure><p>Now let’s generate a security key to access the service account.</p><p>Click on the Service account that you have created and then click on “KEYS” tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*w2WVSrsF4mQHsVr2MvH2dA.png" /></figure><p>Create a new JSON key (It would automatically be downloaded)and save it securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*dvPvcjW4ZV2OB5Dqd8HjDQ.png" /></figure><h3>4. Setup project locally</h3><p>Run this command locally to setup your GCP project locally</p><pre>gcloud config set project &lt;PROJECT_ID&gt;</pre><h3>5. Setup CI/CD Variables on Gitlab</h3><p>Open your Gitlab Repository, Go to Settings -&gt; CI/CD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*al7yXBbpDg_Nn8bHpuyhrA.png" /></figure><p>Add your variables as shown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OrT9ztAeruLgfsaj5S1dUg.png" /></figure><p>Here’s a short description of these variables:</p><ul><li><strong>.env</strong> file is copied as it is and pasted into the <strong>STAGING_ENV</strong> variable.</li><li><strong>GCP_PROJECT_ID</strong> can be copied from google cloud console home page once you select the project that you are working on. Remember this is not the service account Id.</li><li><strong>GCP_CLOUD_BUILD_SERVICE_KEY </strong>is simply the json key that was downloaded at end of step 3. You have to copy the json from that file and paste it into this variable.</li></ul><h3>6. Writing the Dockerfile:</h3><p>We can only deploy our applications in the form docker containers on Google Cloud Run. Containers come from images that are built using a Docerfile. So let’s write one now:</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app<br><br># Install dependencies<br>RUN apt-get update -y &amp;&amp; apt-get install -y default-jre &amp;&amp; apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/*<br><br># Copy code to Working directory<br>COPY . .<br><br># Install Python dependencies<br>RUN pip install --no-cache-dir -r requirements.txt<br><br># Expose application port<br>EXPOSE 8080<br><br># Run the application<br>CMD [&quot;chainlit&quot;, &quot;run&quot;, &quot;chainlit_app.py&quot;, &quot;--port&quot;, &quot;8080&quot;, &quot;-h&quot;]</pre><p>Remember to make our lives easy, we run our application on 8080 PORT otherwise, you can take a look into how to bind other ports with GCR as well.</p><h3>7. Writing the deployment action:</h3><p>Now that we have set our variables, we can proceed to writing the gitlab action for deployment. Here’s the .gitlab-ci.yml file:</p><pre>image: google/cloud-sdk:alpine<br><br>deploy_staging:<br>  stage: deploy<br>  environment: staging<br>  only:<br>    - staging<br>  script:<br>    - echo $ARTIFACT_REPO<br>    - echo $GCP_PROJECT_ID<br>    - cp $GCP_CLOUD_BUILD_SERVICE_KEY /tmp/gcloud-service-key.json<br>    - cp $STAGING_ENV  /tmp/.env<br>    - cp /tmp/.env .env<br>    - gcloud auth activate-service-account --key-file /tmp/gcloud-service-key.json<br>    - gcloud config set project $GCP_PROJECT_ID<br>    - gcloud builds submit  --config=cloudbuild.yaml --substitutions=_PROJECT_ID=$GCP_PROJECT_ID,_ARTIFACT_REPO=$ARTIFACT_REPO,_ENV_IMG_NAME=$ENV_IMG_NAME,_ENV=$ENV,_SERVICE_NAME=$SERVICE_NAME .<br>  variables:<br>    ENV_IMG_NAME: &lt;image_name&gt;<br>    ENV: &quot;staging&quot;<br>    ARTIFACT_REPO: &lt;artifact_repository_name&gt;<br>    SERVICE_NAME: &lt;service_name&gt;</pre><p>Your cloudbuild.yaml file should look something like this:</p><pre>steps:<br>  # build the container image<br>  - name: &quot;gcr.io/cloud-builders/docker&quot;<br>    args:<br>      [<br>        &quot;build&quot;,<br>        &quot;-t&quot;,<br>        &quot;us-central1-docker.pkg.dev/$_PROJECT_ID/$_ARTIFACT_REPO/$_ENV_IMG_NAME:$_ENV&quot;,<br>        &quot;.&quot;,<br>      ]<br>    # push the container image<br>  - name: &quot;gcr.io/cloud-builders/docker&quot;<br>    args:<br>      [<br>        &quot;push&quot;,<br>        &quot;us-central1-docker.pkg.dev/$_PROJECT_ID/$_ARTIFACT_REPO/$_ENV_IMG_NAME:$_ENV&quot;,<br>      ]<br>    # deploy to Cloud Run<br>  - name: &quot;gcr.io/cloud-builders/gcloud&quot;<br>    args:<br>      [<br>        &quot;run&quot;,<br>        &quot;deploy&quot;,<br>        &quot;$_SERVICE_NAME&quot;,<br>        &quot;--image&quot;,<br>        &quot;us-central1-docker.pkg.dev/$_PROJECT_ID/$_ARTIFACT_REPO/$_ENV_IMG_NAME:$_ENV&quot;,<br>        &quot;--region&quot;,<br>        &quot;us-central1&quot;,<br>        &quot;--platform&quot;,<br>        &quot;managed&quot;,<br>        &quot;--allow-unauthenticated&quot;,<br>        &quot;--memory&quot;,<br>        &quot;2Gi&quot;,<br>      ]<br>options:<br>  logging: CLOUD_LOGGING_ONLY</pre><h3>8. Push the Code</h3><p>Before pushing the code to your gitlab repository in staging branch (can be different for you if you are following the tutorial on any other branch) verify this directory structure:</p><pre>📂 Project Root<br>│── 📄 chainlit_app.py        # Main application file<br>│── 📂 src/                   # Source files directory<br>│   ├── &lt;src files&gt;.py        # Python source files<br>│── 📄 cloudbuild.yaml        # Google Cloud Build configuration<br>│── 📄 .gitlab-ci.yml         # GitLab CI/CD pipeline configuration<br>│── 📄 Dockerfile             # Docker container configuration<br>│── 📄 requirements.txt       # Dependencies list</pre><p>Finally we have completed our CI/CD pipeline and the way to test it is by pushing the code to staging branch (change .gitlab-ci.yml for other branchs). After pushing the code you can login to gitlab &gt; Your Repository &gt; Branch and see the pipeline running in action. You can also view the logs for deployment as well.</p><p>After the pipeline has run sucessfully, in your google cloud console &gt; GCR, you can see your cloud function in action and copy the the URI and Public URL of your cloud function.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=702508b3d1eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/deploying-python-apps-on-google-cloud-run-using-gitlab-pipelines-ci-cd-702508b3d1eb">Deploying Python Apps on Google Cloud Run using Gitlab pipelines(CI/CD)</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Create a Personal VPN on AWS EC2 Using OpenVPN — Easy & Complete Walkthrough]]></title>
            <link>https://medium.com/red-buffer/%EF%B8%8F-create-a-personal-vpn-on-aws-ec2-using-openvpn-easy-complete-walkthrough-1322e68b70c0?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/1322e68b70c0</guid>
            <category><![CDATA[openvpn-setup]]></category>
            <category><![CDATA[free-vpn]]></category>
            <category><![CDATA[openvpn-access-server]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[openvpn]]></category>
            <dc:creator><![CDATA[Mirzaafshal]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 06:19:56 GMT</pubDate>
            <atom:updated>2026-02-02T06:19:56.651Z</atom:updated>
            <content:encoded><![CDATA[<h3>🛡️ Create a Personal VPN on AWS EC2 Using OpenVPN — Easy &amp; Complete Walkthrough</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqo7bPzVydIDIbkrGCfewg.png" /></figure><p>Virtual Private Network (VPN) is a service that allows users to access websites privately through another network’s servers. VPN is one of the most effective solutions for protecting internet privacy and security.</p><p>In this article, you’ll learn how to spin up your own VPN server in under 30 minutes using an EC2 instance and OpenVPN.</p><p><strong>🔍 Why Create Your Own VPN?</strong></p><p>Before we dive in, let’s look at the benefits of hosting your own VPN:</p><ul><li><strong>Total control</strong>: No data logging unless you configure it.</li><li><strong>Bypass geo-restrictions</strong>: Access region-specific content.</li><li><strong>Enhanced security</strong>: Safely browse on public Wi-Fi.</li><li><strong>Save money</strong>: One-time setup, no monthly fee.</li><li><strong>Learning experience</strong>: Great way to improve your cloud and Linux skills.</li></ul><h3>🛠️ What You’ll Need</h3><ul><li>An <strong>AWS account</strong> (free tier eligible)</li><li>Basic command-line knowledge</li><li>A terminal or SSH client</li><li>~30 minutes of your time</li></ul><p><strong>☁️ Step 1: Launch an EC2 Instance</strong></p><ul><li>Go to <a href="https://console.aws.amazon.com/ec2">AWS EC2 Console</a>.</li><li>Click <strong>Launch Instance</strong>.</li><li>Choose an AMI:<br> 👉 <em>Ubuntu Server 22.04 LTS (recommended)</em></li><li>Select <strong>t2.micro</strong> (Free tier eligible).</li><li>Configure storage (default is fine).</li><li>Add a new <strong>key pair</strong> (save the .pem file securely).</li><li>Set up <strong>Security Group</strong> with the following rules:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*WUTnM11u54x-g0p4DID7mg.png" /></figure><ul><li>Launch the instance and note the <strong>Public IPv4 address</strong>.</li></ul><p><strong>🔐 Step 2: Connect to the EC2 Instance</strong></p><p>Use your terminal or SSH client to connect:</p><pre>chmod 400 your-key.pem<br>ssh -i your-key.pem ubuntu@your-ec2-public-ip</pre><p><strong>📦 Step 3: Install OpenVPN and Easy-RSA</strong></p><p>Once connected, install the necessary packages:</p><pre>sudo apt update &amp;&amp; sudo apt install openvpn easy-rsa -y</pre><p><strong>📁 Step 4: Set Up the CA and Server Certificates</strong></p><ul><li>Create the PKI directory:</li></ul><pre>make-cadir ~/openvpn-ca<br>cd ~/openvpn-ca</pre><ul><li>Build the CA:</li></ul><pre>./easyrsa init-pki<br>./easyrsa build-ca</pre><ul><li>Generate the server certificate and key:</li></ul><pre>./easyrsa gen-req server nopass<br>./easyrsa sign-req server server</pre><ul><li>Create Diffie-Hellman parameters and HMAC Key:</li></ul><pre>./easyrsa gen-dh<br>openvpn --genkey --secret ta.key</pre><p><strong>🔄 Step 5: Move Files to OpenVPN Directory</strong></p><pre>sudo cp pki/ca.crt pki/private/server.key pki/issued/server.crt ta.key pki/dh.pem /etc/openvpn/</pre><p><strong>⚙️ Step 6: Configure the OpenVPN Server</strong></p><p>Get a default config file:</p><pre>gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf</pre><p>Open it for editing:</p><pre>sudo nano /etc/openvpn/server.conf</pre><p>Make sure these lines are present/uncommented:</p><pre>port 1194<br>proto udp<br>dev tun<br>ca ca.crt<br>cert server.crt<br>key server.key<br>dh dh.pem<br>tls-auth ta.key 0<br>cipher AES-256-CBC<br>auth SHA256<br>user nobody<br>group nogroup<br>persist-key<br>persist-tun<br>status openvpn-status.log<br>verb 3</pre><p><strong>🔧 Step 7: Enable IP Forwarding</strong></p><p>Edit the sysctl config:</p><pre>sudo nano /etc/sysctl.conf</pre><p>Uncomment or add:</p><pre>net.ipv4.ip_forward=1</pre><p>Apply it:</p><pre>sudo sysctl -p</pre><p><strong>🔥 Step 8: Configure the UFW Firewall</strong></p><p>Allow SSH and VPN traffic:</p><pre>sudo ufw allow ssh<br>sudo ufw allow 1194/udp</pre><p>Edit UFW before rules:</p><pre>sudo nano /etc/ufw/before.rules</pre><p>Add this section at the top, before *filter:</p><pre>*nat<br>:POSTROUTING ACCEPT [0:0]<br>-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE<br>COMMIT</pre><p>Then set default forwarding:</p><pre>sudo nano /etc/default/ufw</pre><p>Change:</p><pre>DEFAULT_FORWARD_POLICY=&quot;ACCEPT&quot;</pre><p>Enable the firewall:</p><pre>sudo ufw disable &amp;&amp; sudo ufw enable</pre><p><strong>▶️ Step 9: Start and Enable OpenVPN</strong></p><p>Start the server:</p><pre>sudo systemctl start openvpn@server</pre><p>Enable on boot:</p><pre>sudo systemctl enable openvpn@server</pre><p>Check status:</p><pre>sudo systemctl status openvpn@server</pre><p><strong>📲 Step 10: Create a VPN Client Configuration</strong></p><ul><li>Generate client certificate and key:</li></ul><pre>cd ~/openvpn-ca<br>./easyrsa gen-req client1 nopass<br>./easyrsa sign-req client client1</pre><ul><li>Copy client files to your local machine:</li></ul><pre>scp -i your-key.pem ubuntu@your-ec2-ip:/home/ubuntu/openvpn-ca/pki/issued/client1.crt .<br>scp -i your-key.pem ubuntu@your-ec2-ip:/home/ubuntu/openvpn-ca/pki/private/client1.key .<br>scp -i your-key.pem ubuntu@your-ec2-ip:/etc/openvpn/ca.crt .<br>scp -i your-key.pem ubuntu@your-ec2-ip:/etc/openvpn/ta.key .</pre><p><strong>📝 Step 11: Create a .ovpn Profile</strong></p><p>Create a client1.ovpn file locally:</p><pre>client<br>dev tun<br>proto udp<br>remote your-ec2-public-ip 1194<br>resolv-retry infinite<br>nobind<br>persist-key<br>persist-tun<br>remote-cert-tls server<br>cipher AES-256-CBC<br>auth SHA256<br>key-direction 1<br>verb 3<br><br>&lt;ca&gt;<br># Paste content of ca.crt<br>&lt;/ca&gt;<br>&lt;cert&gt;<br># Paste content of client1.crt<br>&lt;/cert&gt;<br>&lt;key&gt;<br># Paste content of client1.key<br>&lt;/key&gt;<br>&lt;tls-auth&gt;<br># Paste content of ta.key<br>&lt;/tls-auth&gt;</pre><p>Now import the .ovpn file in your favorite VPN client (OpenVPN Connect, Tunnelblick, etc.).</p><h3><strong>💻 How to Use </strong><strong>.ovpn on Different Platforms</strong></h3><h4>Windows and Mac</h4><ol><li>Download OpenVPN from <a href="https://openvpn.net/client/">here</a> and install.</li><li>Click OpenVPN client and import .ovpn file.</li><li>Click <strong>Connect</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*eoZv7KVOmWuICGZG.png" /></figure><h4>Ubuntu/Linux</h4><p>Install OpenVPN:</p><pre>sudo apt update &amp;&amp; sudo apt install openvpn -y</pre><p>Run:</p><pre>sudo openvpn --config client1.ovpn</pre><h4>Android</h4><ul><li>Open the <strong>Google Play Store</strong> on your Android device.</li><li>Search for <strong>OpenVPN Connect</strong>.</li><li>Tap <strong>Install</strong> to download and install the app.</li><li>Once the installation is complete, open the <strong>OpenVPN Connect</strong> app.</li><li>Import .ovpn file.</li><li>After importing the profile, tap <strong>Connect</strong> to establish a connection to the VPN server</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/154/0*ODkIT1oD8fevbRz-" /></figure><h4>iOS (iPhone/iPad)</h4><ul><li>Open the <strong>App Store</strong> on your iOS device.</li><li>Search for <strong>OpenVPN Connect</strong>.</li><li>Tap the <strong>Get</strong> button to download and install the app.</li><li>Once the installation is complete, open the <strong>OpenVPN Connect</strong> app.</li><li>Import .ovpn file.</li><li>After importing the profile, you can now connect to the VPN server by selecting the profile and tapping <strong>Connect.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/0*xSnN1SODRmL1BRIi" /></figure><p><strong>🎉 You’re Done!</strong></p><p>You’ve successfully deployed a private VPN server on AWS EC2 using OpenVPN! You can now:</p><p>✅ Browse securely on public networks</p><p>✅ Access region-locked content</p><p>✅ Enjoy peace of mind with total data privacy</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1322e68b70c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/%EF%B8%8F-create-a-personal-vpn-on-aws-ec2-using-openvpn-easy-complete-walkthrough-1322e68b70c0">🛡️ Create a Personal VPN on AWS EC2 Using OpenVPN — Easy &amp; Complete Walkthrough</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero-Shot Object Detection with CLIP Models]]></title>
            <link>https://medium.com/red-buffer/zero-shot-object-detection-with-clip-models-8dc69bc8834b?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/8dc69bc8834b</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[clip-model]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[object-detection]]></category>
            <dc:creator><![CDATA[Ahmad Faraz Sheikh]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 08:10:38 GMT</pubDate>
            <atom:updated>2026-01-28T08:10:38.086Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you’re at a party, and your friend shows you a photo asking, ‘Can you spot the lychee in this picture?’ You might have never seen a lychee before, but if someone describes it as ‘a small, red fruit with a rough texture,’ you can use that information to make an educated guess. This is exactly what we want computers to do: recognize objects they’ve never been specifically trained to find by using prior knowledge from textual descriptions or related concepts. This is where <strong>Zero-Shot Object Detection</strong> comes in!</p><p>Traditional object detection systems work like rote learners. They need to see countless labeled examples: “cat,” “car,” “bottle”, before they can accurately identify objects. Imagine trying to teach a child what a spoon is by showing them hundreds of spoon photos instead of simply describing it. Not the most efficient way to learn, is it?</p><p>But what if we could create a system that learns more like humans? A system that doesn’t need to see every single example but can reason about objects from descriptions alone. That’s where CLIP (Contrastive Language-Image Pre-training), an AI model developed by OpenAI, comes into the picture. CLIP is like giving a computer both eyes to see and a brain that understands language. Let’s dive deeper into how it works, what makes it special, and how you can use it for your projects!</p><h3>Understanding the Basics</h3><h4>What Makes CLIP Special?</h4><p>Traditional computer vision models are like robots that can only recognize items from a predefined catalog. CLIP, on the other hand, is like having a smart assistant who understands both pictures and words and can connect them intelligently.</p><p>Here’s an analogy:</p><ul><li><strong>Traditional Model</strong>: “I can only recognize cats if you’ve shown me thousands of cat pictures during training.”</li><li><strong>CLIP</strong>: “I understand what cats look like AND I understand what the word ‘cat’ means, so I can identify cats even in situations I haven’t seen before!”</li></ul><h4>How CLIP Connects Images and Text</h4><p>Think of CLIP as a translator between two “languages”, the language of images and the language of text. Here’s how it works:</p><ul><li>When CLIP sees an image, it encodes it into a unique numeric representation, or embedding, that captures its essence.</li><li>Similarly, when CLIP reads a text description, it converts that text into the same type of embedding.</li></ul><p>These embeddings exist in a shared “space” where similar visual and textual concepts end up close to each other. For instance, a photo of a cat and the text “a cat” would be neighbors in this embedding space, enabling CLIP to make meaningful connections.</p><h4>The Concept of “Zero-Shot” Learning</h4><p>“<em>Zero-shot learning</em>” may sound technical, but it’s a simple idea. Let’s say someone tells you: “<em>A peacock is a large bird with vibrant, colorful feathers and a fan-shaped tail.</em>” Even if you’ve never seen one in person, you could identify a peacock in a picture using this description alone. That’s <strong>zero-shot learning, </strong>the ability to recognize something new without prior specific training.</p><p>This skill is incredibly valuable in the real world, where it’s impossible to train AI on every possible object or scenario. CLIP’s zero-shot capabilities allow it to scale effortlessly to new tasks. Let me know if you’d like me to adjust further!</p><h4>Real-World Applications and Benefits</h4><p>CLIP’s abilities open up exciting possibilities in the real world:</p><ol><li>Flexible Search Systems: Want to find “a person wearing a red hat sitting on a beach” in your photo library? CLIP can help!</li><li>Accessibility Tools: Helping visually impaired people understand images through natural descriptions</li><li>Creative Tools: Helping artists and designers find specific visual references based on text descriptions</li></ol><p>The beauty of CLIP is that it’s incredibly versatile; you don’t need to retrain it for each new type of object you want to detect. It’s like having a universal translator between the visual world and human language!</p><h3>How CLIP Works</h3><h4>Architecture Overview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*4_gWyuWYea7KfYo-r_yWKA.png" /><figcaption>Encoder Component of Clip</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*RYo0wifLVNotoAixY9qMOA.png" /><figcaption>Classifier Component of CLIP</figcaption></figure><p>Imagine CLIP as two parallel pathways that eventually meet, like two rivers joining together:</p><p><strong>Image Encoder</strong> (Vision Pathway):</p><ul><li>This is like a smart camera that takes images</li><li>Uses a modified Vision Transformer (ViT) or ResNet</li><li>Converts images into a standardized 512-dimensional vector (think of it as a special code)</li></ul><p><strong>Text Encoder</strong> (Language Pathway)</p><ul><li>This is like a language expert that processes text</li><li>Uses a Transformer architecture similar to GPT</li><li>Converts text descriptions into the same type of 512-dimensional vector</li></ul><p>These two pathways are trained together using contrastive learning, imagine teaching a child to match pictures with their descriptions by showing them both correct and incorrect pairs.</p><h4>The Contrastive Learning Approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckZIZ-kQdlXyBvColkTeyA.png" /><figcaption>CLIP’s Training Pipeline : Converting images and text into a shared space for matching, with parallel encoders processing inputs and optimizing for correct image-text pairs through contrastive learning.</figcaption></figure><p>CLIP (Contrastive Language-Image Pre-training) works like a sophisticated matching game where it learns to connect images with their corresponding text descriptions. The model has two main components: a vision encoder for processing images and a text encoder for handling language, both converting their inputs into comparable mathematical representations. During training, CLIP looks at multiple image-text pairs and learns to recognize correct matches while distinguishing incorrect ones. This simple but powerful approach allows CLIP to learn from millions of image-text pairs found on the internet, helping it develop a robust understanding of how visual content relates to natural language descriptions.</p><h3>Hands-on Implementation</h3><p>Let’s walk through a complete example of using CLIP for object detection:</p><p><strong>Loading and Preparing CLIP</strong></p><pre>import clip<br>import torch<br>from PIL import Image<br><br># Load the model<br>model, preprocess = clip.load(&quot;ViT-B/32&quot;, device=device)<br><br># Prepare your image<br>image = Image.open(&quot;path_to_your_image.jpg&quot;)<br>image_input = preprocess(image).unsqueeze(0).to(device)</pre><p><strong>Writing Text Prompts</strong></p><pre># Define what you&#39;re looking for<br>text_descriptions = [&quot;a dog&quot;, &quot;a cat&quot;, &quot;a person&quot;, &quot;a car&quot;, &quot;a tree&quot;<br>]<br># Encode text descriptions<br>text_tokens = clip.tokenize(text_descriptions).to(device)</pre><p><strong>Processing Images and Text</strong></p><pre>with torch.no_grad():<br>    # Get image features<br>    image_features = model.encode_image(image_input)<br>    <br>    # Get text features<br>    text_features = model.encode_text(text_tokens)<br>    <br>    # Calculate similarity<br>    similarity = torch.nn.functional.cosine_similarity(<br>        image_features, text_features<br>    )<br><br># Get the most likely match<br>most_likely = text_descriptions[similarity.argmax().item()]<br>print(f&quot;This image most likely contains {most_likely}&quot;)</pre><h4>Testing CLIP with a Real-World Example</h4><p>To demonstrate CLIP’s capabilities, let’s consider the following test case. We provide the model with a list of textual prompts to compare with an image of cookies. Our prompts include:</p><ul><li>“chocolate chip cookies”</li><li>“cookies”</li><li>“a cat”,</li><li>“a dog”,</li><li>“a cow”,</li><li>“a person standing”</li></ul><p>After running the code on the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*AEIQZnGebbbc6ppGkt0VKQ.jpeg" /><figcaption>Image of cookies</figcaption></figure><p>through CLIP with these textual descriptions, the model outputs the following results:</p><ul><li>Detected chocolate chip cookies with <strong>31.745%</strong> confidence</li></ul><p>sAs we can see, the object “chocolate chip cookies” with the highest confidence score (31.745%) is returned, which is the most specific and accurate match for the given image. This highlights how CLIP effectively aligns visual content with textual descriptions, even when given highly contextual or detailed prompts.</p><h3>From Images to Videos: Detecting Objects in Motion</h3><p>Imagine this: You’re watching a wildlife documentary, and you spot a rare bird. You snap a photo, wondering, “Can I find every moment this bird appears in the video?” But here’s the catch: you don’t know the bird’s name, and you can’t find any information about it online. You might think you need a name or description to search for it in the video based on the previous details in this article. But with CLIP, you don’t need any of that.</p><p>Using just the image of the bird, CLIP can scan the entire video and pinpoint every frame where the bird appears. No labels, no descriptions, just the power of AI connecting images and context.</p><p>In this section, we’ll take CLIP’s zero-shot object detection capabilities to the next level. Not only can CLIP identify objects in static images, but it can also track them across videos. Let’s dive into how you can detect an object using its image and retrieve all the frames where it appears.</p><p><strong>Generate Embeddings for the Target Object:</strong></p><pre>import cv2<br><br># Load and preprocess the target object image<br>target_image = Image.open(&quot;path_to_your_image&quot;)<br>target_image_preprocessed = preprocess(target_image).unsqueeze(0).to(device)<br><br># Generate embedding for the target object<br>with torch.no_grad():<br>    target_embedding = model.encode_image(target_image_preprocessed)<br>    target_embedding /= target_embedding.norm(dim=-1, keepdim=True)</pre><p><strong>Scan Video Frames for the desired Object</strong></p><pre># Open video file<br>video_path = &quot;/content/test (1).mp4&quot;<br>cap = cv2.VideoCapture(video_path)<br><br>frame_rate = int(cap.get(cv2.CAP_PROP_FPS))  # Get frame rate<br>detected_frames = []<br><br>while cap.isOpened():<br>    ret, frame = cap.read()<br>    if not ret:<br>        break<br><br>    # Convert frame to PIL Image and preprocess<br>    frame_pil = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))<br>    frame_preprocessed = preprocess(frame_pil).unsqueeze(0).to(device)<br><br>    # Compute embedding for current frame<br>    with torch.no_grad():<br>        frame_embedding = model.encode_image(frame_preprocessed)<br>        frame_embedding /= frame_embedding.norm(dim=-1, keepdim=True)<br><br>    # Compare embeddings (cosine similarity)<br>    similarity = (frame_embedding @ target_embedding.T).item()<br><br>    # If similarity exceeds a threshold, save the frame<br>    if similarity &gt; 0.2:  # Adjust threshold as needed<br>        detected_frames.append(frame)  # Store detected frame<br><br>cap.release()</pre><h3>Conclusion</h3><p>Imagine a world where AI can recognize any object, in any image or video, without ever having seen it before. This is no longer just a futuristic dream, it’s becoming a reality with CLIP’s zero-shot object detection.</p><p>With traditional object detection models, we were stuck in a cycle of collecting massive labeled datasets, training models for hours, and constantly updating them with new objects. But CLIP changes the game. Instead of memorizing countless images, it understands objects through language, much like how we humans do. This breakthrough opens up endless possibilities:</p><ul><li><strong>Smarter search systems</strong> that let you find photos using natural descriptions.</li><li><strong>Enhanced accessibility tools</strong> that help visually impaired users understand their surroundings.</li><li><strong>Creative AI applications</strong> that let artists and designers retrieve inspiration through text-based queries.</li><li><strong>Video tracking</strong> that identifies objects across footage, even if their names are unknown.</li></ul><p>The best part? <strong>No specialized retraining is required</strong>. Whether you’re a developer, a researcher, or an AI enthusiast, <strong>CLIP offers a powerful way to explore the connection between vision and language</strong>.</p><p>If you’re excited to try it out, check out my <strong>GitHub repository</strong>, where I’ve implemented CLIP for zero-shot object detection. Let’s push the boundaries of AI together! 🚀</p><h3>GitHub Repository</h3><p>📌 <strong>Explore my CLIP-based object detection implementation:</strong><br>🔗 <a href="https://github.com/FarazSheikh16/zero-shot-object-detection-using-clip">My GitHub Repository</a></p><h3>Further Reading &amp; Resources</h3><p>📄 <strong>CLIP Research Paper:</strong> <a href="https://arxiv.org/abs/2103.00020">Learning Transferable Visual Models From Natural Language Supervision</a><br>🖥️ <strong>Official OpenAI CLIP Repository:</strong> <a href="https://github.com/openai/CLIP">CLIP on GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dc69bc8834b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/zero-shot-object-detection-with-clip-models-8dc69bc8834b">Zero-Shot Object Detection with CLIP Models</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Olostep: Web Data API for AI and Research Automation]]></title>
            <link>https://medium.com/red-buffer/olostep-web-data-api-for-ai-and-research-automation-be8c93c28ef1?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/be8c93c28ef1</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Abdul Rehman Raja]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 08:23:03 GMT</pubDate>
            <atom:updated>2026-01-21T08:23:02.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqo1b4kXa35tYiX8SEjMHA.png" /></figure><p>Are you building agents that access Stack Overflow like your friend in a hoodie sitting in a dark room, staring at a glowing screen, wearing fancy headphones, and somehow always knowing the right answer?</p><p>Except… instead of a human, it’s your AI.</p><p>If yes, then you already know the problem: <strong>AI is only as good as the data it can access. </strong>And the web is messy, dynamic, JavaScript-heavy, and bot-protected, which is not exactly AI-friendly.</p><p>That’s where <strong>Olostep</strong> comes in.</p><h3>What is Olostep (in plain English)?</h3><p><strong>Olostep is a Web Data API that enables your AI to effectively utilize the internet.</strong></p><p>Not “trained-on-the-web-in-2023” internet but <strong>live, real, structured, up-to-date web data</strong>.</p><p>Instead of fighting with:</p><ul><li>Headless browsers</li><li>Proxy rotation</li><li>CAPTCHAs</li><li>JavaScript rendering</li><li>Brittle scrapers that break every two weeks</li></ul><p>You send Olostep a URL (or a task), and it gives you back <strong>clean, usable data </strong>ready for:</p><ul><li>AI agents</li><li>RAG pipelines</li><li>Research automation</li><li>Dashboards</li><li>Lead enrichment</li><li>Competitor tracking</li></ul><p>Think of Olostep as:</p><blockquote>“The data intern your AI deserves but one that never sleeps.”</blockquote><h3>What can Olostep do?</h3><p>At a high level, Olostep offers APIs for:</p><ul><li><strong>Scraping</strong> individual pages</li><li><strong>Crawling</strong> entire websites</li><li><strong>Mapping</strong> all URLs on a domain</li><li><strong>Batch processing</strong> thousands of URLs</li><li><strong>AI-powered web answers</strong> with sources</li><li><strong>Parsing unstructured content into JSON</strong></li><li><strong>Agent-based automation</strong> using natural language</li></ul><p>Basically:</p><blockquote>If the data exists on the public web, Olostep can probably get it.</blockquote><h3>Core Concepts (Quick Tour)</h3><h3>Scrapes (“Give me this page”):</h3><p>You pass a URL.<br> Olostep returns the content in HTML, Markdown, or text format.</p><p>Perfect for:</p><ul><li>Blog posts</li><li>Documentation</li><li>Product pages</li><li>Landing pages</li></ul><h3>Crawls (“Give me this whole site”)</h3><p>You give a starting URL.<br> Olostep recursively follows internal links and collects pages.</p><p>Great for:</p><ul><li>Docs ingestion</li><li>Knowledge bases</li><li>RAG pipelines</li><li>Internal search engines</li></ul><h3>Batches (“Do this at scale”)</h3><p>Have 1,000 to 10,000 URLs?<br>Send them in one job and let Olostep handle concurrency.</p><p>Used for:</p><ul><li>Lead enrichment</li><li>SEO audits</li><li>Price monitoring</li><li>Market research</li></ul><h3>Answers (“Search the web and explain it to me.”)</h3><p>Instead of scraping first and prompting later, Olostep can:</p><ul><li>Search the web</li><li>Read multiple sources</li><li>Generate an AI answer</li><li>Attach references</li></ul><p>Perfect for:</p><ul><li>Research agents</li><li>Analyst copilots</li><li>Internal Q&amp;A tools</li></ul><h3>Hands-On Activity (Python): Scrape a Web Page</h3><pre>import requests<br>API_KEY = &quot;&lt;YOUR_API_KEY&gt;&quot;<br>API_URL = &quot;https://api.olostep.com/v1/scrapes&quot;<br>headers = {<br>    &quot;Authorization&quot;: f&quot;Bearer {API_KEY}&quot;,<br>    &quot;Content-Type&quot;: &quot;application/json&quot;<br>}<br>ppayload = {<br>    &quot;url_to_scrape&quot;: &quot;https://example.com&quot;<br>}<br>response = requests.post(API_URL, headers=headers, json=payload)<br>data = response.json()<br>print(data[&quot;markdown_content&quot;])</pre><h4>What’s happening here?</h4><ul><li>Olostep loads the page (JS included)</li><li>Extracts the content</li><li>Returns it in a <strong>clean, AI-friendly format</strong></li></ul><p><strong><em>Pros:</em></strong></p><ul><li>No retries</li><li>No IP blocked issues (Scalable)</li><li>No Selenium</li></ul><h3>Hands-On Activity (Node.js): Ask the Web a Question (AI-Powered)</h3><pre>const API_KEY = &quot;YOUR_API_KEY&quot;;<br>fetch(&quot;https://api.olostep.com/v1/answers&quot;, {<br>  method: &quot;POST&quot;,<br>  headers: {<br>    &quot;Authorization&quot;: `Bearer ${API_KEY}`,<br>    &quot;Content-Type&quot;: &quot;application/json&quot;<br>  },<br>  body: JSON.stringify({<br>    task: &quot;What are the biggest AI trends in 2026?&quot;,<br>    json: {<br>      trend: &quot;&quot;,<br>      explanation: &quot;&quot;<br>    }<br>  })<br>})<br>  .then(res =&gt; res.json())<br>  .then(data =&gt; console.log(data))<br>  .catch(err =&gt; console.error(err));</pre><h3>Python SDK (Cleaner, Less Boilerplate)</h3><p>If you don’t want to deal with raw HTTP calls, Olostep’s <strong>Python SDK</strong> makes life easier.</p><h3>Installation</h3><pre>pip install olostep</pre><h3>Example: Simple Scrape</h3><pre>from olostep import Olostep<br>client = Olostep(api_key=&quot;YOUR_API_KEY&quot;)<br>result = client.scrapes.create(<br>    url_to_scrape=&quot;https://docs.olostep.com&quot;<br>)<br>print(result.markdown_content)</pre><h3>Example: Crawl a Website</h3><pre>crawl = client.crawls.create(<br>    start_url=&quot;https://docs.olostep.com&quot;<br>)<br>for page in crawl.pages():<br>    print(page.url)</pre><h3>When to use the SDK</h3><ul><li>You’re building pipelines</li><li>You want pagination handled automatically</li></ul><h3>Node SDK (Agent-Friendly &amp; Async)</h3><p>The <strong>Node SDK</strong> is ideal if you’re building:</p><ul><li>AI agents</li><li>Backend services</li><li>Serverless workflows</li></ul><h3>Installation</h3><pre>npm install olostep</pre><h3>Example: Scrape a Page</h3><pre>import { Olostep } from &quot;olostep&quot;;<br>const client = new Olostep({<br>  apiKey: &quot;YOUR_API_KEY&quot;<br>});<br>const result = await client.scrapes.create({<br>  url_to_scrape: &quot;https://example.com&quot;<br>});<br>console.log(result.markdown_content);</pre><h3>Example: Batch URLs</h3><pre>const batch = await client.batches.create({<br>  items: [<br>    { custom_id: &quot;1&quot;, url: &quot;https://site1.com&quot; },<br>    { custom_id: &quot;2&quot;, url: &quot;https://site2.com&quot; }<br>  ]<br>});<br>console.log(batch);</pre><h3>Why SDKs matter</h3><ul><li>Less error-prone</li><li>Easier retries</li><li>Cleaner agent integration</li><li>Faster prototyping</li></ul><h3>Supported Platforms</h3><p>Olostep doesn’t care where your code lives: local machine, cloud, CI pipeline, or some mysterious server you SSH into once and never touch again.</p><p>If it can make HTTP requests, <strong>Olostep works there</strong>.</p><h3>Programming Languages</h3><p>Out of the box, Olostep supports:</p><ul><li><strong>Python (F</strong>or data pipelines, ML workflows, and RAG systems)</li><li><strong>Node.js / JavaScript</strong> (For backend services, agents, and serverless functions)</li></ul><p>And if you’re using something else?<br> No problem, Olostep is a <strong>plain HTTP API</strong>, so you can integrate it with:</p><ul><li>Go</li><li>Java</li><li>C#</li><li>PHP</li><li>Ruby</li><li>Bash (yes, really)</li></ul><h3>Deployment Environments</h3><p>Olostep works seamlessly across:</p><ul><li><strong>Local development</strong> (Mac, Linux, Windows)</li><li><strong>Cloud servers</strong> (AWS, GCP, Azure, DigitalOcean)</li><li><strong>Serverless platforms</strong> (AWS Lambda, Vercel, Cloudflare Workers*)</li><li><strong>Docker &amp; Kubernetes</strong> workloads</li><li><strong>CI/CD pipelines</strong></li></ul><p>If your app can reach the internet, it can reach Olostep.</p><h3>AI &amp; Agent Frameworks</h3><p>Olostep fits naturally into modern AI stacks and agentic workflows, including:</p><ul><li><strong>LangChain</strong></li><li><strong>LlamaIndex</strong></li><li><strong>Custom RAG pipelines</strong></li><li><strong>Agent-based architectures</strong></li><li><strong>Internal research copilots</strong></li></ul><p>It acts as the <strong>“web access layer”, </strong>the part that actually fetches reality before your LLM starts hallucinating.</p><h3>Data Formats</h3><p>Olostep speaks the formats your systems already understand:</p><ul><li><strong>HTML</strong> (raw page content)</li><li><strong>Markdown</strong> (perfect for RAG ingestion)</li><li><strong>Plain text</strong></li><li><strong>Structured JSON</strong> (via parsers or AI extraction)</li></ul><h3>Conclusion</h3><p>Most AI systems today don’t fail because the models are bad; they fail because <strong>they’re blind to the real, live web</strong>.</p><ul><li>They hallucinate.</li><li>They rely on stale knowledge.</li><li>They guess instead of verifying.</li></ul><p>Olostep fixes that by giving your AI what it’s been missing all along: <strong>reliable, structured, up-to-date access to the internet.</strong></p><p>Whether you’re building:</p><ul><li>Agentic RAG systems,</li><li>Research automation,</li><li>Internal copilots,</li><li>Lead enrichment pipelines,</li><li>or large-scale web intelligence tools,</li></ul><p>Olostep removes the painful parts of web data extraction, letting you focus on <strong>building intelligence instead of infrastructure</strong>.</p><ul><li>No brittle scrapers.</li><li>No proxy chaos.</li><li>No JavaScript nightmares.</li></ul><p>Just clean data, delivered at scale exactly when your AI needs it. So if you want your AI to stop <em>pretending</em> it knows the web and actually <strong>use it</strong>, Olostep might just be the hoodie-wearing genius sitting quietly behind the scenes, only faster, scalable, and always online.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be8c93c28ef1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/olostep-web-data-api-for-ai-and-research-automation-be8c93c28ef1">Olostep: Web Data API for AI and Research Automation</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic MCP: Dynamic MCP Integration for AI Agents]]></title>
            <link>https://medium.com/red-buffer/agentic-mcp-dynamic-mcp-integration-for-ai-agents-5c1daf5b950c?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c1daf5b950c</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[agentic-mcp]]></category>
            <dc:creator><![CDATA[Ahmad Faraz Sheikh]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 06:32:43 GMT</pubDate>
            <atom:updated>2025-11-17T06:32:42.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkHnPR7zRhQpt7TBBiKQLQ.png" /></figure><p>Integrating the Model Context Protocol (MCP) into AI agents still feels like heavy lifting. Each time we want an agent to access a data source or a tool, we dive into config files, register endpoints, reload services, and keep track of what’s connected. It might work, but it’s slow, brittle, and doesn’t scale well. Additionally, when we load every possible MCP into the agent’s configuration ahead of time, we can encounter the <strong>tool overload</strong> issue. Too many available options clutter the agent’s context, increase token usage, slow reasoning, and reduce accuracy.</p><p>Now, imagine an agent that already knows which MCPs are available to it. When a user submits a query, the agent can determine on its own whether a specific MCP is needed, automatically load it into its context, and continue the conversation without interruption. There’s no need for a manual agent restart after updating the configuration. This approach maintains a seamless and efficient workflow while preserving context and minimizing computational overhead. Since the agent only activates the MCPs required for a given query, it also minimizes token usage and operational cost, avoiding the inefficiency of loading every MCP by default.</p><h3>Architecture Overview</h3><p>The architecture for dynamic MCP integration is built around two main layers inside the agent: <strong>Initial Processing</strong> and <strong>Dynamic MCP Handling</strong>. Together, they enable the agent to determine whether a user query can be resolved internally or if it requires an external MCP, and then seamlessly bring that MCP into use.</p><h4>1. Initial Processing</h4><p>When a user submits a query, the agent first evaluates whether it can handle the request directly. If the logic or data needed already exists within the agent’s internal context, it generates an immediate response. This keeps lightweight tasks fast and efficient.</p><h4>2. Dynamic MCP Handling</h4><p>For queries that require external information or specialized processing, the agent shifts to its dynamic integration layer:</p><ul><li><strong>MCP Discovery:</strong> The agent fetches a list of available MCPs from its directory or registry.</li><li><strong>MCP Selection:</strong> It evaluates which MCP can help cater to the user’s query based on domain relevance, available tools, and description.</li><li><strong>MCP Integration:</strong> The selected MCP is dynamically attached to the agent’s runtime environment.</li><li><strong>Execution:</strong> The agent, now equipped with the right MCP, processes the query, retrieves results, and delivers the response all within the same conversational flow.</li></ul><p>This design eliminates the need for manual configuration updates, prevents tool overload, and optimizes both performance and cost. The agent remains context-efficient, loading only the MCPs needed for each interaction rather than keeping all integrations active at once.</p><p>You can visualize the complete flow below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*TVbzHh4okw9edlgVa9TlJg.png" /></figure><h3>Implementation Approach</h3><p>To bring this design into practice, I implemented a two-stage mechanism that enables the agent to dynamically discover, select, and integrate MCPs while maintaining the session context intact.</p><h4>1. MCP Discovery Tool</h4><p>The process begins with a dedicated tool that queries the database for all registered MCP configurations. Each configuration includes the MCP’s name, description, and other configurations. The tool compiles this information into a structured list (with only the names and description) and passes it to the agent as part of the runtime context. This provides the agent with real-time awareness of what MCPs are currently available, without hard-coding them into configuration files.</p><h4>2. Agent-Driven Selection</h4><p>When a user submits a query, the agent evaluates it against the list of available MCPs. Using the descriptions as semantic hints, the agent determines which MCP can best fulfill the user’s request. This decision is made autonomously at runtime, without requiring any manual input.</p><h4>3. Dynamic Registration and Context Preservation</h4><p>Once the agent selects the most relevant MCP, it calls a second tool that handles the registration process. This tool spawns a new agent instance that inherits all configurations, states, and previous MCPs from the existing session, and then integrates the newly required MCP. The result is a refreshed agent that can immediately proceed with the same conversation, now equipped with the right capabilities to address the query.</p><h4>4. Continuous Flow and Efficiency</h4><p>Because the transition occurs seamlessly within the same conversation, the user never experiences a context break. This method avoids preloading every MCP, saving both token usage and compute cost, while maintaining continuity in reasoning and dialogue.</p><h3>Design Considerations</h3><p>Building a dynamic MCP integration system requires more than just connecting agents and protocols. It also requires reliable coordination, state management, and careful control of how agents and tools interact. The following considerations form the backbone of a scalable and resilient setup.</p><h4>1. Centralized MCP Manager</h4><p>A centralized MCP Manager acts as the source of truth for all available MCPs. It stores configurations, maintains metadata (names, endpoints, descriptions, status), and exposes a discovery API for agents to query. This setup ensures that updates to MCPs are reflected instantly across all agents, avoiding configuration drift. The MCP Manager can also implement health checks to track the availability and responsiveness of each MCP.</p><h4>2. Centralized Agent Manager</h4><p>A Centralized Agent Manager complements the MCP Manager by overseeing the lifecycle of active agents.</p><ul><li><strong>Synchronization with the MCP Manager:</strong> It remains in sync with the MCP registry, ensuring that each agent always has access to the latest MCP configurations.</li><li><strong>Smooth Restarts:</strong> It handles agent restarts gracefully, automatically reinitializing previous contexts and reloading relevant MCPs without losing session history.</li><li><strong>Seamless Query Transfer:</strong> It manages transitions when a query needs to move from one agent instance to another, maintaining the user conversation flow without interruptions or context resets.</li></ul><h4>3. Prompt and Tool Usage Guidelines</h4><p>Agents should be guided with well-structured prompt templates that instruct how to decide between <em>getting</em> or <em>adding</em> an MCP. Clear prompting reduces ambiguity in tool invocation and ensures the agent behaves deterministically when selecting or attaching new MCPs.</p><ul><li><strong>MCP Discovery Tool:</strong> Used when the agent needs to query the MCP Manager for the list of available MCPs.</li><li><strong>Add MCP Tool:</strong> Triggered when the agent identifies a new MCP required for the current query and needs to integrate it into the runtime context.<br> Both tools should include lightweight validation logic to confirm successful MCP addition and maintain traceability in logs.</li></ul><h3>Possible Enhancements and Alternate Approaches</h3><p>Depending on system needs and use-case complexity, several refinements can be introduced within the existing architecture:</p><ul><li><strong>Preload MCP List at Session Start</strong><br>Instead of relying on a dedicated tool to fetch available MCPs each time, the agent can load the MCP registry directly into its context when a new session begins. To avoid a tool call.</li><li><strong>Temporary MCP Handling via Sub-Agent</strong><br>For setups that do not want to retain MCPs permanently, the logic can be adjusted so that instead of restarting the entire agent, a lightweight sub-agent is spawned. This sub-agent carries only the required MCP, processes the specific user query, and passes the response back to the main agent before being terminated.</li><li><strong>Controlled MCP Removal</strong><br>A dedicated tool can be introduced to remove a specific MCP from the agent’s context, freeing up memory and reducing token usage. This action would only trigger on explicit user request and should include a confirmation prompt before deletion to prevent accidental removals.</li></ul><h3>Conclusion</h3><p>Dynamic MCP integration represents a practical step toward truly adaptive I agents. By allowing agents to discover, attach, and manage MCPs on demand, we remove the rigidity of manual configurations and unlock smoother, context-preserving workflows. The architecture not only simplifies development but also optimizes cost, resource use, and scalability.</p><p>As agent ecosystems grow, such mechanisms will become essential for balancing autonomy with control. Whether through centralized managers, sub-agents, or contextual reloading, the goal remains the same: to enable agents who can understand what they need, find it, and use it responsibly within the workflow. This shift moves AI agents from being pre-wired systems to becoming dynamic collaborators that configure themselves intelligently. If you’ve been working on similar adaptive agent architectures or have thoughts on improving MCP discovery and management, feel free to share your perspective in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c1daf5b950c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/agentic-mcp-dynamic-mcp-integration-for-ai-agents-5c1daf5b950c">Agentic MCP: Dynamic MCP Integration for AI Agents</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kolmogorov-Arnold Networks: A Game Changer or Just Another AI Experiment?]]></title>
            <link>https://medium.com/red-buffer/kolmogorov-arnold-networks-a-game-changer-or-just-another-ai-experiment-4736189f59b6?source=rss----8d86c116b0ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/4736189f59b6</guid>
            <category><![CDATA[ai-revolution]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[kolmogorov-arnold-network]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Mubashir Iqbal]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 11:40:32 GMT</pubDate>
            <atom:updated>2025-07-11T11:40:32.583Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q8wb6-BpCcWBdvRL.png" /><figcaption><a href="https://www.dailydoseofds.com/content/images/size/w1000/2024/05/image-156.png">Source</a></figcaption></figure><p>Kolmogorov-Arnold Networks (KANs) is an exciting new development in deep learning, pushing the boundaries of traditional models like Multi-Layer Perceptrons (MLPs). Inspired by the principles of the Kolmogorov-Arnold Representation Theorem, KANs introduce a novel approach to building neural networks. Unlike MLPs, which use fixed activation functions at each node (commonly referred to as “neurons”), KANs feature learnable activation functions on the connections between nodes (known as “edges”). Instead, each weight parameter is replaced by a univariate function, specifically a spline, which can easily switch between broad and detailed adjustments. This shift not only simplifies the handling of complex functions but also enhances the flexibility and interpretability of neural network architectures, marking a significant leap forward in AI technology.</p><h3>Historical Background</h3><p>Let’s delve into history to understand the KAN architecture. At the end of the 19th century, there was a competition between mathematicians and physicists to break down some higher-degree equations into simple equations that were easy to deal with and understand as those equations were mostly required for different industries to use. Some equations of specific degrees were solved by mathematicians, but some were not. This led to a question that was mentioned in <strong>23 Hilbert’s Problem </strong>as the thirteenth question: whether it is possible to break 7th-degree polynomials into simpler functions of 2 variables.</p><p>This question was there for a reason because if there could be a way to do this then working with and estimating complex functions could be made easier. Or in simple words we can describe multiple dimensions by breaking them into simple dimensions which would be easy to understand individually.</p><p>To solve this problem, two main theories were discovered:</p><ol><li><strong>Universal Approximation Theorem</strong></li><li><strong>Kolmogorov-Arnold Representation theorem</strong></li></ol><h3><strong>Universal Approximation Theorem:</strong></h3><p>It is the foundation of the <strong>Multi-Layer Perceptron (MLP)</strong>, also known as the traditional neural network architecture. It aims to approximate complex functions with the desired accuracy using a feed-forward network.</p><blockquote>“It states that the complex relationship between input and output (a complex function) can be estimated using a hidden layer with <em>n</em> neurons (<em>n</em> may vary depending on the problem), where a sigmoid or any other nonlinear function should be used as the activation function for nonlinear mapping.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*c_itpDWnyQBoE_Eq" /><figcaption><a href="https://www.nicolamanzini.com/single-hidden-layer-neural-network/">Hidden layer is approximating the function</a></figcaption></figure><h3><strong>Kolmogorov–Arnold representation theorem:</strong></h3><p>Consider that your colleague has written a complex piece of code that performs multiple tasks. You have been assigned to review and understand it. However, the problem is that all these tasks are implemented in a non-standard way — without modules, classes, or functions. Would it be easier for you to analyze and understand this code, or would a well-structured version that follows the separation of concerns (i.e., one function per task) be more manageable?</p><p>You guessed it right — the code that is broken down into functions and classes will be much easier to understand and modify. This is exactly what the <strong>Kolmogorov-Arnold Theorem</strong> does.</p><blockquote>Any complex function, no matter how many different inputs it has, can be broken down into a combination of simpler, one-variable functions.</blockquote><p><strong>Mathematically</strong>, the theorem can be stated as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*lwpjz2CEg10EjRTPEeYubA.png" /></figure><p>where Φq​ and ϕqp ​ are continuous functions of one variable.</p><h3><strong>Kolmogorov Arnold Network</strong></h3><p>Now that we have a basic overview of the Kolmogorov-Arnold Theorem, we can understand why there was a great quest among the research community to develop a way to utilize the Kolmogorov–Arnold Representation Theorem for solving AI problems. This is because it could help train models more efficiently using significantly less data. Kolmogorov-Arnold Networks (KANs) address this challenge by modifying the theorem to enhance computational efficiency.</p><p>Now, let’s dive into how KANs have adapted the Kolmogorov–Arnold Theorem in their architecture.</p><h3>Mathematical Form of KAN</h3><p>Before going in more depth lets understand the Mathematical form of KAN in a better way.<br><br>Lets consider Housing pricing dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*zF8tlJ42c2BPiN19p92PvQ.png" /></figure><p>The relation between price and features can be represented using a multivariate function, say <strong>F.</strong></p><blockquote>Price = f(φ_b(bedrooms) + φ_sq(area) + φ_a(age))</blockquote><blockquote>Price = f₁(φ_b(bedrooms) + φ_sq(area) + φ_a(age)) + … + fₙ(φ_b(bedrooms) + φ_sq(area) + φ_a(age))</blockquote><p>Instead of looking at price as a single formula, we break it down into multiple layers or steps, making it easier to interpret how each small function contributes to the final prediction. Each of these smaller functions captures the effect of bedrooms, area, and age separately, allowing us to understand their individual impact before combining them into the overall price estimation.</p><p>Now, look back at the formula of the Kolmogorov–Arnold Theorem — hopefully, it now makes sense. Take your time to grasp this concept.</p><p>This approach not only simplifies the representation of complex functions but also allows neural networks like KAN to achieve better computational efficiency and interpretability by breaking down high-dimensional problems into manageable components.</p><p><strong>Difference between KAN and Multi Layer Perceptron (MLPs):</strong></p><ul><li>MLPs have linear weights and they use activation functions on nodes for learning non linearity.</li><li>KAN uses learnable activation functions on edges(weights) due to which they don’t have any linear matrix.</li><li>KAN nodes only add incoming signals unlike MLPs nodes, which applies activation functions too.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I6x10pxX2twNlEEW" /></figure><h3><strong>B-splines:</strong></h3><blockquote>B-Spline (Basis Spline) is a piecewise-defined polynomial function that provides a smooth curve while maintaining local control over shape adjustments. B-Splines are widely used in computer graphics, numerical analysis, and curve fitting.</blockquote><p>To understand why B-spline is used in KANs, Lets consider a case where there is only one composition, i.e., we need to focus only on the inner dot product of the main equation given above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*bc5VjYeIBBMZMNBJ" /></figure><p>Remember, these <strong>ϕ</strong> functions are not weights but univariate polynomial functions/equations, whose coefficients are trained using back propagation during training. However, instead of using simple equations, researchers have used B-splines due to their adaptive nature and efficiency.</p><p>Since data points represent positions in space, to find a curve passing through n points we need need polynomial of n-1, which could be solved by using using system of equation on (n x n) matrix, which is an expensive operation or if with back propagation, and with increasing number of points the resultant curve , although do pass from those points but extreme points starts going crazy as can be seen in this graph that just to pass through these data points the curve found through solving system of equation has moved more then what was required by data points pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*3p1_9-kLApvoZ98g9vdb6w.png" /></figure><p>B-splines solve this issue by using part-wise functions( function defined from one point to other point in such a way that flow of graph stays smooth not pointy) give us more control over points to draw best smooth curve, while keeping the function differentiable which is core of learning through back propagation.<br>One of many other plus points of using B splines is that it gives control over the curve between points without affecting the other part of the curve. This is useful when we need to fine-tune a model for some specific scenario, unlike neural networks, which start to forget previously learned graphs on fine-tuning, these will only improve fine-tuning the relevant area instead of the whole knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Ch2sbdSiui3X2T7uMRnSAQ.gif" /></figure><p>Fine-tuning the model with B splines will only adjust the graph between points which is required for that specific knowledge area instead of adjusting whole graph. On the other hand MLPs will adjust the complete poly curve only for changing the curve for one point which result in loss of previous learning related to other parts of graph.</p><h3>Conclusion</h3><p>Kolmogorov-Arnold Networks (KANs), while still in their early stages compared to MLPs, which matured with time using different techniques, introduce a revolutionary approach to deep learning by replacing traditional fixed activation functions with learnable functions on edges. Rooted in the Kolmogorov-Arnold Representation Theorem, KANs aim to break down complex functions into simpler, more interpretable components — similar to how modular programming improves code readability.</p><p>However, the true potential of KANs remains to be seen. Will they match the versatility of MLPs in deep learning? Can they efficiently learn from any kind of data? Only time will tell if this innovation aligns with industry needs.</p><p><strong>What are your thoughts?</strong> Do you see KANs shaping the future of AI, or will they remain a niche concept? <strong>Comment below!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4736189f59b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/red-buffer/kolmogorov-arnold-networks-a-game-changer-or-just-another-ai-experiment-4736189f59b6">Kolmogorov-Arnold Networks: A Game Changer or Just Another AI Experiment?</a> was originally published in <a href="https://medium.com/red-buffer">Red Buffer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>