<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AbhiJsDev</title>
    <description>The latest articles on DEV Community by AbhiJsDev (@abhijsdev).</description>
    <link>https://dev.to/abhijsdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F338991%2F3bfb4116-eebd-4d2b-b529-5158dbe5fae4.jpg</url>
      <title>DEV Community: AbhiJsDev</title>
      <link>https://dev.to/abhijsdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhijsdev"/>
    <language>en</language>
    <item>
      <title>Beyond Basic RAG: The Ultimate Guide to Vector, Vectorless, and Hybrid AI Architectures</title>
      <dc:creator>AbhiJsDev</dc:creator>
      <pubDate>Sun, 19 Jul 2026 13:03:19 +0000</pubDate>
      <link>https://dev.to/abhijsdev/beyond-basic-rag-the-ultimate-guide-to-vector-vectorless-and-hybrid-ai-architectures-2g67</link>
      <guid>https://dev.to/abhijsdev/beyond-basic-rag-the-ultimate-guide-to-vector-vectorless-and-hybrid-ai-architectures-2g67</guid>
      <description>&lt;p&gt;As developers, we’ve all experienced the magic of watching a Large Language Model (LLM) stream a human-like response in real time. But the moment you ask it about something outside its training data—like your company’s private travel policy, real-time inventory, or yesterday’s news—the magic fades.&lt;/p&gt;

&lt;p&gt;Left to its own devices, a standard LLM won't say, "I don't know." Instead, it will confidently invent a highly convincing lie.&lt;/p&gt;

&lt;p&gt;Your first instinct might be to jam all your data straight into the system prompt. While modern context windows are scaling massively, loading an entire knowledge base into a prompt introduces a mountain of problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Cost Bottleneck:&lt;/strong&gt; Processing hundreds of thousands of tokens for every single query leads to astronomical API bills.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "Lost in the Middle" Phenomenon:&lt;/strong&gt; LLMs suffer from positional bias. Their retrieval accuracy drops by 20% to 40% when the answer is buried deep within the center of an enormous prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Window Poisoning:&lt;/strong&gt; Flooding a model with uncurated raw data introduces noise, causing the model to lose track of explicit system instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To solve this, the engineering community fell in love with &lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt;. Instead of forcing a model to rely purely on memorization, RAG gives the model an "open-book exam."&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What is RAG &amp;amp; How Does It Work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt; is an AI framework that enhances LLMs by fetching relevant facts from external data sources before generating a response.&lt;/p&gt;

&lt;p&gt;Think of it like trying to find information across 20 heavy PDF files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You scan the titles and reject the files that clearly don't apply.&lt;/li&gt;
&lt;li&gt;You check the contents page of the remaining files to isolate the correct chapter.&lt;/li&gt;
&lt;li&gt;You jump straight to that page, read the text, and synthesize your answer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A basic RAG pipeline automates this process using two primary workflows:&lt;/p&gt;

&lt;h3&gt;
  
  
  The Indexing Pipeline (Offline)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chunking:&lt;/strong&gt; Large documents are broken down into smaller textual segments called &lt;strong&gt;chunks&lt;/strong&gt; (typically 200 to 500 words).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings:&lt;/strong&gt; These chunks pass through an embedding model, turning text strings into high-dimensional numerical vectors (e.g., &lt;code&gt;"Hello"&lt;/code&gt; ──► &lt;code&gt;[12, 0, 345, 67]&lt;/code&gt;) representing semantic meaning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector DB Storage:&lt;/strong&gt; These mathematical vectors are stored in specialized vector databases (like Qdrant, Pinecone, or Chroma) alongside their raw text metadata.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Querying Pipeline (Online)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ User Query ] ──► [ Convert to Embedding Vector ] ──► [ Vector DB Search ]
                                                             │
                                                             ▼ (Context Found)
[ Grounded Answer ] ◄── [ LLM Brain ] ◄── [ Augment Prompt with Chunks ]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 1: The standard architecture flow of an online RAG pipeline.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When a user types a prompt, the system converts the question into a vector, runs a &lt;strong&gt;similarity search&lt;/strong&gt; across the vector database to locate contextually matching chunks, sticks those chunks directly into the prompt payload, and lets the LLM read them to write a grounded answer.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Where Traditional RAG Shines
&lt;/h2&gt;

&lt;p&gt;When properly configured, standard vector-based RAG is the gold standard for applications dealing with static, document-grounded text retrieval:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Document Q&amp;amp;A:&lt;/strong&gt; Interacting directly with uploaded user manuals, financial statements, or academic research papers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise Knowledge Bases:&lt;/strong&gt; Allowing employees to seamlessly search across vast, internal company wikis and HR policies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer Support Automation:&lt;/strong&gt; Grounding customer chatbots strictly in official product documentation to protect companies from AI liability.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. The Breakdown: Why Traditional RAG Fails in Production
&lt;/h2&gt;

&lt;p&gt;On paper, RAG looks flawless. In production, it can be incredibly fragile. Having an open textbook during an exam helps, but if someone hands you the wrong page, or if you misread the paragraph, you will still write down the wrong answer.&lt;/p&gt;

