<?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>Forem: ZEZE1020</title>
    <description>The latest articles on Forem by ZEZE1020 (@zeze1020).</description>
    <link>https://forem.com/zeze1020</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1409540%2Fa1442918-1fda-4255-8aa5-5766bc3f543d.jpg</url>
      <title>Forem: ZEZE1020</title>
      <link>https://forem.com/zeze1020</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/zeze1020"/>
    <language>en</language>
    <item>
      <title>SEO vs. GEO: Developer's Guide</title>
      <dc:creator>ZEZE1020</dc:creator>
      <pubDate>Sun, 23 Nov 2025 21:23:48 +0000</pubDate>
      <link>https://forem.com/zeze1020/seo-vs-geo-developers-guide-4lfi</link>
      <guid>https://forem.com/zeze1020/seo-vs-geo-developers-guide-4lfi</guid>
      <description>&lt;h2&gt;
  
  
  Beyond the SERP From Probabilistic Retrieval to Generative Synthesis
&lt;/h2&gt;

&lt;p&gt;The architecture of the World Wide Web, and the mechanisms by which humanity accesses information, is undergoing a fundamental transformation that parallels the shift from directory-based indexing to algorithmic search in the late 1990s. For nearly three decades, the dominant paradigm of information discovery has been Information Retrieval (IR), a discipline predicated on indexing discrete documents and retrieving ranked lists based on keyword relevance and topological authority. This era, characterized by the dominance of the &lt;strong&gt;Search Engine Results Page (SERP)&lt;/strong&gt;, established a social contract between content creators and search platforms: creators provided data, and platforms provided traffic. This symbiotic relationship gave rise to the multi-billion-dollar industry of Search Engine Optimization (SEO), a practice focused on optimizing content for visibility within a deterministic or semi-deterministic ranking algorithm.&lt;/p&gt;

&lt;p&gt;However, the rapid ascendancy of Large Language Models (LLMs) and Generative AI (GenAI) has ushered in a new approach. We are moving from a paradigm of retrieval to that of synthesis. In this new environment, represented by Generative Engines (GEs) such as ChatGPT, Perplexity, Google’s AI Overviews (formerly SGE), and Anthropic’s Claude,&lt;strong&gt;the primary unit of value is no longer the link, but the answer itself&lt;/strong&gt;. The engine does not merely point to a source; it reads, comprehends, and synthesizes the source to generate a novel, citation-backed response. This shift necessitates a corresponding evolution in optimization strategy, moving from SEO to what researchers &lt;a href="https://arxiv.org/abs/2311.09735" rel="noopener noreferrer"&gt;Pranjal Aggarwal (2023) have termed Generative Engine Optimization (GEO).&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;This report provides an exhaustive technical analysis of this transition. We will deconstruct the theoretical underpinnings of GEO, analyze the empirical data supporting its efficacy—specifically, the finding that GEO strategies can boost visibility by up to 40% and detail the engineering standards required to optimize content for Retrieval-Augmented Generation (RAG) architectures. We will explore the nuances of vector space modeling, the "Lost in the Middle" phenomenon in context windows, and the emerging importance of Knowledge Graphs over simple vector stores. For the developer and the technical marketer, this is not merely a change in tactics, but a fundamental re-architecting of how web content must be structured for machine readability in the age of artificial intelligence.   &lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 The Historical Context: The Limitations of Ten Blue Links
&lt;/h3&gt;

&lt;p&gt;To understand the necessity of GEO, one must first appreciate the limitations of the SEO model. Traditional search engines operate on an "inverted index" architecture. When a user submits a query, the engine identifies documents containing relevant terms (lexical search). It ranks them using signals like PageRank, which interprets the link graph as a proxy for authority. While effective for navigational queries (e.g., "Facebook login") or transactional queries (e.g., "buy Nike shoes"), this model struggles with complex informational queries. A user asking, "What are the comparative advantages of RAG vs. Fine-tuning for enterprise data?" would traditionally need to open multiple tabs, read several articles, and mentally synthesize the answer.   &lt;/p&gt;

&lt;p&gt;Generative Engines automate this cognitive labor. By leveraging the probabilistic capabilities of Transformer architectures, these engines predict the most likely sequence of tokens that answers the query, drawing upon a vast corpus of training data and, crucially, real-time retrieved context. This shifts the user behavior from "search and browse" to "ask and verify." Consequently, the goal of the content creator shifts from capturing the click to capturing the citation. If the user is no longer visiting the website, the brand's value must be delivered through the engine's synthesis. This is the economic and technical reality that GEO addresses.   &lt;/p&gt;

&lt;h3&gt;
  
  
  1.2 The Divergence of SEO and GEO
&lt;/h3&gt;

&lt;p&gt;While industry pundits often suggest that "good SEO is good GEO," this simplification obscures profound technical differences. SEO optimizes for a crawler that builds a map of the web's graph. GEO optimizes for an inference engine that builds a semantic understanding of text.&lt;/p&gt;

&lt;p&gt;The following comparison highlights the structural divergence between the two disciplines:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Search Engine Optimization (SEO)&lt;/th&gt;
&lt;th&gt;Generative Engine Optimization (GEO)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Core Architecture&lt;/td&gt;
&lt;td&gt;Inverted Index &amp;amp; Link Graph&lt;/td&gt;
&lt;td&gt;Vector Space Model &amp;amp; Attention Mechanism&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Primary Metric&lt;/td&gt;
&lt;td&gt;Organic Traffic (Clicks), Keyword Rank&lt;/td&gt;
&lt;td&gt;Share of Voice (SoV), Citation Frequency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Optimization Target&lt;/td&gt;
&lt;td&gt;Crawler (Googlebot)&lt;/td&gt;
&lt;td&gt;Inference Engine (GPT-4, Claude, Llama)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval Logic&lt;/td&gt;
&lt;td&gt;Lexical (Keyword Matching)&lt;/td&gt;
&lt;td&gt;Semantic (Vector Similarity &amp;amp; Reranking)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Content Structure&lt;/td&gt;
&lt;td&gt;Skimmable, Keyword-Dense&lt;/td&gt;
&lt;td&gt;Information-Dense, Fact-Heavy, Structured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Interaction&lt;/td&gt;
&lt;td&gt;Linear (Search → Click → Read)&lt;/td&gt;
&lt;td&gt;Circular (Prompt → Synthesis → Verification)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Economic Model&lt;/td&gt;
&lt;td&gt;Ad-supported Impressions&lt;/td&gt;
&lt;td&gt;Zero-Click Attribution &amp;amp; Brand Authority&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The distinction is critical. SEO relies on "ranking," a linear sorting of URLs. GEO relies on "selection" and "attention," a multi-dimensional process where the model decides which specific sentences or data points within a retrieved document are worthy of inclusion in the final output. A page can rank #1 in Google (SEO) but be completely ignored by ChatGPT (GEO) if its content is unstructured, fluff-heavy, or lacks the "concreteness" that LLMs prioritize.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.3 The Economic Implications of the Zero-Click Economy
&lt;/h3&gt;

