<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Raj on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Raj on Medium]]></description>
        <link>https://medium.com/@abhishekraj0?source=rss-a15372163ccb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kE0jw7epz0MX7ve1</url>
            <title>Stories by Abhishek Raj on Medium</title>
            <link>https://medium.com/@abhishekraj0?source=rss-a15372163ccb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 06:24:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishekraj0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building “Inception” for LLMs: Recursive Language Models in Java]]></title>
            <link>https://abhishekraj0.medium.com/building-inception-for-llms-recursive-language-models-in-java-aa45daa6ef42?source=rss-a15372163ccb------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa45daa6ef42</guid>
            <category><![CDATA[recursive-language-models]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[context]]></category>
            <dc:creator><![CDATA[Abhishek Raj]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 09:20:31 GMT</pubDate>
            <atom:updated>2026-02-20T09:20:31.869Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve all been there: you have a 20MB log file or a massive 500-page PDF, and you want to ask an AI a specific question. You could use <strong>RAG (Retrieval-Augmented Generation)</strong>, but RAG is “lossy” — it breaks the text into chunks and hopes the right one matches your search query.</p><p>What if the AI could <strong>decide</strong> which parts of the document to read, jump around, and summarize as it goes? That is a <strong>Recursive Language Model (RLM)</strong>.</p><h3>The Java Blueprint</h3><p>In Java, we can leverage <strong>LangChain4j</strong> to build this. We create a “Manager” that holds the massive text and an “Agent” that uses tools to slice it.</p><h3>Step 1: The Context Tool</h3><p>First, we create a class that manages our “too-big-for-memory” text. It provides tools the LLM can call</p><pre>package com.abhishek.rlm;<br>import dev.langchain4j.agent.tool.Tool;<br>public class RecursiveTextExplorer {<br>    private final String massiveContent;<br>    public RecursiveTextExplorer(String massiveContent) {<br>        this.massiveContent = massiveContent;<br>    }<br>    @Tool(&quot;Reads a specific segment of the document by character offset&quot;)<br>    public String readSegment(int start, int end) {<br>        int actualStart = Math.max(0, start);<br>        int actualEnd = Math.min(massiveContent.length(), end);<br>        return massiveContent.substring(actualStart, actualEnd);<br>    }<br>    @Tool(&quot;Returns the total length of the document&quot;)<br>    public int getDocumentLength() {<br>        return massiveContent.length();<br>    }<br>}</pre><h3>Step 2: The AI Service Interface</h3><p>This is the “Brain.” We tell the LLM that it is an explorer.</p><pre>package com.abhishek.rlm;<br>import dev.langchain4j.service.SystemMessage;<br>public interface RecursiveAssistant {<br>    @SystemMessage({<br>        &quot;You are an RLM (Recursive Language Model).&quot;,<br>        &quot;The document is too large to read at once. Use your tools to explore it.&quot;,<br>        &quot;1. Check the document length first.&quot;,<br>        &quot;2. Read specific segments to find your answer.&quot;,<br>        &quot;3. If you find a relevant section, summarize it and move to the next.&quot;<br>    })<br>    String analyze(String userQuery);<br>}</pre><h3>Step 3: Putting it Together</h3><p>Now, we wire it up using a model (like GPT-4o) that supports Tool Use.</p><pre>package com.abhishek.rlm;<br>import dev.langchain4j.model.openai.OpenAiChatModel;<br>import dev.langchain4j.service.AiServices;<br>public class RLMExample {<br>    public static void main(String[] args) {<br>        // 1. Our &quot;Massive&quot; Document (Simulated)<br>        String bigData = &quot;Chapter 1: The Beginning... [Imagine 1 million tokens here] ... Chapter 50: The End.&quot;;<br>        // 2. Setup the Model and Tools<br>        OpenAiChatModel model = OpenAiChatModel.builder()<br>                .apiKey(&quot;your-api-key&quot;)<br>                .modelName(&quot;gpt-4o&quot;)<br>                .build();<br>        RecursiveTextExplorer explorer = new RecursiveTextExplorer(bigData);<br>        // 3. Create the Service<br>        RecursiveAssistant assistant = AiServices.builder(RecursiveAssistant.class)<br>                .chatLanguageModel(model)<br>                .tools(explorer) // Connect the tools<br>                .build();<br>        // 4. Run!<br>        String result = assistant.analyze(&quot;What happens in Chapter 50?&quot;);<br>        System.out.println(&quot;AI Result: &quot; + result);<br>    }<br>}</pre><h3>Why this is the future of Enterprise AI</h3><ul><li><strong>Context Efficiency:</strong> You aren’t paying for 1 million tokens in every prompt. You only pay for the “peeks” the AI takes.</li><li><strong>Accuracy:</strong> The AI can “double-check” a fact by going back to the exact character offset where it saw a keyword.</li><li><strong>Complex Reasoning:</strong> Standard RAG might find the sentence “The project failed,” but an RLM can follow the “why” across multiple pages by programmatically traversing the text.</li></ul><h3>Final Thought</h3><p>While Python remains popular for AI experimentation, Java’s <strong>type safety</strong> and <strong>strong execution environment</strong> make it the perfect home for these “Agentic” workflows. By treating a prompt as an environment rather than an input, we unlock the next level of LLM scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa45daa6ef42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Postgres 18: Is an External Cache Still Required?]]></title>
            <link>https://abhishekraj0.medium.com/postgres-18-is-an-external-cache-still-required-cfbcc6b37296?source=rss-a15372163ccb------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfbcc6b37296</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Abhishek Raj]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 04:32:38 GMT</pubDate>
            <atom:updated>2026-02-18T04:32:38.340Z</atom:updated>
            <content:encoded><![CDATA[<p>With the release of <strong>PostgreSQL 18</strong>, the traditional “standard” of putting Redis or Memcached in front of your database is being challenged. This version introduces architectural shifts that significantly narrow the performance gap between a relational database and an in-memory cache.</p><h3>First, Think: Is caching still useful for your system?</h3><p>Before adding the complexity of a second data store, ask yourself:</p><ul><li><strong>Is your bottleneck I/O latency or CPU?</strong> Postgres 18’s new AIO (Asynchronous I/O) specifically targets storage latency.</li><li><strong>Do you need sub-millisecond responses for simple lookups?</strong> If yes, Redis is still king. If no, the 1–5ms responses of a tuned Postgres 18 might be enough.</li><li><strong>Is your data volatile?</strong> Postgres 18 handles frequent updates and vacuuming much more efficiently now.</li></ul><h3>Why Postgres 18 Changes the Game</h3><h4>1. Native Asynchronous I/O (AIO)</h4><p>The headline feature is a completely new AIO subsystem. Previously, Postgres was mostly synchronous — meaning a process would wait for the disk to respond before moving to the next task.</p><ul><li><strong>Performance Boost:</strong> Benchmarks show <strong>2–3x faster</strong> read throughput for sequential and bitmap scans.</li><li><strong>The “Worker” Method:</strong> By default, Postgres 18 uses background workers to handle I/O, allowing the main process to keep working while data is being fetched.</li><li><strong>Linux io_uring:</strong> For high-performance Linux environments, native io_uring support reduces kernel overhead even further.</li></ul><figure><img alt="PostgreSQL 18 Asynchronous I/O (AIO) architecture. The new AIO subsystem allows multiple background workers to handle I/O requests concurrently, freeing up the main process. This effectively creates a larger, non-blocking cache and significantly boosts read performance, reducing the need for external caches like Redis." src="https://cdn-images-1.medium.com/max/1024/1*RyCRIe6hOK9gl1QZIBOBmw.png" /></figure><h4>2. Index Skip Scans</h4><p>You no longer need to create dozens of redundant indexes (which bloat the cache) just to cover different column combinations.</p><ul><li><strong>Smarter Lookups:</strong> If you have an index on (region, category, date), Postgres 18 can now &quot;skip&quot; through the index even if your query doesn&#39;t specify the region.</li><li><strong>Cache Efficiency:</strong> Smaller index footprints mean more of your “hot” data stays in the shared_buffers RAM.</li></ul><h4>3. UUIDv7: The “Cache-Friendly” ID</h4><p>Postgres 18 now natively supports <strong>UUIDv7</strong>. Unlike the random UUIDv4, UUIDv7 is <strong>time-ordered</strong>.</p><ul><li><strong>Better Locality:</strong> New rows are written to the end of the index instead of random spots. This drastically reduces “page splits” and keeps your most recent (often most-read) data packed together in memory, making the internal cache much more effective.</li></ul><h4>4. Result Caching (Enterprise)</h4><p>While vanilla Postgres 18 focuses on I/O, versions like <strong>Postgres Pro Enterprise 18</strong> have introduced <strong>pgpro_result_cache</strong>, which caches the final output of “heavy” queries in RAM, invalidating them automatically if the source table changes.</p><h3>The Verdict: Simplify or Scale?</h3><pre>| Feature       | External Cache (Redis)                | PostgreSQL 18               |<br>|---------------|---------------------------------------|---------------------------- |<br>| Complexity    | High (2 systems, sync logic)          | Low (Single source of truth)|<br>| Latency       | &lt; 1ms                                 | 1–10ms (typical)            |<br>| Data Integrity| Manual synchronization                | ACID compliant              |<br>| I/O Throughput| N/A (RAM based)                       | High (AIO &amp; io_uring)       |</pre><p><strong>Conclusion:</strong> For most mid-tier applications, PostgreSQL 18 eliminates the “performance tax” that usually forced developers to reach for Redis. Unless you are operating at extreme scales where every microsecond determines success, <strong>simplifying your stack</strong> is now the smarter move.</p><h3>References</h3><ul><li><a href="https://gemini.google.com/app/4382bf6b597b4b34">PostgreSQL 18 Official Release Notes</a></li><li><a href="https://gemini.google.com/app/4382bf6b597b4b34">Benchmarking Postgres 17 vs 18 — PlanetScale</a></li><li><a href="https://gemini.google.com/app/4382bf6b597b4b34">Postgres 18: A Comprehensive Guide for DBAs — Medium</a></li><li><a href="https://gemini.google.com/app/4382bf6b597b4b34">Asynchronous I/O in PostgreSQL 18 — pgEdge</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfbcc6b37296" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>