<?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 Youssef Hany on Medium]]></title>
        <description><![CDATA[Stories by Youssef Hany on Medium]]></description>
        <link>https://medium.com/@youssefhanyy?source=rss-39b140c5426d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QeWygzGLp9l2daJ_</url>
            <title>Stories by Youssef Hany on Medium</title>
            <link>https://medium.com/@youssefhanyy?source=rss-39b140c5426d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:04:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@youssefhanyy/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[Intelligent Message Summarisation]]></title>
            <link>https://medium.com/ixo-blog/intelligent-message-summarisation-7fbea7b94f8d?source=rss-39b140c5426d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fbea7b94f8d</guid>
            <category><![CDATA[reliable-summarisation]]></category>
            <category><![CDATA[scalable-efficiency]]></category>
            <category><![CDATA[ai-memory-graphs]]></category>
            <category><![CDATA[context-injection]]></category>
            <category><![CDATA[rolling-window-logic]]></category>
            <dc:creator><![CDATA[Youssef Hany]]></dc:creator>
            <pubDate>Thu, 23 Oct 2025 13:22:40 GMT</pubDate>
            <atom:updated>2025-10-23T13:22:40.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*menkjs0zrwLXSlQoXf6jUA.png" /></figure><h4>A Rolling Window Approach for AI Memory Systems</h4><h4>The Challenge</h4><p>When building AI systems that need to remember conversations, we face a critical problem:</p><blockquote><strong>How do you process hundreds or thousands of messages without losing important context?</strong></blockquote><p>Traditional approaches either summarise everything <strong>at once</strong> (losing nuance) or process messages <strong>individually </strong>(losing context). We needed something better for our memory graph system.</p><h4>Our Solution: Rolling Window Summarisation with Context Injection</h4><p>At <a href="https://www.ixo.world/">IXO</a>, we’ve developed a message summarisation system that combines the best of both worlds — efficient processing with perfect context preservation. Here’s how it works.</p><h4>The Big Picture</h4><p>Think of reading a book chapter by chapter, but always remembering what happened before. That’s exactly what our <strong>rolling window approach</strong> does:</p><ol><li><strong>Split messages into digestible chunks</strong> (windows of 10 messages)</li><li><strong>Summarise each window</strong> while keeping the previous summary as context</li><li><strong>Chain the summaries together</strong> so nothing gets lost</li><li><strong>Output compressed, information-rich messages</strong> ready for memory graph construction</li></ol><h4>How It Works: Step by Step</h4><p><strong>Step 1: Window Creation</strong></p><p>When you receive 50 messages, instead of processing them all at once, we split them into windows:</p><ul><li>Window 1: Messages 1–10</li><li>Window 2: Messages 11–20</li><li>Window 3: Messages 21–30</li><li>And so on…</li></ul><p><strong>Step 2: Context Injection (The Secret Sauce)</strong></p><p>Here’s where it gets interesting. When processing Window 2, we don’t just look at messages 11–20. We prepend Window 1’s summary:</p><pre>[Window 1 Summary (4 msgs)] + [Messages 11-20 (10 msgs)] → Summarize → [Window 2 Summary (4 msgs)]</pre><p>This creates a <strong>context chain</strong> that flows through your entire conversation.</p><blockquote>No information gets lost between windows.</blockquote><p><strong>Step 3: AI-Powered Compression</strong></p><p>For each window, we use a carefully crafted LLM prompt that focuses on:</p><p>✅ <strong>Information Preservation</strong> — Capture ALL key facts, decisions, and answers</p><p>✅ <strong>Entity Extraction</strong> — Keep specific names, numbers, dates, technical terms</p><p>✅ <strong>Context Continuity</strong> — Maintain the conversation flow</p><p>✅ <strong>Role Attribution</strong> — Preserve who said what</p><p>✅ <strong>Temporal Flow</strong> — Keep events in logical sequence</p><p><strong>Step 4: Structured Output</strong></p><p>The LLM returns structured JSON that matches our Message schema exactly:</p><pre>{<br>  &quot;messages&quot;: [<br>    {<br>      &quot;content&quot;: &quot;Dense, information-rich summary...&quot;,<br>      &quot;role_type&quot;: &quot;user&quot;,<br>      &quot;role&quot;: &quot;Alice&quot;,<br>      &quot;timestamp&quot;: &quot;2024-10-07T10:30:00Z&quot;,<br>      &quot;name&quot;: &quot;conversation_summary_window_1&quot;<br>    },<br>    ...<br>  ]<br>}</pre><h4>The Results</h4><p><strong>Default Configuration</strong>: 10 messages per window → 4 summary messages</p><p><strong>Context Retention</strong>: 100% (nothing lost between windows)</p><p><strong>Processing Speed</strong>: Async LLM calls with 10,000 token limit per window</p><p><strong>Error Resilience</strong>: Graceful fallbacks if summarisation fails</p><h4>Why This Matters for Memory Graphs</h4><p>Our memory graph system extracts entities and relationships from conversations. This summarisation approach is perfect because it:</p><ol><li><strong>Preserves Entity Information</strong> — Names, places, projects stay intact</li><li><strong>Maintains Relationships</strong> — “Alice works with Bob on Project X” connections survive</li><li><strong>Keeps Temporal Context</strong> — When things happened matters for the graph</li><li><strong>Reduces Processing Load</strong> — Fewer messages = faster graph construction</li><li><strong>Enables Scale</strong> — Handle massive conversation histories efficiently</li></ol><h4>Smart Features Under the Hood</h4><p><strong>Adaptive Prompting</strong></p><p>The system knows when it’s processing the last window and adjusts its prompt:</p><ul><li>Intermediate windows: “Maintain context for next window (Window N)”</li><li>Final window: “This is the FINAL summary — ensure complete standalone context”</li></ul><p><strong>Multi-Speaker Awareness</strong></p><p>Automatically detects conversation patterns:</p><ul><li>Single speaker: “Maintain single speaker context”</li><li>Multiple speakers: “Preserve distinct speaker perspectives (user vs assistant)”</li></ul><p><strong>Configurable Thresholds</strong></p><pre>await summarizer.summarize_messages_rolling(<br>    messages=messages,<br>    window_size=10,      # Messages per window (default: 10)<br>    summary_size=4,      # Target summaries per window (default: 4)<br>    threshold=10         # Min messages to trigger (default: 10)<br>)</pre><p>Skip summarisation for short conversations (below threshold), customise compression for your use case.</p><h4>Error Handling That Just Works</h4><p>Software fails. Networks hiccup. LLMs occasionally return weird responses. We handle it:</p><ul><li>✅ Comprehensive logging at debug, info, warning, and error levels</li><li>✅ Fallback to original messages if any window summarisation fails</li><li>✅ Graceful degradation per window (one failure doesn’t break everything)</li><li>✅ Timestamp parsing with ISO 8601 format validation</li></ul><h4>Real-World Example</h4><p><strong>Input</strong>: 50 messages from a project discussion</p><p><strong>Process</strong>:</p><ul><li>Window 1: 10 messages → 4 summaries</li><li>Window 2: 4 (previous) + 10 (new) = 14 messages → 4 summaries</li><li>Window 3: 4 (previous) + 10 (new) = 14 messages → 4 summaries</li><li>Window 4: 4 (previous) + 10 (new) = 14 messages → 4 summaries</li><li>Window 5: 4 (previous) + 10 (new) = 14 messages → 4 summaries</li></ul><p><strong>Output</strong>: 20 summary messages (all window summaries combined)</p><p><strong>Context Preserved</strong>: Complete project context, all decisions, all participants</p><h4>What could be added?</h4><ul><li><strong>Dynamic window sizing</strong> based on conversation complexity</li><li><strong>Semantic chunking</strong> instead of fixed-size windows</li><li><strong>Multi-modal support</strong> for images and code snippets</li><li><strong>Custom summarisation strategies</strong> per use case (technical docs vs casual chat)</li></ul><h4>Conclusion</h4><p>Building AI systems that remember requires more than just storing messages — it requires <strong>intelligent compression</strong> that preserves what matters. Our rolling window approach with context injection solves this elegantly, enabling memory graphs that scale while maintaining perfect context.</p><p><strong>The result?</strong> AI systems that truly understand and remember conversations, no matter how long they get.</p><h3>Connect with IXO World</h3><p><a href="https://linktr.ee/ixo_world">Spatial Web Platform | Twitter, Instagram | Linktree</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fbea7b94f8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ixo-blog/intelligent-message-summarisation-7fbea7b94f8d">Intelligent Message Summarisation</a> was originally published in <a href="https://medium.com/ixo-blog">IXO World Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>