&lt;p&gt;Most real-world RAG failures stem from systemic data preparation and retrieval issues long before the prompt ever reaches the LLM.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Poor Retrieval and Missing Context
&lt;/h3&gt;

&lt;p&gt;If the retrieval stage skips or misses the exact chunk containing the necessary information, the LLM is left guessing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;👍 GOOD RETRIEVAL:
User: "What are our cancellation charges?"
  └──► DB Searches for "cancellation charges"
  └──► Vector match finds: "Termination Policy: Fees apply..."
  └──► LLM reads text and outputs accurate answer.

👎 POOR RETRIEVAL:
User: "What are our cancellation charges?"
  └──► DB Searches for "cancellation charges" (Document uses the term "termination fees")
  └──► Weak similarity matching fails ──► Returns unrelated "General Account Info" chunks
  └──► LLM guesses blindly or says "Information not found."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 2: How semantic retrieval quality directly dictates the accuracy of the final answer.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Poor Chunking &amp;amp; Semantic Fragmentation
&lt;/h3&gt;

&lt;p&gt;Splitting a document into pieces requires a careful balance. If you use "naive chunking" (splitting text at rigid, fixed character counts), you run the risk of cutting a critical sentence or mathematical concept precisely in half.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ RIGID CHARACTER CHUNKING CUTS PARAGRAPHS MID-THOUGHT:
┌────────────────────────────────────────────────────────────────────────┐
│ [Chunk 1]: "Refunds are fully allowed within a window of 30 days..."   │
└───────────────────────────────────┬────────────────────────────────────┘
                                    ✂️ (Context Fragmented)
┌───────────────────────────────────▼────────────────────────────────────┐
│ [Chunk 2]: "...unless the item was purchased during a clearance sale." │
└────────────────────────────────────────────────────────────────────────┘

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 3: When an exception clause is structurally isolated, the meaning of the data is compromised.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If a user asks about returning a clearance item, the database might only retrieve &lt;em&gt;Chunk 1&lt;/em&gt;. The LLM, completely missing the critical exception clause in &lt;em&gt;Chunk 2&lt;/em&gt;, will confidently serve an incorrect answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  C. The Illusion of Massive Context Windows
&lt;/h3&gt;

&lt;p&gt;As we move through 2026, state-of-the-art flagship models boast staggering context limits handling upwards of 1.5 million tokens. This has led some developers to make an entry-level assumption: &lt;em&gt;"Why build a complex RAG database? Let's just dump our entire 800-page manual right into the prompt context window!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This approach hits a physical wall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ 1,500,000 Token Document Dump ] ──► [ Stuffed Prompt Context Window ]
                                             │
              ┌──────────────────────────────┴──────────────────────────────┐
              ▼                                                             ▼
    ⚠️ Extreme API Costs &amp;amp; Latency               📉 Factual Retrieval Drops 20-40%
 (Transformer mechanism scales quadratically)     ("Lost in the Middle" positional bias)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 4: The heavy performance penalties of overloading large context windows.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  D. Hallucinations Are Not Fully Eliminated
&lt;/h3&gt;

&lt;p&gt;An LLM is a probabilistic word predictor, not a database query engine. RAG provides relevant context, but it doesn't force the model to copy it exactly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Friend Analogy:&lt;/strong&gt; Imagine helping a friend during an open-book exam by handing them a textbook page that explicitly states: &lt;em&gt;"The museum is open Monday to Friday, 9 AM to 5 PM."&lt;/em&gt; Your friend reads it but summarizes: &lt;em&gt;"The museum is open every day from 9 AM to 5 PM."&lt;/em&gt;&lt;br&gt;
The textbook was correct, the right page was fetched, but the final answer is still wrong because your friend injected outside assumptions. LLMs do this constantly when combining mismatched chunks or defaulting back to their original pre-trained biases.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  E. Stale Knowledge Bases
&lt;/h3&gt;

&lt;p&gt;RAG is only as good as the data embedded in it. If a company changes a pricing rule or an HR policy at 2:00 PM, but your RAG database relies on traditional nightly batch re-indexing, your AI will spend the remaining ten hours confidently serving outdated, incorrect information to your users.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The Next Evolution: Vectorless RAG (The Tree Approach)
&lt;/h2&gt;