&lt;p&gt;The rise of GEs accelerates the trend toward a "Zero-Click" economy. Gartner and other analysts predict a significant reduction in traditional search traffic as users satisfy their intent directly on the SERP or chat interface. This presents a paradox: if traffic declines, why optimize?   &lt;/p&gt;

&lt;p&gt;The answer lies in the quality of the remaining traffic and the necessity of brand presence. In a world where the AI acts as the gatekeeper, being cited is the only way to maintain brand awareness. Furthermore, the users who do click through the citations in a Generative Engine response are demonstrating high intent—they are seeking verification or deeper nuance that the summary could not provide. Thus, GEO is not about maintaining traffic volume, but about maintaining relevance and authority in the new information hierarchy. Brands that fail to adapt to GEO risk becoming "invisible" to the AI assistants that will increasingly mediate consumer choices.   &lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Theoretical Framework: Decoding the GEO Research
&lt;/h2&gt;

&lt;p&gt;The formalization of GEO as a scientific discipline can be traced to the seminal paper "GEO: Generative Engine Optimization" by Aggarwal et al. (2023), a collaboration between researchers at Princeton University, Georgia Tech, The Allen Institute for AI, and IIT Delhi. This work provided the first large-scale empirical analysis of how different content characteristics influence visibility in generative outputs.   &lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 The GEO-Bench Methodology
&lt;/h3&gt;

&lt;p&gt;To rigorously test GEO strategies, the researchers introduced GEO-Bench, a comprehensive benchmark dataset consisting of 10,000 queries across diverse domains such as Law, History, Science, and Shopping. These queries were designed to mimic real-world user behavior on platforms like Bing Chat and Perplexity.   &lt;/p&gt;

&lt;p&gt;The methodology involved a controlled experiment:&lt;/p&gt;

&lt;p&gt;Baseline: A query is run, and the baseline sources cited by the GE are recorded.&lt;/p&gt;

&lt;p&gt;Intervention: The content of the lower-ranked sources is modified using specific GEO strategies (e.g., adding statistics, adding quotes).&lt;/p&gt;

&lt;p&gt;Evaluation: The query is re-run, and the changes in visibility are measured using novel metrics designed for this paradigm.   &lt;/p&gt;

&lt;p&gt;This rigorous approach moves GEO from the realm of speculation to data-driven engineering. It confirms that Generative Engines are not random "black boxes" but deterministic systems that respond predictably to specific content signals.   &lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Key Metrics: Measuring Visibility in the Age of AI
&lt;/h3&gt;

&lt;p&gt;Traditional SEO metrics like "Rank" are insufficient for GEs, where answers are synthesized rather than listed. The GEO framework introduces two critical metrics:&lt;/p&gt;

&lt;h4&gt;
  
  
  2.2.1 Position-Adjusted Word Count (PAWC)
&lt;/h4&gt;

&lt;p&gt;This metric quantifies the sheer volume of visibility a source achieves, weighted by its prominence.&lt;/p&gt;

&lt;p&gt;The PAWC score is calculated as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PAWC = ∑ (Wordsᵢ / Positionᵢ)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wordsᵢ&lt;/strong&gt;: The word count of the citation from source &lt;em&gt;i&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Positionᵢ&lt;/strong&gt;: The rank order of that citation within the response. Is the rank order of that citation within the response. This accounts for the user behavior that prioritizes information presented earlier in the response. A source that provides the opening definition is significantly more valuable than one cited in the concluding footer.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2.2.2 Subjective Impression (SI)
&lt;/h4&gt;

&lt;p&gt;Recognizing that volume is not quality, the researchers also utilized a Subjective Impression metric, often evaluated by an LLM judge (like G-Eval). This composite score assesses seven dimensions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relevance:&lt;/strong&gt; Does the citation directly address the prompt?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Influence:&lt;/strong&gt; Did the source shape the core narrative of the answer?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uniqueness:&lt;/strong&gt; Did the source provide information found nowhere else?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trustworthiness:&lt;/strong&gt; Is the source perceived as authoritative?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Position:&lt;/strong&gt; Where does it appear visually?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diversity:&lt;/strong&gt; Does it add a new perspective?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Click-Through Probability:&lt;/strong&gt; How likely is a user to verify this source?.   &lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Empirical Results: The Efficacy of Optimization
&lt;/h3&gt;

&lt;p&gt;The findings of the Aggarwal study are stark. By applying GEO strategies, content creators could improve their visibility by approximately 40%. This suggests that the "black box" of AI search is actually highly sensitive to specific content features.   &lt;/p&gt;