&lt;p&gt;To completely bypass the issues of rigid chunk boundaries and "vibe-based" vector similarity math, engineers developed &lt;strong&gt;Vectorless RAG&lt;/strong&gt;. Instead of vectors and vector databases, this architecture organizes data logically using hierarchical tree structures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                        [ Root: Full Story / Dataset ]
                                       │
                  ┌────────────────────┴────────────────────┐
                  ▼                                         ▼
      [ Heading Node: Part 1 ]                  [ Heading Node: Part 2 ]
                  │                                         │
         ┌────────┴────────┐                       ┌────────┴────────┐
         ▼                 ▼                       ▼                 ▼
   [Sub-Topic Node]  [Sub-Topic Node]        [Sub-Topic Node]  [Sub-Topic Node]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 5: A hierarchical node tree structure mapping themes instead of vector coordinates.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Indexing Phase:&lt;/strong&gt; Raw documents are analyzed by a high-end reasoning LLM to extract logical headings, themes, and conceptual structures, mapping them into an interconnected tree of text nodes stored in a traditional database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Querying Phase:&lt;/strong&gt; When a user asks a question, a reasoning model analyzes the user's intent and performs a &lt;strong&gt;Tree Traversal&lt;/strong&gt; (navigating down the relevant conceptual branches), retrieving the exact text blocks required without looking at mathematical coordinate spaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Problems Vectorless RAG Solves
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero Data Loss:&lt;/strong&gt; It eliminates rigid character limits, keeping context completely intact within logical headings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reasoned Search:&lt;/strong&gt; It uses language models to understand the true structural intent of a query, outperforming traditional vector lookups which can easily pull the wrong text if a user's phrasing doesn't match the database's "vibe."&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Limitations of Vectorless RAG
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Higher Costs &amp;amp; Latency:&lt;/strong&gt; Navigating a tree structure requires multiple sequential LLM reasoning calls, which takes more time and tokens than a direct database lookup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unstructured Data Struggles:&lt;/strong&gt; If your raw source data is a chaotic, messy dump of unorganized notes, an LLM cannot reliably generate a clean hierarchical tree layout.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. The Ultimate Balance: Hybrid RAG
&lt;/h2&gt;

&lt;p&gt;Because Vector RAG is fast and cost-effective, while Vectorless RAG is highly precise and logical, production-grade applications are converging on &lt;strong&gt;Hybrid RAG&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Hybrid RAG integrates multiple search strategies simultaneously—such as pairing &lt;strong&gt;Semantic Vector Search&lt;/strong&gt; (to capture conceptual meaning) with traditional &lt;strong&gt;Keyword Search (BM25)&lt;/strong&gt; (to capture exact technical codes, serial numbers, or product SKUs).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     [ User Complex Query ]
                               │
               ┌───────────────┴───────────────┐
               ▼                               ▼
     ┌───────────────────┐           ┌───────────────────┐
     │  Vector Search    │           │  Keyword Search   │
     │  (Semantic Vibe)  │           │   (Exact Terms)   │
     └─────────┬─────────┘           └─────────┬─────────┘
               │                               │
               └───────────────┬───────────────┘
                               ▼
                    ┌─────────────────────┐
                    │  Fusion &amp;amp; Reranking │ 🔄 (Merges &amp;amp; reorders chunks via relevance)
                    └──────────┬──────────┘
                               ▼
                    ┌─────────────────────┐
                    │  LLM Context Window │
                    └──────────┬──────────┘
                               ▼
                    [ Precise Grounded Resp ]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Visual 6: The comprehensive workflow of a modern Hybrid RAG architecture.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How Hybrid RAG Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parallel Retrieval:&lt;/strong&gt; The user's query triggers a semantic vector search and a keyword-based search at the same time to ensure no critical structural data is dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fusion &amp;amp; Re-ranking:&lt;/strong&gt; Because different retrieval strategies return overlapping, noisy results, a specialized &lt;strong&gt;Reranker model&lt;/strong&gt; analyzes the combined text pool, filters out duplicates, and reorders the chunks by exact contextual relevance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation:&lt;/strong&gt; The LLM receives a highly curated, ultra-dense payload of perfect context, resulting in fast, low-cost, and completely grounded answers.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  6. Knowing When to Walk Away: When RAG is the Wrong Solution
&lt;/h2&gt;

&lt;p&gt;RAG is an incredible architecture, but it is frequently applied to problems it was never built to solve. Introducing a RAG pipeline adds significant infrastructure complexity, so you should avoid it if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Task Requires Mathematical Precision:&lt;/strong&gt; Vector search is approximate. If a user asks, &lt;em&gt;"Sum up all open invoices,"&lt;/em&gt; RAG might fetch documents &lt;em&gt;about&lt;/em&gt; invoices, but it cannot calculate math. Use &lt;strong&gt;Function Calling (Text-to-SQL)&lt;/strong&gt; to let the AI query a structured relational database directly for deterministic precision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You Need Behavioral Tone Consistency:&lt;/strong&gt; RAG provides facts; it doesn't change &lt;em&gt;how&lt;/em&gt; a model thinks or formats code. If your app is failing because the AI changes its personality or struggles to output perfect JSON formatting, you need &lt;strong&gt;Fine-Tuning&lt;/strong&gt; to bake behavioral constraints directly into the model's weights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your Knowledge Base is Small and Static:&lt;/strong&gt; If your entire corporate playbook or manual fits within less than 50 or 100 pages, constructing a vector database infrastructure is over-engineering. Use full-context prompting along with platform &lt;strong&gt;Prompt Caching&lt;/strong&gt;—it will be faster, cheaper, and fundamentally more accurate.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary: Designing with Trade-offs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────────────────┐
│                           RAG ARCHITECTURE CHEAT SHEET                  │
├────────────────────────────────────┬────────────────────────────────────┤
│            USE RAG WHEN            │            AVOID RAG WHEN          │
├────────────────────────────────────┼────────────────────────────────────┤
│ • Data shifts/updates frequently   │ • Task requires pure math/logic    │
│ • Documents are vast or private    │ • Dataset fits within 50-100 pages │
│ • Factual attribution is critical  │ • Goal is altering structural tone │
└────────────────────────────────────┴────────────────────────────────────┘

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving an AI feature past a basic prototype requires shifting your focus away from creative prompt engineering hacks and moving it squarely toward robust &lt;strong&gt;data engineering&lt;/strong&gt;. Your application's final accuracy will always be defined by how cleanly you slice your data, how quickly you update your index, and how strategically you retrieve your context.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you are currently expanding an AI feature into production, what chunking tools or database patterns have given your team the best results? Let’s talk shop in the comments below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>rag</category>
    </item>
    <item>
      <title>Behind the AI Chatbox: What Actually Happens When You Send a Prompt?</title>
      <dc:creator>AbhiJsDev</dc:creator>
      <pubDate>Wed, 01 Jul 2026 15:10:44 +0000</pubDate>
      <link>https://dev.to/abhijsdev/behind-the-ai-chatbox-what-actually-happens-when-you-send-a-prompt-3j44</link>
      <guid>https://dev.to/abhijsdev/behind-the-ai-chatbox-what-actually-happens-when-you-send-a-prompt-3j44</guid>
      <description>&lt;p&gt;Most of my day as a developer is spent crafting UI components, managing state, and making sure web interfaces look pixel-perfect and accessible. But recently, a new layer has been added to almost every app we build: the AI chatbox.&lt;/p&gt;

&lt;p&gt;You type a prompt, hit &lt;strong&gt;Send&lt;/strong&gt;, and a magical, human-like response streams onto your screen. But if you look under the hood, it's not magic at all. It's a beautifully orchestrated system of mathematics, probabilities, and predictions.&lt;/p&gt;

&lt;p&gt;Let's lift the curtain on what's actually happening behind that glowing screen—without the dry, intimidating jargon.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Demystifying the Buzzword: What is an LLM?
&lt;/h1&gt;

&lt;p&gt;Before we follow your message's journey, let's meet the engine powering everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM&lt;/strong&gt; stands for &lt;strong&gt;Large Language Model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At its core, an LLM is a deep learning model trained on enormous amounts of text, allowing it to understand and generate human language with remarkable fluency.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Problems Do LLMs Solve?
&lt;/h2&gt;

&lt;p&gt;Historically, computers struggled with human language.&lt;/p&gt;

&lt;p&gt;Traditional software relies on explicit rules. If you misspelled a word, used slang, or phrased something differently than expected, the program often failed because it could only follow predefined instructions.&lt;/p&gt;

&lt;p&gt;LLMs changed that completely.&lt;/p&gt;

&lt;p&gt;Instead of relying solely on rigid rules, they learn patterns from massive amounts of text, enabling them to understand &lt;strong&gt;unstructured human language&lt;/strong&gt;—the messy, flexible, and often ambiguous way people naturally communicate.&lt;/p&gt;

&lt;p&gt;Rather than matching exact keywords, they infer the &lt;strong&gt;intent&lt;/strong&gt; behind your words.&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular Examples
&lt;/h2&gt;

&lt;p&gt;Some of today's most widely used LLMs include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI's GPT models (used in ChatGPT)&lt;/li&gt;
&lt;li&gt;Google Gemini&lt;/li&gt;
&lt;li&gt;Anthropic Claude&lt;/li&gt;
&lt;li&gt;Meta Llama&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where You Already Use Them
&lt;/h2&gt;

&lt;p&gt;You probably interact with LLMs every day without even realizing it.&lt;/p&gt;

&lt;p&gt;They power:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smart autocomplete&lt;/li&gt;
&lt;li&gt;AI coding assistants&lt;/li&gt;
&lt;li&gt;Language translation&lt;/li&gt;
&lt;li&gt;Email drafting&lt;/li&gt;
&lt;li&gt;Customer support chatbots&lt;/li&gt;
&lt;li&gt;Document summarization&lt;/li&gt;
&lt;li&gt;AI search experiences&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  2. Why Computers Are Completely Text-Blind
&lt;/h1&gt;

&lt;p&gt;Before understanding how an LLM thinks, we need to understand one strange fact:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Computers have absolutely no idea what letters like A, B, or C actually mean.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Computers don't understand English.&lt;/p&gt;

&lt;p&gt;They don't understand Hindi.&lt;/p&gt;

&lt;p&gt;They don't understand any human language.&lt;/p&gt;

&lt;p&gt;They only understand &lt;strong&gt;numbers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you handed the word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to your computer's processor, it wouldn't recognize it as a greeting.&lt;/p&gt;

&lt;p&gt;To the computer, it's simply a collection of characters with no inherent meaning.&lt;/p&gt;