&lt;p&gt;The study tested nine strategies. Their relative performance offers a roadmap for developers and content strategists:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Optimization Strategy&lt;/th&gt;
&lt;th&gt;Relative Improvement (PAWC)&lt;/th&gt;
&lt;th&gt;Mechanism of Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Statistics Addition&lt;/td&gt;
&lt;td&gt;+41%&lt;/td&gt;
&lt;td&gt;Exploits "Concreteness Bias" in LLMs; provides high information density.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cite Sources&lt;/td&gt;
&lt;td&gt;+40%&lt;/td&gt;
&lt;td&gt;Leveraging secondary authority; signals verification to the model.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quotation Addition&lt;/td&gt;
&lt;td&gt;+38%&lt;/td&gt;
&lt;td&gt;Named Entity Recognition (NER) anchoring; connects content to experts.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fluency Optimization&lt;/td&gt;
&lt;td&gt;+29%&lt;/td&gt;
&lt;td&gt;Reduces perplexity; makes content easier for the model to summarize.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Easy-to-Understand&lt;/td&gt;
&lt;td&gt;+25%&lt;/td&gt;
&lt;td&gt;Simplifies syntax, aiding in information extraction and synthesis.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authoritative Tone&lt;/td&gt;
&lt;td&gt;+10%&lt;/td&gt;
&lt;td&gt;Stylistic changes have marginal impact compared to structural/data changes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keyword Stuffing&lt;/td&gt;
&lt;td&gt;-10% (Negative)&lt;/td&gt;
&lt;td&gt;Triggers spam heuristics; lowers semantic entropy and relevance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Analysis of the Findings:&lt;/strong&gt; The data reveal a clear hierarchy. Strategies that add information (Statistics, Quotes, Citations) vastly outperform strategies that manipulate style (Tone, Fluency). The worst performing strategy was Keyword Stuffing, a relic of SEO that actively harms GEO performance. This confirms that LLMs prioritize Information Gain. A sentence containing a specific statistic ("grew by 41%") reduces uncertainty more than a vague sentence ("grew significantly"), and thus receives higher attention weights during generation.   &lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Domain-Specific Nuances
&lt;/h3&gt;

&lt;p&gt;The efficacy of these strategies is not uniform across all verticals. The study highlighted critical variations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debate &amp;amp; History:&lt;/strong&gt; In these domains, "Authoritative Tone" and "Citations" performed exceptionally well. The models are tuned to seek consensus and verification for historical facts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Science &amp;amp; Health:&lt;/strong&gt; "Statistics" and "Cite Sources" are paramount. The model's safety alignment layers likely prioritize data-backed claims to prevent misinformation.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shopping &amp;amp; Product:&lt;/strong&gt; "Quotations" (Reviews) and "Statistics" (Price, Specs) drive visibility. Users—and thus the models simulating them—seek concrete product attributes and social proof.   &lt;/p&gt;

&lt;p&gt;This implies that a monolithic GEO strategy is flawed. A legal firm must optimize for authority and citation, while an e-commerce platform must optimize for structured data and specific attribute density.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Architecture of Generative Retrieval (RAG)
&lt;/h2&gt;

&lt;p&gt;To effectively engineer content for GEO, developers must understand the underlying system architecture. Most Generative Engines utilize a framework known as Retrieval-Augmented Generation (RAG). This system bridges the gap between the LLM's frozen training data and the dynamic nature of the web.   &lt;/p&gt;

&lt;p&gt;The RAG pipeline consists of several discrete stages, each presenting unique optimization opportunities and failure points.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 The Ingestion and Chunking Phase
&lt;/h3&gt;

&lt;p&gt;The process begins not with the user query, but with the ingestion of web content. Unlike Google's crawler, which renders the full DOM to understand layout, RAG systems often use lightweight parsers to strip HTML down to raw text.&lt;/p&gt;