&lt;p&gt;Before an AI can process your message, every piece of text must first be transformed into numbers.&lt;/p&gt;

&lt;p&gt;That journey begins with &lt;strong&gt;Tokenization&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. The Journey of Your Prompt
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your Prompt
      │
      ▼
Tokenization
      │
      ▼
Embeddings + Positional Encoding
      │
      ▼
Transformer (Self-Attention)
      │
      ▼
Next Token Prediction
      │
      ▼
Streaming Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's walk through what happens during each step.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1 — Typing a Prompt
&lt;/h1&gt;

&lt;p&gt;Everything begins when you type something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Give me a recipe for a quick snack.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After clicking &lt;strong&gt;Send&lt;/strong&gt;, the application (such as ChatGPT) securely sends your prompt over the internet to an LLM running on powerful cloud servers.&lt;/p&gt;

&lt;p&gt;Only then does the model begin processing your request.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2 — The Slicer (Tokenization)
&lt;/h1&gt;

&lt;p&gt;The first thing an LLM does is slice your text into manageable pieces called &lt;strong&gt;tokens&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Words vs Tokens
&lt;/h2&gt;

&lt;p&gt;A token isn't always a complete word.&lt;/p&gt;

&lt;p&gt;Depending on the tokenizer, it can represent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A full word&lt;/li&gt;
&lt;li&gt;Part of a word&lt;/li&gt;
&lt;li&gt;Punctuation&lt;/li&gt;
&lt;li&gt;Whitespace&lt;/li&gt;
&lt;li&gt;Emojis&lt;/li&gt;
&lt;li&gt;Numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, I like coding.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tokens&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;["Hello", ",", " I", " like", " cod", "ing", "."]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Token IDs&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[15496, 11, 314, 588, 3842, 278, 13]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every token receives a unique numeric identifier.&lt;/p&gt;

&lt;p&gt;These numbers—not the original words—are what the model actually processes.&lt;/p&gt;

&lt;p&gt;Breaking language into standardized tokens allows the model to efficiently process millions of words every second.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3 — The Map of Meaning (Embeddings &amp;amp; Positional Encoding)
&lt;/h1&gt;

&lt;p&gt;Now that the text has become numbers, the AI still doesn't know what those numbers mean.&lt;/p&gt;

&lt;p&gt;To solve this, every token is converted into an &lt;strong&gt;embedding&lt;/strong&gt;—a high-dimensional mathematical representation that captures semantic meaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Imagine a Giant Map
&lt;/h2&gt;

&lt;p&gt;Words and concepts with similar meanings naturally appear close together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Apple  ───────── Banana

Paris ───────── Eiffel Tower

Doctor ──────── Hospital
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The closer two words appear in this embedding space, the more semantically related they are.&lt;/p&gt;

&lt;p&gt;This allows the model to recognize relationships without anyone explicitly programming them.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F254u6f1dqv9mn8xds2nd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F254u6f1dqv9mn8xds2nd.png" alt="Figure 1" width="800" height="990"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Figure 1:&lt;/strong&gt; Imagine a sentence being broken into tokens and projected into a massive semantic space. Words like &lt;strong&gt;"Feast"&lt;/strong&gt;, &lt;strong&gt;"Gathering"&lt;/strong&gt;, and &lt;strong&gt;"Everyone"&lt;/strong&gt; naturally cluster together, while concepts such as &lt;strong&gt;"Ideas"&lt;/strong&gt; drift closer to &lt;strong&gt;"Creativity."&lt;/strong&gt; Rather than memorizing definitions, the model learns relationships between concepts.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  But Word Order Matters
&lt;/h2&gt;

&lt;p&gt;Consider these two sentences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cat chased the mouse.&lt;/li&gt;
&lt;li&gt;The mouse chased the cat.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They contain exactly the same words.&lt;/p&gt;

&lt;p&gt;Yet they mean completely different things.&lt;/p&gt;

&lt;p&gt;To preserve order, every token receives additional positional information called &lt;strong&gt;Positional Encoding&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This tells the model where each token appears in the sentence.&lt;/p&gt;

&lt;p&gt;Without positional encoding, the model would know &lt;em&gt;which&lt;/em&gt; words exist—but not &lt;em&gt;where&lt;/em&gt; they occur.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4 — The Context Detective (The Transformer)
&lt;/h1&gt;

&lt;p&gt;This is the crown jewel of modern AI.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Transformer&lt;/strong&gt; architecture, introduced in 2017, completely changed natural language processing.&lt;/p&gt;

&lt;p&gt;Older AI models processed text sequentially.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I → sat → on → the → river → bank
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By the time they reached the last word, they often struggled to remember important information from the beginning.&lt;/p&gt;

&lt;p&gt;Transformers solved this problem using &lt;strong&gt;Self-Attention&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of reading one word after another, every token can examine every other token simultaneously.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Self-Attention
&lt;/h2&gt;

&lt;p&gt;Consider the word:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Bank&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sentence 1:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I sat on the river bank.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The nearby word &lt;strong&gt;river&lt;/strong&gt; tells the model that "bank" refers to land beside water.&lt;/p&gt;

&lt;p&gt;Sentence 2:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I deposited money in the bank.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the nearby word &lt;strong&gt;money&lt;/strong&gt; changes the meaning entirely.&lt;/p&gt;

&lt;p&gt;The model understands that the same word has different meanings depending on surrounding context.&lt;/p&gt;

&lt;p&gt;This contextual understanding is made possible through Self-Attention.&lt;/p&gt;




&lt;h3&gt;
  
  
  Old AI vs Transformer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Old AI (Sequential)

[I] → [sat] → [on] → [the] → [river] → [bank]

Reads one word at a time.


Transformer (Parallel)

[I]
[sat]
[on]
[the]
[river]
[bank]

Every token attends to every other token simultaneously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of forgetting earlier words, every token continuously considers the entire sentence.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwi2v6kcdri9ryqgyt17v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwi2v6kcdri9ryqgyt17v.png" alt="Figure 2" width="800" height="1075"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Figure 2:&lt;/strong&gt; Compare an older sequential model reading one word after another with a Transformer where every token connects to every other token through Self-Attention. The illustration should highlight how the meaning of the word &lt;strong&gt;"Bank"&lt;/strong&gt; changes depending on whether it connects more strongly to &lt;strong&gt;"River"&lt;/strong&gt; or &lt;strong&gt;"Money."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Step 5 — Generating a Response (It's Not Copying Google)
&lt;/h1&gt;

&lt;p&gt;One of the biggest misconceptions about ChatGPT is that it searches Google and copies an answer.&lt;/p&gt;

&lt;p&gt;That's not how it works.&lt;/p&gt;

&lt;p&gt;Instead, once the Transformer understands your prompt, it predicts the &lt;strong&gt;most likely next token&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of it as an incredibly advanced autocomplete system.&lt;/p&gt;

&lt;p&gt;Suppose your prompt is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The capital of France is
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally, the model estimates probabilities similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Paris      97%

London      1%

Berlin      1%

Rome        1%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It selects one token.&lt;/p&gt;

&lt;p&gt;Now the sentence becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The capital of France is Paris
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire process repeats.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;And again.&lt;/p&gt;

&lt;p&gt;Hundreds of times every second.&lt;/p&gt;

&lt;p&gt;Each newly generated token becomes part of the context used to predict the next one, allowing the model to produce completely new responses instead of copying existing text.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. The "Creativity" Dial — Temperature
&lt;/h1&gt;

&lt;p&gt;Have you ever asked the exact same prompt twice and received different answers?&lt;/p&gt;

&lt;p&gt;That's because of a parameter called &lt;strong&gt;Temperature&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOW TEMPERATURE (0.2)

✔ Predictable
✔ Consistent
✔ Factual
✔ Great for coding


HIGH TEMPERATURE (0.9)

✔ Creative
✔ Diverse
✔ Imaginative
✔ Better for brainstorming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Low Temperature
&lt;/h3&gt;

&lt;p&gt;The model strongly favors the highest-probability token.&lt;/p&gt;

&lt;p&gt;Best suited for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coding&lt;/li&gt;
&lt;li&gt;Mathematics&lt;/li&gt;
&lt;li&gt;Technical documentation&lt;/li&gt;
&lt;li&gt;Structured content&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  High Temperature
&lt;/h3&gt;

&lt;p&gt;The model becomes more adventurous.&lt;/p&gt;

&lt;p&gt;Instead of always choosing the highest-probability token, it occasionally selects lower-probability alternatives, producing more diverse and creative outputs.&lt;/p&gt;

&lt;p&gt;Ideal for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brainstorming&lt;/li&gt;
&lt;li&gt;Story writing&lt;/li&gt;
&lt;li&gt;Poetry&lt;/li&gt;
&lt;li&gt;Creative marketing&lt;/li&gt;
&lt;li&gt;Idea generation&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. The Context Window
&lt;/h1&gt;

&lt;p&gt;Think of the &lt;strong&gt;Context Window&lt;/strong&gt; as the AI's short-term memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Older Messages (Forgotten)

                │

                ▼

──────────────────────────────────────────────

        Current Conversation

         Your Latest Prompt

──────────────────────────────────────────────

                │

                ▼

               LLM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model can only "remember" a limited number of tokens at once.&lt;/p&gt;

&lt;p&gt;As conversations become longer, older messages eventually fall outside this window.&lt;/p&gt;

&lt;p&gt;Once that happens, the model no longer has access to them, which is why it may appear to forget earlier parts of the conversation.&lt;/p&gt;