&lt;p&gt;Once the text is extracted, it is not stored as a whole document. It is split into Chunks. This is a critical engineering constraint.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Token Limits: LLMs have finite context windows. To maximize the relevance of the context, documents are sliced into segments (e.g., 500 tokens).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Risk: If a sentence is cut in half, or if a pronoun ("It") is separated from its antecedent ("The API"), the chunk loses its semantic meaning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimization: This is where Semantic Chunking becomes vital. Developers must structure HTML so that parsers (like LangChain's HTMLSectionSplitter) break the content at logical boundaries (&lt;code&gt;&amp;lt;h2&amp;gt;, &amp;lt;article&amp;gt;&lt;/code&gt;) rather than arbitrary character counts.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3.2 The Vector Space Model and Embeddings
&lt;/h3&gt;

&lt;p&gt;After chunking, the text is converted into Vector Embeddings. An embedding model (such as OpenAI's text-embedding-3 or bge-m3) transforms the text into a high-dimensional vector (a list of numbers) representing its semantic meaning.   &lt;/p&gt;

&lt;p&gt;When a user asks a question, their query is also converted into a vector. The system then performs a Cosine Similarity search to find chunks that are mathematically close to the query vector.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implication: Exact keyword matching is less important than conceptual matching. However, "Hybrid Search" (combining Vector + Keyword search) is becoming the standard to ensure precision for specific terms (e.g., product names like "RTX 4090").
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3.3 The "Lost in the Middle" Phenomenon
&lt;/h3&gt;

&lt;p&gt;One of the most significant findings in recent LLM research is the &lt;strong&gt;"Lost in the Middle"&lt;/strong&gt; phenomenon, identified by Liu et al. (2023). When an LLM is presented with a long context window (e.g., 10 retrieved documents), it exhibits a U-shaped performance curve. It is highly effective at retrieving information from the beginning and the end of the context, but performance degrades significantly for information buried in the middle.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering Consequence:&lt;/strong&gt; This dictates a strict content architecture. The "Inverse Pyramid" style of journalism must be enforced programmatically. The core answer, the key statistic, and the primary definition must appear at the very top of the document (or the top of the semantic section). If the answer is buried in the 5th paragraph of a long introduction, it risks falling into the "Lost in the Middle" zone of the RAG context window, effectively rendering it invisible to the generation layer.   &lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Attention Mechanisms and Citation Bias
&lt;/h3&gt;

&lt;p&gt;Once the relevant chunks are retrieved and placed in the context window, the LLM generates the answer. This process is governed by the Attention Mechanism, which assigns "weights" to different parts of the input context.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Attention Weights: The model calculates how much "attention" it should pay to each token in the context when predicting the next word.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bias: Research shows LLMs have a Concreteness Bias (also called Authority Bias). They assign higher attention weights to chunks that contain specific details, numerical values, and authoritative citations.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This explains the empirical success of the "Statistics Addition" strategy in the Aggarwal paper. A chunk containing "41%" attracts more "attention" (mathematically) than a chunk containing "significant growth," leading to a higher probability of that statistic being included in the final generation.   &lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 GraphRAG: The Next Frontier
&lt;/h3&gt;

&lt;p&gt;While Vector RAG is the current standard, 2025 is seeing the rise of GraphRAG. This approach combines vector search with Knowledge Graphs (KGs).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limitation of Vectors:&lt;/strong&gt; Vectors struggle with multi-hop reasoning. If Document A connects "Entity X" to "Entity Y," and Document B connects "Entity Y" to "Entity Z," a vector search might fail to connect "X" to "Z."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GraphRAG Solution:&lt;/strong&gt; By structuring data as a graph (Nodes and Edges), the system can traverse these relationships. Microsoft Research and others have shown that GraphRAG significantly improves answer comprehensiveness and accuracy, particularly for complex queries.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimization:&lt;/strong&gt; To optimize for GraphRAG, content must be structured to facilitate entity extraction. This means using consistent naming conventions, explicit internal linking with descriptive anchor text, and Schema.org markup to define relationships between entities.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Engineering Content for Machine Readability
&lt;/h2&gt;

&lt;p&gt;The transition to GEO requires developers to view content not just as text for humans, but as structured data for machines. This section details the technical implementation standards required to ensure content is parseable, chunkable, and retrievable.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 Semantic HTML5: The DOM as a Chunking Map
&lt;/h3&gt;

&lt;p&gt;Most RAG ingestion pipelines utilize HTML parsers that strip away styling to focus on structure. If a webpage is a "div soup"—a nested mess of generic &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; tags—the parser struggles to identify the semantic boundaries of the content. This leads to poor chunking, where headers are separated from their body text, or unrelated sidebars are merged into the main content context.&lt;/p&gt;

&lt;p&gt;The Semantic Hierarchy Standard: To ensure optimal chunking by libraries like LangChain or LlamaIndex, developers must strictly adhere to HTML5 semantic tags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;: This tag should wrap the primary content. RAG parsers often use this as the root element to isolate the "meat" of the page from navigation and footers.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;h1&amp;gt; - &amp;lt;h6&amp;gt;&lt;/code&gt;: These tags are not merely for font sizing; they are structural delimiters. Advanced chunking strategies (e.g., HTMLHeaderTextSplitter) split text specifically at these boundaries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Constraint: Do not use &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; for visual styling of non-header text. Do not skip levels (e.g., jumping from &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h4&amp;gt;&lt;/code&gt;). This breaks the document tree structure that parsers rely on.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;: Use this tag to explicitly group a header and its associated paragraphs. This provides a strong signal to the chunking algorithm that these elements belong together in a single vector context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;: LLMs are exceptionally good at interpreting tabular data, provided it is structured correctly. Use &lt;code&gt;&amp;lt;thead&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;tbody&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;th&amp;gt;&lt;/code&gt; tags. Avoid using CSS Grid or Flexbox to simulate tables, as the raw text extraction will lose the row/column relationships.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code Example: Optimized HTML Structure&lt;br&gt;
&lt;/p&gt;

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

&amp;lt;article itemscope itemtype="https://schema.org/TechArticle"&amp;gt;
  &amp;lt;header&amp;gt;
    &amp;lt;h1 itemprop="headline"&amp;gt;Optimizing RAG Pipelines with Semantic HTML&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;By &amp;lt;span itemprop="author"&amp;gt;Dr. Jane Doe&amp;lt;/span&amp;gt; | &amp;lt;time itemprop="dateModified" datetime="2025-03-10"&amp;gt;March 10, 2025&amp;lt;/time&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;/header&amp;gt;

  &amp;lt;section id="key-takeaways"&amp;gt;
    &amp;lt;h2&amp;gt;Key Takeaways&amp;lt;/h2&amp;gt;
    &amp;lt;ul&amp;gt;
      &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Statistic:&amp;lt;/strong&amp;gt; Semantic chunking improves retrieval accuracy by 28%.&amp;lt;/li&amp;gt;
      &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Fact:&amp;lt;/strong&amp;gt; The &amp;amp;lt;article&amp;amp;gt; tag is the primary signal for content extraction.&amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
  &amp;lt;/section&amp;gt;

  &amp;lt;section id="chunking-strategies"&amp;gt;
    &amp;lt;h2&amp;gt;HTML Partitioning Strategies&amp;lt;/h2&amp;gt;
    &amp;lt;p&amp;gt;Using the &amp;lt;code&amp;gt;HTMLSectionSplitter&amp;lt;/code&amp;gt; in LangChain...&amp;lt;/p&amp;gt;
    &amp;lt;table&amp;gt;
      &amp;lt;caption&amp;gt;Comparison of Chunking Methods&amp;lt;/caption&amp;gt;
      &amp;lt;thead&amp;gt;
        &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Accuracy&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
      &amp;lt;/thead&amp;gt;
      &amp;lt;tbody&amp;gt;
        &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Fixed-Size&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Low&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Low&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
        &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Semantic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;High&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Medium&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
      &amp;lt;/tbody&amp;gt;
    &amp;lt;/table&amp;gt;
  &amp;lt;/section&amp;gt;
&amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure ensures that when the "Key Takeaways" section is chunked, it retains its header, its list structure, and its high-value statistics in a single, coherent unit.   &lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 JSON-LD and Schema.org: The Knowledge Graph API
&lt;/h3&gt;

&lt;p&gt;While HTML provides the structure, Structured Data (JSON-LD) provides the semantic meaning. In GEO, Schema.org markup acts as an API that feeds directly into the Knowledge Graph of the Generative Engine. This is critical for Entity Disambiguation—ensuring the engine knows that "Python" refers to the programming language, not the snake.&lt;/p&gt;

&lt;p&gt;Essential Schema Types for GEO:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Article&lt;/code&gt; / &lt;code&gt;TechArticle&lt;/code&gt;: Mandatory for content. Must include &lt;code&gt;dateModified&lt;/code&gt; (a key signal for "Freshness" in ranking algorithms) and &lt;code&gt;author&lt;/code&gt;(for Authority/E-E-A-T).   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;FAQPage&lt;/code&gt;: This schema is particularly potent for GEO. It breaks content into discrete Question-Answer pairs. Since user queries to GEs are often questions, having a pre-formatted Q&amp;amp;A pair in your schema significantly increases the probability of retrieval.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ClaimReview&lt;/code&gt;: This is the gold standard for fact-based content. It explicitly tells the engine, "We are checking a claim, and here is the verdict." This aligns perfectly with the "Verification" intent of many GE users.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Organization&lt;/code&gt;: Used to establish the brand entity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Technique:&lt;/strong&gt; The &lt;code&gt;mentions&lt;/code&gt;Property. To actively build connections in the Knowledge Graph (optimizing for GraphRAG), use the mentions property to link your content to established entities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JSON
"mentions":
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This explicitly tells the engine that your article is about these topics, strengthening the semantic connection in the vector space.   &lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 Crawler Management: Robots.txt and AI User Agents
&lt;/h3&gt;

&lt;p&gt;GEO requires that your content be accessible to the specific bots used by Generative Engines. Blocking these bots (to protect copyright) is a valid business decision, but it creates a "GEO Blackout." If the bot cannot crawl, it cannot index, and it cannot cite.&lt;/p&gt;

&lt;p&gt;Key AI User Agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;GPTBot: The crawler for OpenAI (ChatGPT).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ClaudeBot: The crawler for Anthropic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CCBot (Common Crawl): Used by many open-source and commercial models as a foundational training set.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google-Extended: Controls usage for Gemini and Vertex AI generative features, distinct from Googlebot (Search).   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optimized &lt;code&gt;robots.txt&lt;/code&gt;Configuration: User-agent: GPTBot Allow: /&lt;/p&gt;

&lt;p&gt;User-agent: CCBot Allow: /&lt;/p&gt;

&lt;p&gt;User-agent: Google-Extended Allow: /&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block generic scrapers that offer no value&lt;/strong&gt;&lt;br&gt;
User-agent: Bytespider Disallow: / Developers should regularly audit their server logs to identify which AI bots are crawling their site and ensure they are not being inadvertently blocked by firewalls or rate limits.   &lt;/p&gt;

&lt;h3&gt;
  
  
  4.4 Python Libraries in the Wild
&lt;/h3&gt;

&lt;p&gt;Understanding the tools used to build RAG systems gives developers an edge. The two dominant libraries are LangChain and LlamaIndex.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;LangChain: Uses splitters like RecursiveCharacterTextSplitter (default) and HTMLHeaderTextSplitter. Knowing the default chunk sizes (often 1000 or 4000 tokens) helps in sizing paragraphs and sections.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LlamaIndex: Focuses heavily on data ingestion. It uses SimpleDirectoryReader and typically defaults to chunks of 1024 tokens with a 20-token overlap. Content that fits neatly within these boundaries is less likely to be fragmented.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unstructured.io: A popular tool for parsing complex documents (PDFs, raw HTML). It has "partitioning strategies" (Auto, Fast, Hi-Res). GEO strategies must account for how these partitions interpret visual data like tables and images.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Content Engineering Strategies: The "Cite Sources" Pattern
&lt;/h2&gt;

&lt;p&gt;Having established the technical foundation, we turn to the content itself. The findings from the GEO paper and subsequent research suggest that writing style must evolve from "engaging" to "citable."&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 The "Cite Sources" Methodology
&lt;/h3&gt;

&lt;p&gt;The single most effective GEO strategy is Cite Sources. This involves explicitly linking to external, high-authority domains within the text. This works because LLMs use outbound links as heuristic signals for trust and verification.   &lt;/p&gt;

&lt;p&gt;Implementation: Do not merely make a claim. State the claim, and immediately attribute it to a primary source.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Weak: "The generative AI market is growing rapidly."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strong: "According to a 2024 report by Bloomberg Intelligence [Link], the generative AI market is projected to reach $1.3 trillion by 2032."&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure creates a "Trust Triad": Claim + Statistic + Source. The attention mechanism of the LLM assigns a higher weight to this pattern, increasing the likelihood that it will be retrieved and cited in the final answer.   &lt;/p&gt;

&lt;h3&gt;
  
  
  5.2 Statistical Density and Concreteness
&lt;/h3&gt;

&lt;p&gt;LLMs exhibit Concreteness Bias. They prefer specific details over generalities. This is quantified in the "Statistics Addition" strategy (+41% visibility).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mechanism: When an LLM predicts the next token for a query like "impact of AI on coding," it gravitates towards tokens that reduce entropy. A number ("45% increase") is a low-entropy, high-information token. A vague phrase ("big increase") is high-entropy and less likely to be selected.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strategy: Audit content for adjectives like "many," "most," "significant," and replace them with data. If exact data is unavailable, use ranges or comparative benchmarks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5.3 Quotation and Named Entity Anchoring
&lt;/h3&gt;

&lt;p&gt;Including direct quotes from experts (+38% visibility) leverages Named Entity Recognition (NER).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mechanism: LLMs recognize entities (people, companies). When a quote is attributed to a recognized entity (e.g., "Sam Altman"), the text gains "Entity Weight." This helps anchor the content in the Knowledge Graph, associating the topic with the expert.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Strategy: Use the &lt;/p&gt;
&lt;blockquote&gt; HTML tag. Ensure the author's name is close to the quote in the DOM structure.&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5.4 The Inverse Pyramid 2.0
&lt;/h3&gt;

&lt;p&gt;To combat the "Lost in the Middle" phenomenon, content must follow a strict Inverse Pyramid structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The BLUF (Bottom Line Up Front): The first 200 words of the document (or the first 100 words after an H2) must contain the direct answer, the key statistic, and the definition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Summaries: Start long articles with a "Key Takeaways" list. This provides a dense, context-rich chunk that is highly likely to be retrieved and placed at the start of the context window, maximizing its attention score.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Metrics, Measurement, and Future Outlook
&lt;/h2&gt;

&lt;p&gt;As we transition to GEO, our measurement frameworks must evolve. We can no longer rely on simple rank tracking.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 New Metrics: PAWC and SoV
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Position-Adjusted Word Count (PAWC): This metric measures visibility by weighting the volume of text cited by its position. It acknowledges that being the first citation is exponentially more valuable than being the last.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share of Voice (SoV): Brands must measure their "Generative Share of Voice." This involves monitoring a set of strategic prompts and calculating the percentage of answers where the brand is cited or recommended compared to competitors.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SoV = (Brand Citations / Total Citations) × 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6.2 Tools and Tracking
&lt;/h3&gt;

&lt;p&gt;The tooling landscape is immature but growing. Platforms like Otterly.AI, Profound, and SE Ranking are developing capabilities to track "AI Overview" visibility and citation frequency. Developers can also build custom scrapers using the APIs of Perplexity or OpenAI to monitor their brand's presence in generated responses.   &lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 The Future: Convergence and Sustainability
&lt;/h3&gt;

&lt;p&gt;Is GEO sustainable? The data suggests it is not only sustainable but inevitable. As LLMs become more grounded in real-time data, the reliance on structured, authoritative content will only increase. However, a risk remains: the Hallucination Loop. If GEs cite incorrect information, and that information is republished, it reinforces the error. GEO practitioners have an ethical responsibility to ensure accuracy, using tools like ClaimReview schema to correct the record.   &lt;/p&gt;

&lt;p&gt;Ultimately, SEO and GEO will converge into Information Optimization. The dichotomy of "optimizing for bots" vs. "optimizing for users" will dissolve, because the bot is now the primary user proxy. By engineering content that is machine-readable, statistically dense, and structurally sound, developers ensure their content survives the transition from the Ten Blue Links to the Single Synthesized Answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.4 Strategic Checklist for Developers
&lt;/h3&gt;

&lt;p&gt;To operationalize GEO, technical teams should implement the following:&lt;/p&gt;

&lt;p&gt;[ ] Semantic Audit: Verify all content uses correct HTML5 semantic tags (&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;[ ] Schema Implementation: Deploy FAQPage and ClaimReview JSON-LD across relevant pages.&lt;/p&gt;

&lt;p&gt;[ ] Entity Linking: Use mentions schema to connect content to Wikidata entities.&lt;/p&gt;

&lt;p&gt;[ ] Robot Access: whitelist &lt;code&gt;GPTBot&lt;/code&gt;, &lt;code&gt;ClaudeBot&lt;/code&gt;, and &lt;code&gt;CCBot&lt;/code&gt;in &lt;code&gt;robots.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;[ ] Data Density: Enforce a policy of replacing qualitative adjectives with quantitative statistics.&lt;/p&gt;

&lt;p&gt;[ ] Citation Architecture: Ensure all claims are backed by outbound links to authoritative domains.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In 2025, visibility is no longer about being found; it is about being understood.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>ai</category>
      <category>webdev</category>
      <category>geo</category>
    </item>
    <item>
      <title>Exploring Python 3.14's Zstandard Compression</title>
      <dc:creator>ZEZE1020</dc:creator>
      <pubDate>Fri, 25 Jul 2025 23:09:47 +0000</pubDate>
      <link>https://forem.com/zeze1020/exploring-python-314s-zstandard-compression-59a</link>
      <guid>https://forem.com/zeze1020/exploring-python-314s-zstandard-compression-59a</guid>
      <description>&lt;p&gt;As a developer interested in exploring Python’s latest features, I tried Python 3.14, I like the fact that its version name is close to π. It is set to be released in October 2025, and I discovered its new &lt;code&gt;compression.zstd&lt;/code&gt; module. This module brings the Zstandard compression algorithm, known for its speed and high compression ratios, into Python’s standard library. I created &lt;strong&gt;PyChive&lt;/strong&gt;, a simple project to compress text files concurrently using this new feature. In this article, I’ll share what I learned while building PyChive, including code snippets and challenges faced.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;@itseieio, shared how they compressed 335 GB of chess data using zstd, saving significant space compared to JSON (&lt;a href="https://t.co/GvCKnMmAGj" rel="noopener noreferrer"&gt;X post&lt;/a&gt;).&lt;/em&gt;
&lt;/h4&gt;

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

&lt;p&gt;Zstandard, developed by Facebook, is a fast compression algorithm that balances high compression ratios with quick performance. According to the &lt;a href="http://facebook.github.io/zstd/" rel="noopener noreferrer"&gt;Zstandard website&lt;/a&gt;, it outperforms older algorithms like gzip and bzip2, offering tunable speed versus compression trade-offs. Python 3.14’s &lt;code&gt;compression.zstd&lt;/code&gt; module, introduced via PEP 784, makes this algorithm accessible without external dependencies, supporting file compression, decompression, and advanced features like dictionary training (&lt;a href="https://docs.python.org/3.14/library/compression.zstd.html" rel="noopener noreferrer"&gt;Python 3.14 Documentation&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  PyChive: A Simple Compression Tool
&lt;/h2&gt;

&lt;p&gt;PyChive is a Python script that compresses all &lt;code&gt;.txt&lt;/code&gt; files in the current directory into &lt;code&gt;.zst&lt;/code&gt; files using Zstandard. It uses &lt;code&gt;ThreadPoolExecutor&lt;/code&gt; for concurrent processing, testing Python 3.14’s potential free-threaded mode (PEP 779). The project avoids complex features like template strings to keep it accessible, focusing on compression and basic reporting of file details (names, sizes, and compression ratios).&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Python 3.14 Beta
&lt;/h3&gt;

&lt;p&gt;Since Python 3.14’s stable release is pending, I used the beta version (3.14.0b2). Here’s how to set it up with pyenv, which makes managing Python versions easy (&lt;a href="https://realpython.com/intro-to-pyenv/" rel="noopener noreferrer"&gt;Real Python: Managing Multiple Python Versions&lt;/a&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install python 3.14 beta with (&lt;a href="https://ubuntuhandbook.org/index.php/2025/05/install-python-3-14-ubuntu/" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install pyenv (if not already installed)&lt;/span&gt;
curl https://pyenv.run | bash

&lt;span class="c"&gt;# Install Python 3.14.0b2&lt;/span&gt;
pyenv &lt;span class="nb"&gt;install &lt;/span&gt;3.14.0b2
pyenv global 3.14.0b2

&lt;span class="c"&gt;# Verify version&lt;/span&gt;
python &lt;span class="nt"&gt;--version&lt;/span&gt;  &lt;span class="c"&gt;# Should output: Python 3.14.0b2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, download the beta from &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;python.org&lt;/a&gt;. There's always caution about beta stability, but for testing, it’s a great way to explore new features.&lt;/p&gt;

&lt;h3&gt;
  
  
  PyChive’s Core Code
&lt;/h3&gt;

&lt;p&gt;Here’s the main implimentation of PyChive, a script that compresses &lt;code&gt;.txt&lt;/code&gt; files and prints their details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compression.zstd&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;shutil&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compress_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Compress a file using Zstandard and return compression stats.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rb&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;compression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zstd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;wb&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f_out&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;shutil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copyfileobj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f_out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;original_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getsize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;compressed_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getsize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;output_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;compression_ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original_size&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;compressed_size&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ZeroDivisionError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;compression_ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;original_filename&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;input_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compressed_filename&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;output_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;original_size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;original_size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compressed_size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;compressed_size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compression_ratio&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;compression_ratio&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; 


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Get all .txt files in the current directory
&lt;/span&gt;    &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isfile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.txt&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No .txt files found in the current directory.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;# Compress files concurrently
&lt;/span&gt;    &lt;span class="n"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;executor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;futures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;executor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;compress_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.zst&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;future&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;future&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;futures&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;conc_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start_time&lt;/span&gt;

    &lt;span class="c1"&gt;# Print compression time and file details
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Concurrent compression time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;conc_time&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Compression Report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original file: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;original_filename&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Compressed file: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compressed_filename&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original size: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;original_size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; bytes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Compressed size: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compressed_size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; bytes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Compression ratio: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;compression_ratio&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Code Breakdown
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compression Function&lt;/strong&gt;: The &lt;code&gt;compress_file&lt;/code&gt; function uses &lt;code&gt;compression.zstd.open&lt;/code&gt; to compress a file, streaming data with &lt;code&gt;shutil.copyfileobj&lt;/code&gt; for efficiency. It returns a dictionary with file details: &lt;code&gt;original_filename&lt;/code&gt;, &lt;code&gt;compressed_filename&lt;/code&gt;, &lt;code&gt;original_size&lt;/code&gt;, &lt;code&gt;compressed_size&lt;/code&gt;, and &lt;code&gt;compression_ratio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main Function&lt;/strong&gt;: The &lt;code&gt;main&lt;/code&gt; function finds &lt;code&gt;.txt&lt;/code&gt; files, compresses them concurrently using &lt;code&gt;ThreadPoolExecutor&lt;/code&gt;, and prints stats directly from the &lt;code&gt;stats&lt;/code&gt; dictionary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency&lt;/strong&gt;: Using &lt;code&gt;max_workers=4&lt;/code&gt;, it tests Python 3.14’s free-threaded mode, which may improve performance for I/O-bound tasks like compression.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Running PyChive
&lt;/h3&gt;

&lt;p&gt;To run PyChive:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ensure Python 3.14.0b2 is installed.&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;.txt&lt;/code&gt; files in the script’s directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Sample content for testing"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test1.txt
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Sample content for testing"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test2.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the script:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Expected output:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Concurrent compression time: 0.123456 seconds
   Compression Report
   ------------------
   Original file: test1.txt
   Compressed file: test1.txt.zst
   Original size: 26 bytes
   Compressed size: 10 bytes
   Compression ratio: 0.38

   Compression Report
   ------------------
   Original file: test2.txt
   Compressed file: test2.txt.zst
   Original size: 26 bytes
   Compressed size: 10 bytes
   Compression ratio: 0.38
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Challenges and Lessons Learned
&lt;/h3&gt;

&lt;p&gt;While writing PyChive, I encountered several challenges, particularly with implementing t-templates, a new feature in Python 3.14 introduced via PEP 750. These hurdles provided valuable learning experiences, deepening my understanding of Python’s latest capabilities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Understanding T-Templates
&lt;/h4&gt;

&lt;p&gt;T-templates, or template strings, are designed to offer a safer alternative to f-strings for scenarios involving user input or dynamic content generation. Unlike f-strings, which evaluate expressions immediately, t-templates use a &lt;code&gt;Template&lt;/code&gt; object to process placeholders, allowing for more control and security.&lt;/p&gt;

&lt;p&gt;Initially, I struggled with the syntax and usage of t-templates. In PyChive, I aimed to generate compression reports using placeholders like &lt;code&gt;{original_filename}&lt;/code&gt;. However, I mistakenly tried to access variables directly, leading to a &lt;code&gt;NameError&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Incorrect approach
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original file: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;original_filename&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# NameError: name 'original_filename' is not defined
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This error occurred because &lt;code&gt;original_filename&lt;/code&gt; was not a standalone variable but a key in the &lt;code&gt;stats&lt;/code&gt; dictionary returned by the &lt;code&gt;compress_file&lt;/code&gt; function. I identified that the correct approach involves using a &lt;code&gt;Template&lt;/code&gt; object and passing the &lt;code&gt;stats&lt;/code&gt; dictionary to render the report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;string.templatelib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Template&lt;/span&gt;

&lt;span class="n"&gt;report_template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Compression Report
------------------
Original file: {original_filename}
Compressed file: {compressed_filename}
Original size: {original_size} bytes
Compressed size: {compressed_size} bytes
Compression ratio: {compression_ratio}
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

&lt;span class="c1"&gt;# Render the template with stats dictionary
&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;render_report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report_template&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a detailed explanation of t-templates, I relied on Real Python’s guide (&lt;a href="https://realpython.com/python314-template-strings/" rel="noopener noreferrer"&gt;Real Python: Template Strings in Python 3.14&lt;/a&gt;), which clarified their syntax and use cases.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Takeaways
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;T-Templates Differ from F-Strings&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax Mastery Is Essential&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community Resources Shine&lt;/strong&gt;: Real Python’s content was a lifeline, offering practical examples that bridged the gap between theory and application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experimenting with t-templates in PyChive made me appreciate Python 3.14’s new features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why PyChive Matters
&lt;/h3&gt;

&lt;p&gt;PyChive is a start to exploring Python 3.14’s capabilities. It shows how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;compression.zstd&lt;/code&gt; for efficient file compression.&lt;/li&gt;
&lt;li&gt;Use concurrency for performance gains.&lt;/li&gt;
&lt;li&gt;Keep code simple for learning and experimentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As Python 3.14’s stable release approaches, PyChive can evolve, potentially adding a web interface or advanced features like Zstandard dictionaries. For now, it’s a practical example for you to dive into Python’s latest tools. I'd love to see what you'd come up with!&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;PyChive taught me the power of Zstandard compression and Python 3.14’s potential for efficient file handling. I encourage you to try PyChive, experiment with Python 3.14, and share your findings. Check out the &lt;a href="https://docs.python.org/3.14/library/compression.zstd.html" rel="noopener noreferrer"&gt;Python 3.14 documentation&lt;/a&gt; and &lt;a href="https://realpython.com" rel="noopener noreferrer"&gt;Real Python&lt;/a&gt; for more on Python’s new features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3.14/library/compression.zstd.html" rel="noopener noreferrer"&gt;Python 3.14 Documentation: compression.zstd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://realpython.com/intro-to-pyenv/" rel="noopener noreferrer"&gt;Real Python: Managing Multiple Python Versions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://facebook.github.io/zstd/" rel="noopener noreferrer"&gt;Zstandard Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://realpython.com/python314-template-strings/" rel="noopener noreferrer"&gt;Real Python: Template Strings in Python 3.14&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Growing with AI, a developer's perspective.</title>
      <dc:creator>ZEZE1020</dc:creator>
      <pubDate>Fri, 04 Jul 2025 13:13:10 +0000</pubDate>
      <link>https://forem.com/zeze1020/growing-with-ai-a-developers-perspective-3bhc</link>
      <guid>https://forem.com/zeze1020/growing-with-ai-a-developers-perspective-3bhc</guid>
      <description>&lt;h2&gt;
  
  
  Learning to Code in the Generative AI Era
&lt;/h2&gt;

&lt;p&gt;Learning to code today can feel like trying to learn a new language while someone else writes your essays. If you cut your teeth in the “deep learning era,” AI was mostly about tiny human-like tasks—IDEs suggesting variable names or completing lines based on your open file. Fast forward to now, and you can hop on &lt;a href="https://chat.openai.com" rel="noopener noreferrer"&gt;chat.openai.com&lt;/a&gt; and type:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make me a weather app in React&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;…then instantly receive a full React project scaffolded for you. That’s powerful, and that is barely scratching the surface of what's possible, but it begs the question:&lt;/p&gt;

&lt;p&gt;How do you learn to code, and grow beyond copy-and-paste, when a model can fetch answers from petabytes of training data in seconds?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Shouldn’t Go Cold Turkey on LLMs
&lt;/h2&gt;

&lt;p&gt;Some developers swear off large language models entirely. Others chase every prompt for fear of missing out. Here’s how I’ve found them genuinely useful—in my learning and when mentoring STEM students:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quick prototyping: 
Validate an idea or UI flow in minutes instead of hours.
&lt;/li&gt;
&lt;li&gt;Proof of concept: 
Generate minimal viable code to demonstrate feasibility or gather early stakeholder feedback.
&lt;/li&gt;
&lt;li&gt;Edge-case evaluation: 
Ask the model to enumerate error conditions, then compare them against your logic.
&lt;/li&gt;
&lt;li&gt;Concept simplification: 
Turn dense specs or docs into bite-sized explanations you can internalize.
&lt;/li&gt;
&lt;li&gt;Relatable explanations: 
Break down complex algorithms into real-world metaphors that stick.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A Framework for Effective Learning
&lt;/h2&gt;

&lt;p&gt;Writing code is only half the battle. Learning how to learn and adapt to Gen AI or even agentic AI tools takes intent. Here’s what I found useful:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Effective prompting&lt;br&gt;&lt;br&gt;
Break your prompt into clear intents: context, task, constraints, format, examples, and follow-up questions. See this &lt;a href="https://github.com/dair-ai/Prompt-Engineering-Guide" rel="noopener noreferrer"&gt;prompt engineering guide&lt;/a&gt; for inspiration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understanding model capabilities&lt;br&gt;&lt;br&gt;
Familiarize yourself with terms like multimodal, context window, temperature, tokenization, and parameters. The &lt;a href="https://platform.openai.com/docs/guides/chat" rel="noopener noreferrer"&gt;OpenAI documentation&lt;/a&gt; is a great starting point.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tool selection&lt;br&gt;&lt;br&gt;
Match the right AI service to your need. Use a lightweight chatbot for brainstorming, the &lt;a href="https://platform.openai.com/playground" rel="noopener noreferrer"&gt;Playground&lt;/a&gt; for code tinkering, and specialized APIs (e.g., &lt;a href="https://openai.com/codex/" rel="noopener noreferrer"&gt;Codex&lt;/a&gt;) for deeper integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hands-on practice&lt;br&gt;&lt;br&gt;
Nothing beats building, breaking, and rebuilding. Spin up a small side project, maybe a React app fetching weather data from &lt;a href="https://openweathermap.org/api" rel="noopener noreferrer"&gt;OpenWeatherMap&lt;/a&gt; and iterate, learning how and why it works is as important as having it work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gathering perspectives&lt;br&gt;&lt;br&gt;
Compare model suggestions with community feedback. Share your code in the communities you are in to spot blind spots. You may also ask a colleague to review the code you have written.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deep dives&lt;br&gt;&lt;br&gt;
AI-generated answers are a springboard, not a finish line. Always dig into source docs, RFCs, books, technical blogposts, and tutorials to solidify your understanding, The list is endless.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Useful Planning &amp;amp; Software Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Trello or Notion for a roadmap and task breakdown
&lt;/li&gt;
&lt;li&gt;VS Code with AI-powered extensions (GitHub Copilot, Tabnine)
&lt;/li&gt;
&lt;li&gt;Postman or Hoppscotch for API testing
&lt;/li&gt;
&lt;li&gt;GitHub Projects and Actions for CI/CD practice
&lt;/li&gt;
&lt;li&gt;Discord/Slack communities (AI Study Groups, local meetups)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By blending the strengths of Generative AI with deliberate learning habits, you’ll stay sharp,  turning these useful models into lifelong growth partners.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