&lt;h1&gt;
  
  
  Who Builds What? (The Division of Labor)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbbm54ywllp0kuvs5dptp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbbm54ywllp0kuvs5dptp.png" alt="Figure 3" width="800" height="1068"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Figure 3:&lt;/strong&gt; On the left, illustrate an &lt;strong&gt;ML Engineer ("The Chef")&lt;/strong&gt; training massive Transformer models using GPUs, datasets, and neural networks. On the right, show an &lt;strong&gt;Application / GenAI Engineer ("The Restaurateur")&lt;/strong&gt; building chat interfaces, integrating APIs, streaming responses, storing conversation history, and creating polished AI-powered applications for users.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;People often assume application developers spend their days designing neural networks and writing complex mathematical equations.&lt;/p&gt;

&lt;p&gt;In reality, responsibilities are generally divided into two complementary roles.&lt;/p&gt;




&lt;h2&gt;
  
  
  Machine Learning Engineers
&lt;/h2&gt;

&lt;p&gt;Think of them as the &lt;strong&gt;master chefs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They build the intelligence itself by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designing neural network architectures&lt;/li&gt;
&lt;li&gt;Training foundation models&lt;/li&gt;
&lt;li&gt;Creating embeddings&lt;/li&gt;
&lt;li&gt;Optimizing GPU workloads&lt;/li&gt;
&lt;li&gt;Improving Transformer architectures&lt;/li&gt;
&lt;li&gt;Fine-tuning and evaluating models&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Application / GenAI Engineers
&lt;/h2&gt;

&lt;p&gt;Think of them as the &lt;strong&gt;restaurant owners&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They take an already-trained LLM and transform it into products people use every day by building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI chat interfaces&lt;/li&gt;
&lt;li&gt;API integrations&lt;/li&gt;
&lt;li&gt;Streaming responses&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Conversation history&lt;/li&gt;
&lt;li&gt;Prompt engineering&lt;/li&gt;
&lt;li&gt;RAG pipelines&lt;/li&gt;
&lt;li&gt;Vector databases&lt;/li&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;li&gt;Production-ready user experiences&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One builds the &lt;strong&gt;brain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The other builds the &lt;strong&gt;product&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Both are equally important in delivering a great AI experience.&lt;/p&gt;




&lt;h1&gt;
  
  
  Wrapping Up
&lt;/h1&gt;

&lt;p&gt;The next time you watch an AI generate a response, you'll know there's no magic happening behind the scenes.&lt;/p&gt;

&lt;p&gt;Your words are first broken into tokens, transformed into mathematical representations, enriched with positional information, analyzed through the Transformer's self-attention mechanism, and then used to predict the most likely next token. That prediction becomes part of the conversation, and the process repeats hundreds of times until a complete response is generated.&lt;/p&gt;

&lt;p&gt;What feels like a natural conversation is actually millions—or even billions—of mathematical operations happening in just a few seconds.&lt;/p&gt;

&lt;p&gt;Understanding this pipeline doesn't mean every application developer needs to become a machine learning researcher. But knowing what happens behind the API helps us build better AI-powered applications, write more effective prompts, design more intuitive user experiences, and make smarter engineering decisions.&lt;/p&gt;

&lt;p&gt;Modern AI isn't powered by magic—it's powered by mathematics, probability, and an extraordinary amount of engineering.&lt;/p&gt;

&lt;p&gt;And perhaps that's even more fascinating.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Weird behavior of javaScript you should know!</title>
      <dc:creator>AbhiJsDev</dc:creator>
      <pubDate>Mon, 10 Jan 2022 15:53:26 +0000</pubDate>
      <link>https://dev.to/abhijsdev/weird-behavior-of-javascript-you-should-know-4056</link>
      <guid>https://dev.to/abhijsdev/weird-behavior-of-javascript-you-should-know-4056</guid>
      <description>&lt;p&gt;We know that javaScript sometimes behaves weird as compare to other programming languages, but initially it was design only to make web pages.&lt;/p&gt;

&lt;p&gt;But now in today's world, we can do so many things using javaScript with help of other libraries/framework like react, angular.&lt;/p&gt;

&lt;p&gt;This weird behaviour is not a fault of javaScript, this is how the language was design in the initial phase. So we should understand why this behaviour happens, so we can take primitive actions based on it.(If we are intending that this should not happen)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrjvghciy63brggmle93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrjvghciy63brggmle93.png" alt="Image1 description" width="681" height="259"&gt;&lt;/a&gt;&lt;br&gt;
So here, we make one object calling its name &lt;strong&gt;weirdObject&lt;/strong&gt; which has property &lt;code&gt;obj_id&lt;/code&gt; and &lt;code&gt;obj_name&lt;/code&gt; which is further divided into an object which has property &lt;code&gt;obj_title&lt;/code&gt; and &lt;code&gt;type&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If we run our code with node we get the output as the object considering &lt;code&gt;obj_id&lt;/code&gt; and &lt;code&gt;obj_name&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdmbkaa2ucxn0o48nqni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdmbkaa2ucxn0o48nqni.png" alt="Image2 description" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if we want to change the &lt;code&gt;obj_id&lt;/code&gt; of the object we can do that in javaScript inspite of using &lt;strong&gt;const&lt;/strong&gt; keyword.(It is allowed to change inside property of javaScript whether we use const or not)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyng6lxqi137q4626pbxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyng6lxqi137q4626pbxu.png" alt="Image3 description" width="799" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To change this behaviour, we can use &lt;strong&gt;Object.freeze()&lt;/strong&gt; method which freezes an object. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjwoyuhbhw174htvufna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjwoyuhbhw174htvufna.png" alt="Image4 description" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the value of &lt;code&gt;obj_id&lt;/code&gt; not changed. A frozen object can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, prevents changing the enumerability, configurability, and writability of existing properties, and also prevents the values of existing properties from being changed.&lt;/p&gt;

&lt;p&gt;But, what if we want to change value of the &lt;code&gt;obj_title&lt;/code&gt; from &lt;strong&gt;"My Object"&lt;/strong&gt; to &lt;strong&gt;"This Object"&lt;/strong&gt; which is present inside &lt;code&gt;obj_name&lt;/code&gt; object of weirdObject after using &lt;code&gt;Object.freeze()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;Let's see..&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmsjc06wjx85zpqollh42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmsjc06wjx85zpqollh42.png" alt="Image5 description" width="799" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, we can do that..!! This is called &lt;strong&gt;Shallow freeze&lt;/strong&gt; which only applies to the immediate properties of the object itself and will prevent future property addition, removal or value re-assignment operations only on object. If the value of those properties are objects themselves, those objects are not frozen and may be the target of property addition, removal or value re-assignment operations.&lt;/p&gt;

&lt;p&gt;To make object immutable, we will have to add explicit function which will check is wheather the object has another object present inside it.&lt;/p&gt;

&lt;p&gt;Hope this odd behaviour of javaScript information helps you.&lt;br&gt;
Thanks for reading and happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Do you know Isomorphic JavaScript?</title>
      <dc:creator>AbhiJsDev</dc:creator>
      <pubDate>Thu, 12 Aug 2021 14:21:56 +0000</pubDate>
      <link>https://dev.to/abhijsdev/what-is-isomorphic-javascript-8ce</link>
      <guid>https://dev.to/abhijsdev/what-is-isomorphic-javascript-8ce</guid>
      <description>&lt;p&gt;In programming we tend to hear a lot of really strange words such as isomorphism, etc. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Isomorphic?
&lt;/h2&gt;

&lt;p&gt;In general term &lt;strong&gt;"iso"&lt;/strong&gt; means "same" and &lt;strong&gt;"morphic"&lt;/strong&gt; means "form" ie same form that we are studied from our childhood.&lt;/p&gt;

&lt;p&gt;In simplest terms isomorphic javaScript is the javaScript that can be run on both the server as well as on the client.&lt;/p&gt;

&lt;p&gt;Let's discuss with examples below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1l0dvr5p3ehnl6p2fzx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1l0dvr5p3ehnl6p2fzx.png" alt="IsoJs function" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This code snippet is isomorphic, the code will run in a&lt;br&gt;
node.js environment and it will also run in the web browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmae9j3ygx24g3dpfojw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmae9j3ygx24g3dpfojw.png" alt="IsoJs Browser" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This code doesn't uses any node-specific libraries or browse any web apis, it's just an arrow function in javaScript that will run in environment. &lt;/p&gt;

&lt;p&gt;Now let's have a look on another example which is not isomorphic.&lt;br&gt;
We will be using fetch api to get some data from external api(NewsAPI).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmibnxlgj0t2i6l80g83v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmibnxlgj0t2i6l80g83v.png" alt="Fetch API" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This code is not isomorphic because the &lt;code&gt;fetch&lt;/code&gt; function is provided by the web browser and results in ReferenceError.&lt;/p&gt;

&lt;p&gt;If we want to run on both the client and the server we have to import a third-party library such as &lt;code&gt;axios&lt;/code&gt;. The code something looks like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwbuminz464j9giy1h8h2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwbuminz464j9giy1h8h2.png" alt="Axios" width="799" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This would be considered as isomorphic javaScript but it's important to note that we only need one successful path that will run on both the server and the client in order to be considered isomorphic. &lt;/p&gt;

&lt;p&gt;If we have a javaScript function that checks the environment to determine whether or not it's on the client or the server and then it has the path for both of those cases then that can be considered as isomorphic javaScript for example this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fof1i20hddcpd2e344b2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fof1i20hddcpd2e344b2s.png" alt="Check Isomorphic" width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This code checks for the window object and determines whether or not it is running on the client or the server and then logs the result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsa02mi83qdnh744kkuri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsa02mi83qdnh744kkuri.png" alt="Check Iso Browser" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is isomorphic because it will run on both the server and the client so it's important to note here that isomorphic javaScript is the way that we write the code and&lt;br&gt;
it's &lt;strong&gt;"not a particular technology"&lt;/strong&gt; it's just sort of like a design pattern. Writing code in this way allows you to be able to do certain unique things such as server side rendering. &lt;/p&gt;

&lt;p&gt;Hope this information helps you to understand isomorphic javaScript.&lt;br&gt;
Thanks for reading and happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>isomorphic</category>
      <category>developer</category>
    </item>
  </channel>
</rss>
