<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://thakicloud.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://thakicloud.github.io/" rel="alternate" type="text/html" /><updated>2026-07-11T21:06:12+09:00</updated><id>https://thakicloud.github.io/feed.xml</id><title type="html">Thaki Cloud Tech Blog | ThakiCloud | 다키클라우드 기술 블로그</title><subtitle>Thaki Cloud (ThakiCloud, 다키클라우드, thaki cloud, THAKI CLOUD, ثاكي كلاود)는 AI/ML Engineering, LLMOps, DevOps 분야의 최신 기술과 실무 경험을 공유하는 전문 기술 블로그입니다. 머신러닝 모델 운영, 쿠버네티스, 클라우드 인프라, AI 엔지니어링 커리어, 인공지능 기술 블로그, 다키클라우드 개발 팀의 깊이 있는 인사이트를 제공합니다. مدونة تقنية متخصصة في هندسة الذكاء الاصطناعي والحوسبة السحابية.</subtitle><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><entry xml:lang="ar"><title type="html">fable-advisor: سير عمل متعدد الموردين يقوده Fable 5 وينفذه Grok 4.5</title><link href="https://thakicloud.github.io/ar/agentops/fable-advisor-multi-model-orchestration/" rel="alternate" type="text/html" title="fable-advisor: سير عمل متعدد الموردين يقوده Fable 5 وينفذه Grok 4.5" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/agentops/fable-advisor-multi-model-orchestration</id><content type="html" xml:base="https://thakicloud.github.io/ar/agentops/fable-advisor-multi-model-orchestration/"><![CDATA[<p>عند استخدام وكلاء البرمجة، يطرأ سؤال طبيعي على الذهن. كتابة المواصفات بدقة ومراجعة الفروقات (diff) الناتجة بعين ثاقبة عمل يختلف في طبيعته عن كتابة الشيفرة سطراً سطراً، فلماذا إذن يتوجب على نموذج واحد أن يقوم بالمهمتين معاً؟ إضافة <code class="language-plaintext highlighter-rouge">fable-advisor</code> التي طُرحت مؤخراً وأثارت اهتماماً واسعاً تجيب على هذا السؤال مباشرة. إنها سير عمل متعدد الموردين حيث <strong>يقتصر دور Claude Fable 5 على القيادة، بينما يتولى Grok 4.5 وحده التنفيذ الفعلي</strong>. يحلل هذا المقال تلك البنية، ويتحقق مما تعنيه هذه الهندسة من منظور تشغيل ThakiCloud الذي يتعامل مع الوكلاء المتعددين وتوجيه النماذج كمورد أساسي من الدرجة الأولى.</p>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>حتى الآن، كانت سير عمل البرمجة متعددة الوكلاء تجري غالباً ضمن مورد واحد فقط. ففي Claude Code مثلاً، يقود Opus العمل بينما تعمل Sonnet أو Haiku كوكلاء فرعيين. والنقطة اللافتة في <code class="language-plaintext highlighter-rouge">fable-advisor</code> هي أنها تبني هذا التقسيم <strong>عبر حدود الموردين</strong>. حيث يتولى Fable 5 من Anthropic طبقة التنسيق، بينما يتولى Grok 4.5 من xAI طبقة التنفيذ.</p>

<p>الرؤية الجوهرية لهذا التصميم واضحة. القيادة والتنفيذ يتطلبان قدرات مختلفة، وبنية تكلفة مختلفة أيضاً. كتابة المواصفات ومراجعة الفروقات تقع في مجال الحكم والاستدلال، مما يستلزم نموذجاً مناسباً للقيادة، بينما تتطلب كتابة كميات كبيرة من الشيفرة كفاءة في الإنتاجية والتكلفة. تضع <code class="language-plaintext highlighter-rouge">fable-advisor</code> كلاً من هاتين المهمتين على نماذج من موردين مختلفين، بحيث يُستخدم في كل طبقة النموذج الأنسب لها. كونها مفتوحة المصدر ومجانية، وإمكانية تخصيص منطق التوجيه مباشرة، يخفّض أيضاً عتبة التبني في الاستخدام الفعلي.</p>

<h2 id="ما-هذه-التقنية">ما هذه التقنية</h2>

<p><code class="language-plaintext highlighter-rouge">fable-advisor</code> هي إضافة تُركَّب فوق Claude Code، وتفرض فصلاً بين ثلاثة أدوار.</p>

<p>أولاً، <strong>الموجّه (Fable 5)</strong> يكتب المواصفات ويراجع النتائج. يستقبل طلب المستخدم ويحلله إلى مواصفات تنفيذ، ثم يراجع الفروقات (diff) بعد اكتمال التنفيذ. والمهم هنا أن الموجّه <strong>لا يكتب الشيفرة مباشرة</strong>، بل يركز على الحكم وتعريف العقود.</p>

<p>ثانياً، <strong>المُنفِّذ (Grok 4.5)</strong> يتولى الكتابة الفعلية وحده. يستقبل المواصفات التي يسلّمها الموجّه، ويكتب Grok 4.5 الشيفرة عبر Grok CLI. وإذا تفحصنا تاريخ المستودع، نجد أنه اعتباراً من الإصدار v3 تم استبدال وكلاء التنفيذ السابقين المعتمدين على Sonnet/Opus بـ <code class="language-plaintext highlighter-rouge">grok-implementer</code>، ليصبح Grok 4.5 مسار الكتابة الافتراضي. بعبارة أخرى، لم تكن هذه الإضافة متعددة الموردين منذ البداية، بل هي نتاج تطور تدريجي نحو نقل مسار التنفيذ إلى نموذج منخفض التكلفة وعالي الإنتاجية.</p>

<p>ثالثاً، <strong>التنفيذ المتوازي</strong>. تُنفَّذ المواصفات المستقلة عن بعضها البعض في آن واحد عبر وكلاء متوازيين. فعندما يقسّم الموجّه المهمة إلى وحدات لا تعتمد على بعضها، تمضي كل وحدة قدماً في وقت واحد عبر وكيل تنفيذ منفصل. وهذا ليس مجرد تفويض تسلسلي بسيط، بل أقرب إلى تقسيم عمل على شكل DAG (رسم بياني موجّه غير دوري).</p>

<p>إذا نظرنا إلى سير العمل الكامل بشكل تخطيطي، يكون كما يلي.</p>

<pre><code class="language-mermaid">flowchart TB
    U[طلب المستخدم] --&gt; F[موجّه Fable 5&lt;br/&gt;كتابة المواصفات ومراجعة diff]
    F --&gt;|تحليل مواصفات مستقلة| S1[مواصفة A]
    F --&gt;|تحليل مواصفات مستقلة| S2[مواصفة B]
    S1 -.Grok CLI.-&gt; G1[منفّذ Grok 4.5 A]
    S2 -.Grok CLI.-&gt; G2[منفّذ Grok 4.5 B]
    G1 --&gt;|diff| F
    G2 --&gt;|diff| F
    F --&gt; R[نتيجة الدمج والمراجعة]
</code></pre>

<h2 id="التثبيت-والتكامل">التثبيت والتكامل</h2>

<p>تثبيت الإضافة يتم بسطر واحد فقط. يكفي إضافة المستودع إلى سوق إضافات Claude Code.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>claude plugin marketplace add DannyMac180/fable-advisor
</code></pre></div></div>

<p>يتطلب Grok CLI، المسؤول عن مسار التنفيذ، مصادقة منفصلة. فعند تسجيل الدخول عبر <code class="language-plaintext highlighter-rouge">grok login</code>، يعمل النظام بمصادقة OAuth قائمة على اشتراك SuperGrok أو X Premium+، وبحسب وصف المستودع، يتيح هذا المسار تشغيل وكيل التنفيذ <strong>بالاشتراك فقط ودون رسوم API لكل رمز (token)</strong>. وهذه النقطة هي جوهر بنية التكلفة. فالموجّه يقوم بعدد قليل فقط من الاستدعاءات التي تتطلب حكماً، بينما تُعالَج الكمية الكبيرة من كتابة الشيفرة ضمن خطة الاشتراك، مما يقلّل إلى أدنى حد الجزء الخاضع للرسوم حسب الاستخدام.</p>

<p>من زاوية التكامل، الجانب الجدير بالملاحظة هو أن منطق التوجيه مفتوح. إذ يمكن للمستخدم أن يضبط بنفسه أي مهمة تُرسَل إلى أي نموذج، وفي أي شروط يتم التوازي، مما يتيح إعادة تشكيل المسارات بما يتناسب مع ميزانية الفريق ومتطلبات الجودة.</p>

<h2 id="كيف-يعمل-هذا-التصميم-فعلياً">كيف يعمل هذا التصميم فعلياً</h2>

<p>بما أن <code class="language-plaintext highlighter-rouge">fable-advisor</code> ليست أداة تعتمد على أرقام قياسية (بنشمارك)، بل نمط سير عمل، فسنتناول هنا الأثر البنيوي الذي يُحدثه هذا التصميم بدلاً من أرقام أداء قابلة للتكرار. وبما أن المستودع لا يقدّم مؤشرات كمية، فإن هذا المقال أيضاً لن يختلق أرقاماً، بل سيتناول المزايا البنيوية فقط.</p>

<p>أكبر أثر هو <strong>الفصل بين التكلفة والجودة</strong>. فعندما يُوكَل التنسيق الذي يتطلب حكماً إلى الموجّه، ويُوكَل التنفيذ الذي يتطلب إنتاجية عالية إلى منفّذ منخفض التكلفة، ينخفض السعر الإجمالي لسير العمل مع بقاء جودة الحكم كما هي. وهكذا يتشكّل بشكل طبيعي توزيع مفاده “لا يُستدعى الموجّه كثيراً لكنه غالي الثمن، بينما يُستدعى المنفّذ كثيراً دون أن يكون مكلفاً”.</p>

<p>الأثر الثاني هو <strong>التحقق المتقاطع</strong>. كون المنفّذ والمراجِع نموذجين من موردين مختلفين يُنتج أثراً جانبياً مثيراً للاهتمام. فعندما يراجع النموذج نفسه شيفرته الخاصة، يسهل عليه إغفال نفس الأخطاء، أما عندما يراجع نموذج من سلالة مختلفة الفروقات (diff)، تزداد فرصة اكتشاف النقاط العمياء لدى كل منهما. وبذلك يصبح الفصل بين الموجّه والعامل أكثر من مجرد تقسيم عمل بسيط، بل نوعاً من آلية التحقق المتبادل.</p>

<p>الأثر الثالث هو <strong>تقليص زمن الاستجابة بفضل التوازي</strong>. فعند تنفيذ المواصفات المستقلة في آن واحد، لا يكون إجمالي وقت العمل مجموعاً تسلسلياً، بل يتقارب مع أطول سلسلة مفردة. وكلما أحسن الموجّه تحليل المهمة إلى وحدات، ازدادت هذه الميزة.</p>

<h2 id="تعميم-نمط-الموجّه-والعامل">تعميم نمط الموجّه والعامل</h2>

<p>إذا نظرنا إلى <code class="language-plaintext highlighter-rouge">fable-advisor</code> ليس كإضافة منفردة بل كنمط تصميم، يتضح سياق أوسع. جوهر هذا النمط هو “الجلسة الرئيسية تقود فقط، والمهام الثقيلة تُفوَّض”. وكون العمل عابراً للموردين ليس سوى صورة واحدة من صور هذا النمط، إذ يصح فعلياً حتى داخل مورد واحد. فمثلاً في Claude Code، يُستخدم على نطاق واسع بالفعل تكوين يجعل Fable 5 موجّهاً، بينما يُوكَل الاستكشاف إلى Haiku، والتنفيذ إلى Sonnet، والاستدلال المعقد إلى وكلاء فرعيين من Opus. وما فعلته <code class="language-plaintext highlighter-rouge">fable-advisor</code> هو توسيع نطاق النماذج المستهدفة بهذا التفويض إلى ما وراء حدود المورد الواحد.</p>

<p>من هذا المنظور، تصبح معايير اختيار نموذج الموجّه أكثر وضوحاً. فالموجّه مسؤول عن الحكم والتفرّع والتجميع، لذا فإن الدقة وجودة الاستدلال مهمتان، بينما يكون تكرار الاستدعاء منخفضاً نسبياً. في المقابل، يهتم المنفّذ بالإنتاجية والسعر. لذا فإن التنسيق الجيد ليس “وضع النموذج الأغلى كموجّه ومعالجة كل شيء به”، بل “تخصيص نموذج بالخصائص التي تتطلبها كل طبقة لتلك الطبقة تحديداً”. وتطور الإصدار v3 الذي نقل فيه <code class="language-plaintext highlighter-rouge">fable-advisor</code> مسار التنفيذ إلى نموذج اشتراك منخفض التكلفة هو نتيجة مطابقة تماماً لهذا المبدأ.</p>

<p>نقطة واحدة يجب الانتباه إليها هي أن هذا النمط لا يكون فعالاً إلا إذا كانت حدود التفويض واضحة. فإذا سلّم الموجّه مواصفات غامضة، يضطر المنفّذ إلى ملء الفجوات بالتخمين، وتزداد نتيجة لذلك عبء المراجعة. لا تتحقق فائدة التفويض إلا عندما تكون المواصفات محددة بما فيه الكفاية. وهذا لا يختلف عن تقسيم العمل في المنظمات البشرية، فكلما كانت المواصفات أوضح، عمل التفويض بشكل أفضل.</p>

<h2 id="دلالات-التطبيق-على-منتجات-thakicloud">دلالات التطبيق على منتجات ThakiCloud</h2>

<p>يتقاطع هذا التصميم بشكل لافت مع الطريقة التي تُشغّل بها ThakiCloud وكلاءها.</p>

<p>من منظور <strong>Paxis</strong>، يكون الارتباط الأوثق مباشرةً. فـ Paxis هو مستوى التحكم الخاص بـ ThakiCloud للسحابة القائمة على الوكلاء (Agent-Native Cloud)، ويتعامل مع تنفيذ الوكلاء المتعددين على شكل DAG كقدرة أساسية. البنية التي تُظهرها <code class="language-plaintext highlighter-rouge">fable-advisor</code> — “كتابة المواصفات ← تنفيذ موزّع ← مراجعة متقاطعة” — تحمل نفس الهيكل الذي يعتمده حزام أدوات المهارات (skill harness) في Paxis، حيث يُحلَّل العمل إلى مهام فرعية، وتُنفَّذ بشكل متوازٍ داخل صناديق رملية معزولة، ثم تُغلَق عبر مرحلة تحقق. وعلى وجه الخصوص، فإن المبدأ القائل بأن الموجّه لا يكتب الشيفرة مباشرة بل يركّز على الحكم وتعريف العقود، يتطابق تماماً مع فلسفة التصميم لدينا التي تستمد القدرة من بنية العقد المحيطة لا من درجة النموذج. كما أن التدفق الذي يُعيد فيه الموجّه مراجعة نتائج نماذج مختلفة، يتقاطع أيضاً مع مبدأنا التشغيلي القاضي بإغلاق توسّع الوكلاء المتعددين (fan-out) عبر مرحلة تحقق لمنع تراكم الهلوسة.</p>

<p>من منظور <strong>ai-platform</strong>، تكون زاوية بنية التكلفة سارية المفعول. فمنصة ai-platform الخاصة بـ ThakiCloud تجدول أحمال عمل وحدات معالجة الرسوميات (GPU) اعتماداً على K8s وKueue، وتخدم أحمال الاستدلال والتدريب لدى العملاء. الفكرة التي تعتمدها <code class="language-plaintext highlighter-rouge">fable-advisor</code> بتفويض مسار التنفيذ إلى نموذج منخفض التكلفة لخفض السعر الإجمالي لسير العمل، هي نمط يمكن لعملاء السحابة القائمة على GPU تطبيقه مباشرة عند تصميم أحمال عملهم. فعندما تُوضَع مراحل الحكم القليلة التي تتطلب استدلالاً ثقيلاً، ومراحل التنفيذ الكثيرة التي تتطلب إنتاجية عالية، على موارد من فئات مختلفة، يمكن الحصول على النتيجة نفسها بتكلفة أقل. وبما أن الخدمة منخفضة التكلفة هي ما يصنع جدوى الوكلاء الاقتصادية، فإن كفاءة تكلفة ai-platform وتنسيق وكلاء Paxis يكمّلان بعضهما البعض.</p>

<h2 id="القيود-والاعتراضات">القيود والاعتراضات</h2>

<p>لهذا التصميم أيضاً ثمن واضح يجب دفعه. أولاً، <strong>تعقيد التشغيل</strong>. فربط نموذجين من موردين مختلفين في سير عمل واحد يعني إدارة نظامي مصادقة، وخطتي تسعير، ونقطتي فشل محتملتين. فإذا تغيّرت واجهة سطر الأوامر لأحد الموردين أو انتهت صلاحية المصادقة، قد يتوقف سير العمل بأكمله. وبما أن هذا يعني التخلي عن بساطة سير العمل أحادي المورد مقابل هذه الميزة، فإن كل فريق قد يقيّم بشكل مختلف ما إذا كانت الميزة تبرر هذا التعقيد.</p>

<p>ثانياً، <strong>مخاطر تفويض الجودة</strong>. إسناد التنفيذ إلى نموذج منخفض التكلفة يعني أنه إذا لم تكن مواصفات ومراجعات الموجّه دقيقة بما فيه الكفاية، فقد يمر تنفيذ منخفض الجودة دون رصد. وجودة سير العمل هذا تعتمد في نهاية المطاف على مدى صرامة بوابة المراجعة لدى الموجّه. فإذا كانت المراجعة شكلية، يختفي أثر التحقق المتقاطع الناتج عن تقسيم العمل بين الموردين، ويتحول الأمر إلى خط أنابيب منخفض الجودة لا يوفر سوى التكلفة.</p>

<p>ثالثاً، <strong>قيود المصادقة القائمة على الاشتراك</strong>. كون Grok CLI يعمل بمصادقة OAuth قائمة على الاشتراك يمثّل ميزة من حيث التكلفة للأفراد أو الفرق الصغيرة، لكن في الأتمتة واسعة النطاق أو خطوط الأنابيب غير المأهولة، قد تصبح حدود الاشتراك وتجديد المصادقة عنق زجاجة. وميزة عدم وجود رسوم حسب الاستخدام تعني، إذا نظرنا إليها من الجانب الآخر، أن التوسع يُغلَق بمجرد تجاوز الاستخدام للحد المسموح.</p>

<p>ومع ذلك، فإن الرسالة التي تطرحها <code class="language-plaintext highlighter-rouge">fable-advisor</code> واضحة. مستقبل وكلاء البرمجة لا يكمن في نموذج واحد شامل، بل في تنسيق يجمع بين النماذج الأنسب لكل طبقة. وهذا يشير بالضبط إلى نفس الوجهة التي تسلكها ThakiCloud في تعاملها مع الوكلاء المتعددين وتوجيه النماذج كمورد أساسي من الدرجة الأولى.</p>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li><a href="https://github.com/DannyMac180/fable-advisor">fable-advisor (GitHub)</a></li>
  <li><a href="https://x.ai/cli">Grok CLI (x.ai/cli)</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="agentops" /><category term="claude-code" /><category term="multi-agent" /><category term="model-routing" /><category term="fable" /><category term="grok" /><category term="agentops" /><category term="paxis" /><summary type="html"><![CDATA[نحلل بنية الفصل بين الموجّه والعامل في إضافة fable-advisor، حيث يقود Claude Fable 5 كتابة المواصفات ومراجعة الفروقات (diff)، بينما يتولى Grok 4.5 وحده كتابة الشيفرة الفعلية، ونتحقق منها من منظور ThakiCloud الذي يتعامل مع الوكلاء المتعددين كمورد أساسي من الدرجة الأولى.]]></summary></entry><entry xml:lang="ar"><title type="html">عامل برمجي يتذكّر عبر المجلدات بلا قاعدة بيانات متجهية: تحليل personal-monorepo-template</title><link href="https://thakicloud.github.io/ar/agentops/personal-monorepo-template-agent-memory/" rel="alternate" type="text/html" title="عامل برمجي يتذكّر عبر المجلدات بلا قاعدة بيانات متجهية: تحليل personal-monorepo-template" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/agentops/personal-monorepo-template-agent-memory</id><content type="html" xml:base="https://thakicloud.github.io/ar/agentops/personal-monorepo-template-agent-memory/"><![CDATA[<p>عند استخدام عامل البرمجة يوميًا، يصطدم المرء مرارًا بحائط واحد. القرارات التي اتُّخذت أمس، الأعراف التي حُدّدت الأسبوع الماضي، أسلوب عمل زميل معيّن، كل هذا يعيد العامل سؤاله عنه في كل جلسة وكأنه يسمعه للمرة الأولى. ظهر مؤخرًا مستودع يحل هذه المشكلة دون قاعدة بيانات متجهية باهظة أو بنية تحتية منفصلة للذاكرة، بل عبر <strong>بنية مجلدات عادية وملف ماركداون واحد فقط</strong>، وأثار ضجة بين المطورين. إنه <code class="language-plaintext highlighter-rouge">personal-monorepo-template</code> الذي كشف عنه jxnl (جيسون ليو)، صانع مكتبة <code class="language-plaintext highlighter-rouge">Instructor</code>. يفكك هذا المقال تلك البنية، ويتحقق من دلالات هذا التصميم من منظور تشغيل ThakiCloud الذي يتعامل مع المهارات والمعرفة كموارد من الدرجة الأولى.</p>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>النهج الشائع لمعالجة مشكلة ذاكرة العامل هو قاعدة البيانات المتجهية. تُحوَّل المحادثات والمستندات إلى متجهات تضمين (embeddings) وتُخزَّن، ثم تُستدعى عند الحاجة عبر بحث دلالي. هذا النهج قوي لكن عبء تشغيله كبير. يجب إدارة خط أنابيب التضمين، والفهرس المتجهي، وجدولة إعادة الفهرسة، وهي بنية تحتية مفرطة بالنسبة لفرد يريد إضافتها إلى سير عمله الخاص.</p>

<p>يسلك <code class="language-plaintext highlighter-rouge">personal-monorepo-template</code> اتجاهًا معاكسًا تمامًا. يعيد تعريف الذاكرة لا كمشكلة بحث، بل <strong>كمشكلة بنية ملفات</strong>. يوضع الأشخاص في مجلد <code class="language-plaintext highlighter-rouge">people/</code>، والمشاريع كحزم مشاريع، وأنماط العمل المتكررة كمهارات داخل المستودع نفسه. ويحمّل العامل هذه البنية باستمرار عبر <code class="language-plaintext highlighter-rouge">AGENTS.md</code> في بداية كل جلسة. فبدلًا من التطابق التقريبي للبحث المتجهي، يصل العامل إلى الذاكرة عبر عنوان دقيق هو مسار المجلد.</p>

<p>خلفية صاحب المشروع تضفي ثقلًا على هذا التصميم. jxnl هو صانع مكتبة الإخراج المهيكل (structured output) المسماة <code class="language-plaintext highlighter-rouge">Instructor</code>، والتي تُحمَّل ملايين المرات شهريًا، ويُقال إن OpenAI استشهدت بها كمصدر إلهام لميزة الإخراج المهيكل الخاصة بها. وهو حاليًا مهندس تجربة المطوّرين (Developer Experience) في فريق OpenAI Codex، ما يجعل قيمة هذا المرجع كبيرة كونه أداة صنعها شخص يشغّل عوامل البرمجة يوميًا في الميدان لحل مشكلته الخاصة.</p>

<h2 id="ما-هذه-التقنية">ما هذه التقنية</h2>

<p>الفكرة الجوهرية واحدة. <strong>تمثيل ذاكرة العامل عبر مجلدات وماركداون عادية داخل مستودع أحادي (monorepo)، وتحميلها تلقائيًا في كل جلسة.</strong> يمكن تقسيمها إلى ثلاثة محاور.</p>

<p>المحور الأول هو <strong>سجلات الأشخاص والمشاريع</strong>. يفحص المستودع سلاك والبريد الإلكتروني والتقويم وGitHub لإنشاء ملفات <code class="language-plaintext highlighter-rouge">people</code> وحزم المشاريع، ويقترح تحديثات على <code class="language-plaintext highlighter-rouge">AGENTS.md</code> المحمَّل باستمرار. عند ذكر اسم زميل معيّن، يقرأ العامل ملف ذلك الشخص لاستعادة السياق فورًا. دون قاعدة بيانات متجهية، يجد العامل “من هو هذا الشخص” عبر مسار مجلد دقيق.</p>

<p>المحور الثاني هو <strong>المهارات المحلية داخل المستودع</strong>. حين توضع أنماط العمل المتكررة كمهارات داخل المستودع، تُحمَّل تلقائيًا في كل جلسة ويتبعها العامل. من أبرز الأمثلة مهارة write-like-me المدمجة، التي تتعلم من رسائل البريد الإلكتروني ورسائل سلاك المُرسَلة سابقًا لتكتب بأسلوب المستخدم نفسه. بنية يصبح فيها الإنتاج السابق للمستخدم بيانات تدريب للمهارة نفسها.</p>

<p>المحور الثالث هو <strong>التسجيل التلقائي (check-in)</strong>. صُمم المستودع لتشغيل تسجيل تلقائي في التاسعة صباحًا والرابعة مساءً يوميًا، حيث يلخّص حالة المشاريع والسياق المتعلق بالأشخاص لذلك اليوم ويقترح التحديثات. هذه حلقة يحدّث فيها العامل ذاكرته من تلقاء نفسه في أوقات محددة، بدلًا من انتظار استدعاء يدوي.</p>

<p>يوضّح المخطط التالي التدفق الكامل.</p>

<pre><code class="language-mermaid">flowchart TB
    SRC[سلاك · البريد الإلكتروني · التقويم · GitHub] --&gt;|فحص| SCAN[نص برمجي للتسجيل التلقائي]
    SCAN --&gt; PEOPLE[اقتراح ملف people]
    SCAN --&gt; PKT[اقتراح حزمة مشروع]
    SCAN --&gt; AGD[اقتراح تحديث AGENTS.md]
    AGD -.تحميل مستمر عند بدء الجلسة.-&gt; AGENT[العامل البرمجي]
    PEOPLE -.استعلام عبر مسار المجلد.-&gt; AGENT
    SKILL[مهارات محلية داخل المستودع&lt;br/&gt;بما فيها write-like-me] -.تحميل تلقائي.-&gt; AGENT
    CRON[تسجيل تلقائي يوميًا الساعة 09:00 و16:00] --&gt; SCAN
</code></pre>

<p>سبب أهمية هذا التصميم أنه يتقاطع تمامًا مع فلسفة “Codex-maxxing” التي شرحها صاحب المستودع نفسه في مقال منفصل. الاتجاه هنا ليس إلحاق نموذج أفضل بالعامل، بل <strong>بناء بنية محيطة سميكة</strong> حتى لا يبدأ العامل من صفحة بيضاء في كل مرة.</p>

<h2 id="التثبيت-والتكامل">التثبيت والتكامل</h2>

<p>هذا المستودع قالب (template) كما يوحي اسمه. يُدمج بنسخه إلى حساب GitHub الخاص بالمستخدم، ثم بضبط عامل البرمجة (Codex أو واجهة سطر أوامر مشابهة) ليتخذ جذر المستودع دليل عمل له. نقطة الدخول الأساسية هي ملف <code class="language-plaintext highlighter-rouge">AGENTS.md</code> في جذر المستودع، حيث يقرأه العامل عند بدء الجلسة ليتعرف على بنية المجلدات، وسياق الأشخاص والمشاريع، وقائمة المهارات الواجب تحميلها.</p>

<p>نقطة التكامل المهمة هنا أن <code class="language-plaintext highlighter-rouge">AGENTS.md</code> ليس <strong>مجرد مستند، بل عقد يُحمَّل باستمرار</strong>. بما أن هذا الملف يوضع في مقدمة السياق في كل جلسة، فإن ما يُكتب فيه يحدد مباشرة السلوك الافتراضي للعامل. ولأن بنية المجلدات ثابتة، يصل العامل إلى الذاكرة بطريقة حتمية على شاكلة “إذا احتجت سياق الزميل A، فاقرأ <code class="language-plaintext highlighter-rouge">people/A.md</code>”. وبخلاف التقريب الاحتمالي للبحث المتجهي، يشير مسار الملف دائمًا إلى المكان نفسه.</p>

<p>يُدمج التسجيل التلقائي عبر ربط نص برمجي للتسجيل بجدولة (من نوع cron) ليعمل في وقت محدد يوميًا. هذا الجزء آلية تُبقي الذاكرة محدَّثة دون حاجة إلى استدعاء بشري في كل مرة، وهو أيضًا قرار تصميمي مهم من زاوية التكلفة. فبدلًا من الاستطلاع المستمر، هناك تنفيذان محدودان يوميًا فقط، فلا يُستهلك عدد رموز (tokens) هائل في حلقة لا نهائية.</p>

<h2 id="كيف-يعمل-هذا-التصميم-فعليًا">كيف يعمل هذا التصميم فعليًا</h2>

<p>هذا المستودع ليس أداة تعرض أرقام قياس أداء، بل <strong>نمط سير عمل</strong>، لذا نتناول هنا الأثر الفعلي للتصميم من الناحية البنيوية. لا يقدّم المستودع أرقام أداء قابلة لإعادة الإنتاج، وحتى صاحب المشروع نفسه يستند إلى تحسّن سير العمل اليومي لا إلى مؤشرات كمية. لذلك لن نختلق أرقامًا في هذا المقال، بل نتناول المزايا البنيوية فقط.</p>

<p>الأثر الأكبر هو <strong>إزالة تكلفة استعادة السياق</strong>. يمر الوصول عبر قاعدة بيانات متجهية بحساب تضمين وبحث تشابه في كل استعلام، بينما يقتصر الوصول عبر مسار المجلد على قراءة ملف واحد. حين يقول المستخدم “ذلك المشروع من المرة السابقة”، يقرأ العامل حزمة ذلك المشروع مباشرة، ويستعيد السياق الدقيق دون أخطاء إيجابية كاذبة يسببها البحث التقريبي. تصبح دقة الذاكرة رهينة جودة تصميم المجلدات لا جودة البحث.</p>

<p>الأثر الثاني هو <strong>إمكانية التدقيق</strong>. بما أن كل الذاكرة مخزَّنة كماركداون قابل للقراءة البشرية، يمكن للمطور فتحها والتحقق منها وتعديلها مباشرة ليعرف ما يعرفه العامل. من الصعب على الإنسان التحقق بصريًا من متجهات التضمين، لكن <code class="language-plaintext highlighter-rouge">people/A.md</code> مجرد ملف نصي. القدرة على تصحيح ذاكرة العامل فورًا حين تكون خاطئة تُحدث فرقًا كبيرًا في الممارسة العملية.</p>

<p>الأثر الثالث هو <strong>قابلية النقل</strong>. بما أن التصميم لا يرتبط بمزوّد قاعدة بيانات متجهية أو نموذج تضمين معيّن، فإن المستودع نفسه هو الذاكرة الكاملة. عند النقل إلى جهاز آخر أو عامل آخر، تعمل المجلدات والماركداون كما هي. هذا الاستقلال عن البنية التحتية يرتبط مباشرة بمنظور السيادة والحوسبة الداخلية (on-premise) الذي نتناوله لاحقًا.</p>

<h2 id="دلالات-التطبيق-على-منتجات-thakicloud">دلالات التطبيق على منتجات ThakiCloud</h2>

<p>يتقاطع هذا التصميم مع محورَي تشغيل العوامل في ThakiCloud كليهما.</p>

<p>من <strong>منظور Paxis</strong> يبدو التقاطع الأكثر مباشرة. Paxis هو مستوى تحكم السحابة الأصلية للعوامل (Agent-Native Cloud) في ThakiCloud، ويتعامل مع المهارات (Skills) والأدوات (Tools) والسياسات (Policies) وسجلات التدقيق (Audit Logs) كموارد من الدرجة الأولى. النمط الذي يعرضه <code class="language-plaintext highlighter-rouge">personal-monorepo-template</code>، أي “مهارات محلية داخل المستودع + عقد محمَّل باستمرار (AGENTS.md)”، يتطابق تمامًا مع اتجاه تصميم حاضنة المهارات في Paxis. يختار Paxis بالفعل عددًا من المهارات عبر BM25 وينفّذها في بيئة معزولة (sandbox)، ونهج هذا المستودع يجيب بوضوح، عبر بنية المجلدات، على سؤال أسبق وهو “أي معرفة توضع باستمرار في سياق الجلسة”. وبشكل خاص، إبقاء الذاكرة كملفات قابلة للقراءة البشرية وجعل كل تحديث قابلًا للتدقيق ينسجم مع نفس فلسفة Paxis التي تُمرّر كل سلوك للعامل عبر بوابات السياسات وسجلات التدقيق. فكرة استخلاص قدرة العامل من البنية المحيطة لا من درجة النموذج نفسها تتطابق شكليًا مع تصميمنا الذي يتعامل مع المهارات كموارد من الدرجة الأولى.</p>

<p>من <strong>منظور ai-platform</strong>، تبرز زاوية عبء البنية التحتية بشكل لافت. منصة ai-platform في ThakiCloud بنية تحتية للذكاء الاصطناعي وتعلّم الآلة قائمة على K8s، وتخدم أحمال عمل عملاء الذكاء الاصطناعي السيادي والداخلي (on-premise). بالنسبة لهؤلاء العملاء، فإن بنية ذاكرة تتطلب تشغيل قاعدة بيانات متجهية باستمرار تعني سطحًا إضافيًا للبنية التحتية وتكلفة إدارة إضافية. في المقابل، الذاكرة المُمثَّلة بمجلدات وماركداون تعمل بنظام الملفات وحده دون مخزن حالة منفصل، ما يقلل عبء التشغيل كثيرًا في البيئات الخاضعة للتنظيم أو الشبكات المغلقة. زاوية “منح العامل استمرارية مع تقليل بنية الذاكرة التحتية إلى أدنى حد” يمكن أن تكون نقطة بيع فعلية للعملاء الذين يتطلبون ذكاءً اصطناعيًا سياديًا.</p>

<h2 id="القيود-والحجج-المضادة">القيود والحجج المضادة</h2>

<p>هذا التصميم ليس حلًا شاملًا. القيد الأوضح هو <strong>الحجم</strong>. الوصول عبر مسار المجلد قوي حين يعرف الإنسان أو العامل عنوان الذاكرة مسبقًا. لكن في المواقف التي يجب فيها البحث عن معلومة “لا يُعرف مكانها” بين عشرات الآلاف من المستندات، يظل البحث المتجهي الدلالي متفوقًا. يفترض هذا المستودع فضاء ذاكرة صغيرًا نسبيًا وواضح البنية، وهو أشخاص المستخدم ومشاريعه وخبراته الشخصية. عند التوسع إلى قاعدة معرفة ضخمة لفريق كامل بأسره، تظهر حدود بنية المجلدات وحدها.</p>

<p>الحجة المضادة الثانية هي <strong>خصوصية الفحص</strong>. إن فحص سلاك والبريد الإلكتروني والتقويم لإنشاء ملفات الأشخاص يعني أيضًا أن محادثات حساسة تُخزَّن كنص عادي في ماركداون. هذا مريح للاستخدام الشخصي، لكن تبنّيه في منظمة يتطلب حتمًا ضوابط وصول وسياسات احتفاظ. بقدر ما تُعد إمكانية التدقيق ميزة، فإنها تتحول إلى مخاطرة إن لم يوجد ضبط لمن يصل إلى تلك الملفات.</p>

<p>الثالثة هي <strong>موثوقية التحديث التلقائي</strong>. إذا كتب التسجيل التلقائي، الذي يعمل مرتين يوميًا، ملخصًا خاطئًا في ملف شخص، يستمر هذا الخطأ في الحقن في الجلسات اللاحقة. هذا هو السبب في أن المستودع يجعل التحديثات “اقتراحات” تفترض مراجعة بشرية. فالدفع نحو الأتمتة الكاملة قد يلوّث الذاكرة بصمت، لذا فإن إبقاء بوابة مراجعة بشرية أكثر أمانًا.</p>

<p>وأخيرًا، يُقدَّم هذا النهج كـ”بديل مجاني مقابل راتب مساعد بشري”، لكن الحفاظ فعليًا على سير عمل بهذا المستوى يتطلب قدرة هندسية معتبرة على تصميم بنية المستودع وصقلها ذاتيًا. مجانية الأداة وتكلفة تشغيله بكفاءة أمران مختلفان تمامًا.</p>

<p>ومع ذلك، فإن الرسالة الجوهرية التي يطرحها هذا المستودع واضحة. ذاكرة العامل لا يجب أن تكون بالضرورة بنية تحتية ثقيلة، ويمكن تحقيق استمرارية معتبرة ببنية مجلدات جيدة وعقد يُحمَّل باستمرار فقط. وهذا يشير بالضبط إلى الاتجاه نفسه الذي تسلكه ThakiCloud في تعاملها مع المهارات والمعرفة كموارد من الدرجة الأولى.</p>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li><a href="https://github.com/jxnl/personal-monorepo-template">jxnl/personal-monorepo-template (GitHub)</a></li>
  <li><a href="https://jxnl.co/writing/2026/05/10/codex-maxxing/">Codex-maxxing (jxnl.co)</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="agentops" /><category term="agent-memory" /><category term="coding-agent" /><category term="agents-md" /><category term="codex" /><category term="agentops" /><category term="paxis" /><summary type="html"><![CDATA[يمنح personal-monorepo-template الذي كشف عنه مهندس فريق OpenAI Codex، jxnl، العامل البرمجي ذاكرة دائمة عبر بنية مجلدات وملف AGENTS.md فقط، دون قاعدة بيانات متجهية. نفكك هذا التصميم ونتحقق منه من منظور ThakiCloud الذي يتعامل مع المهارات كموارد من الدرجة الأولى.]]></summary></entry><entry xml:lang="ar"><title type="html">اختبار تطبيقات iOS عبر المتصفح على Mac سحابي بدون واجهة رسومية: serve-sim</title><link href="https://thakicloud.github.io/ar/dev/serve-sim-ios-simulator-web/" rel="alternate" type="text/html" title="اختبار تطبيقات iOS عبر المتصفح على Mac سحابي بدون واجهة رسومية: serve-sim" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/dev/serve-sim-ios-simulator-web</id><content type="html" xml:base="https://thakicloud.github.io/ar/dev/serve-sim-ios-simulator-web/"><![CDATA[<p>عندما تطلب من وكيل برمجة يعمل بالذكاء الاصطناعي بناء تطبيق iOS، يصطدم بحائط أساسي. يستطيع الوكيل كتابة الكود بل وحتى بناء المشروع، لكنه لا يستطيع رؤية ما يحدث فعلاً على الشاشة. وتتفاقم المشكلة أكثر عندما تكون بيئة التطوير مستضافة على جهاز Mac Mini في السحابة، لأن نافذة محاكي Xcode نفسها لا تظهر أصلاً على خادم بدون واجهة رسومية (headless).</p>

<p>جاء <a href="https://github.com/EvanBacon/serve-sim">serve-sim</a>، الذي طوره Evan Bacon من فريق نواة Expo، ليواجه هذا الحائط مباشرة. وقد ذاع صيت هذه الأداة فعلياً عندما قدّمها المطور المستقل levelsio قائلاً إنها “تتيح رؤية تطبيق iOS الذي بناه Claude Code على Mac Mini في السحابة مباشرة عبر المتصفح في الوقت الفعلي”. وشعار serve-sim بسيط: “أمر <code class="language-plaintext highlighter-rouge">npx serve</code> الخاص بمحاكيات آبل”.</p>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>ما يجعل serve-sim مثيراً للاهتمام هو أنه ليس مجرد أداة لعكس الشاشة. فهذه الأداة تفتح قناتين في آن واحد: الأولى هي تدفق فيديو يرسل شاشة المحاكي إلى المتصفح، والثانية قناة تحكم تتيح للمتصفح أو للوكيل التفاعل مع المحاكي. بعبارة أخرى، تجعل “المشاهدة” و”التحكم” ممكنتين عن بُعد في آن معاً.</p>

<p>أهمية هذا المزيج تكمن في أنه يُكمل حلقة التطوير الخاصة بوكلاء البرمجة بالذكاء الاصطناعي. يصبح بإمكان الوكيل تعديل الكود، وبناء المشروع، وتشغيله، ثم رؤية النتيجة على الشاشة، والضغط على الأزرار للانتقال إلى الخطوة التالية، وتكرار هذه الدورة الكاملة دون تدخل بشري. وهذا يتقاطع تماماً مع توجه Paxis، السحابة المخصصة للوكلاء (Agent-Native Cloud) لدى ThakiCloud، القائم على فكرة “أن ينفذ الوكيل عملاً فعلياً في بيئة معزولة”، مما يجعل من المفيد دراسة كيفية تنفيذ أداة مفتوحة المصدر واحدة لهذا النوع من سير العمل.</p>

<p><img src="/assets/images/serve-sim-ios-simulator-web-hero.png" alt="صورة تجريدية لشاشة هاتف ذكي على خادم سحابي بدون واجهة رسومية تتحول إلى جسيمات ضوئية تتدفق عبر الشبكة إلى نافذة متصفح" />
<em>تصوير لبنية تحوّل شاشة المحاكي على خادم بدون واجهة رسومية إلى تدفق يصل إلى متصفح بعيد.</em></p>

<h2 id="ما-هو-serve-sim">ما هو serve-sim</h2>

<p>آلية عمل serve-sim أبسط وأذكى مما قد يبدو للوهلة الأولى. لا حاجة لتثبيت إضافة (plugin) خاصة في Xcode ولا لزرع كود قياس داخل التطبيق. بدلاً من ذلك، يشغّل serve-sim عملية مساعدة صغيرة مكتوبة بلغة Swift تلتقط الإطارات المرئية لمحاكي iOS المُقلع مسبقاً عبر واجهة <code class="language-plaintext highlighter-rouge">simctl io</code> التي توفرها آبل.</p>

<p>تُعرض الشاشة الملتقطة عبر مسارين. أولاً، تدفق MJPEG يرسل فيديو إلى المتصفح بمعدل يصل إلى 60 إطاراً في الثانية. ثانياً، تُفتح قناة تحكم عبر WebSocket تتيح للمتصفح إرسال مدخلات مثل النقر والإيماءات إلى المحاكي. وفوق ذلك، تُركّب واجهة معاينة مبنية بـ React تتيح للمستخدم التفاعل مع التطبيق في المتصفح وكأنه جهاز فعلي.</p>

<pre><code class="language-mermaid">flowchart TB
    A[محاكي iOS مُقلَع] --&gt; B[عملية مساعدة بلغة Swift]
    B --&gt; C[التقاط الإطارات المرئية&lt;br/&gt;عبر simctl io]
    C --&gt; D[تدفق فيديو MJPEG&lt;br/&gt;حتى 60 FPS]
    C --&gt; E[قناة تحكم عبر WebSocket]
    D --&gt; F[واجهة معاينة React في المتصفح]
    E --&gt; F
    E --&gt; G[سطر أوامر الوكيل&lt;br/&gt;نقر، إيماءات، دوران، كاميرا]
    F -.تحكم بشري.-&gt; E
    G -.تحكم الوكيل.-&gt; E
</code></pre>

<p>الجوهر هنا هو أن الأداة تعمل مع “أي محاكي مُقلَع” أياً كان. لا حاجة لتعديل التطبيق، فيمكن ربطها مباشرة بمشروع قائم بالفعل. كذلك، تنقل الأداة سجلات المحاكي إلى المتصفح، مما يتيح لأدوات MCP من فئة browser-use قراءة تلك السجلات لتقييم الحالة. وتوجد أيضاً ميزة عملية تتيح إفلات ملفات فيديو أو صور في نافذة المتصفح لتُضاف كملفات إلى جهاز المحاكي.</p>

<h2 id="التثبيت-والاستخدام">التثبيت والاستخدام</h2>

<p>عتبة الدخول إلى serve-sim منخفضة. يكفي سطر واحد على جهاز Mac يحتوي على Node.js.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx serve-sim
</code></pre></div></div>

<p>بعد التشغيل، يمكن مشاهدة المعاينة محلياً على <code class="language-plaintext highlighter-rouge">http://localhost:3200</code>. تدعم الأداة ثلاثة أنماط استخدام: محلياً، أو عبر الشبكة المحلية (LAN) من جهاز آخر على نفس الشبكة، أو على جهاز Mac بعيد مع نفق (tunnel) يتيح الوصول من أي مكان. حالة levelsio هي النمط الثالث تحديداً، حيث يعمل serve-sim على Mac Mini سحابي بدون واجهة رسومية بينما تجري المشاهدة عبر متصفح بعيد.</p>

<p>يُقدَّم دمج الوكلاء عبر مهارة وكيل (Agent Skill) منفصلة. هذه المهارة، الموجودة في <code class="language-plaintext highlighter-rouge">skills/serve-sim</code> ضمن المستودع، تعلّم Claude Code وCursor وCodex CLI وGemini CLI وأي مضيف آخر يطبّق معيار Agent Skills المفتوح كيفية التحكم في المحاكي عبر سطر الأوامر. وتشمل هذه القدرات النقر والإيماءات وأزرار الأجهزة الفعلية ودوران الشاشة وحقن مدخلات الكاميرا، إضافة إلى تمرير التدفق إلى نافذة المعاينة الخاصة بالمضيف.</p>

<h2 id="ملاحظة-حول-إعادة-الإنتاج">ملاحظة حول إعادة الإنتاج</h2>

<p>بيئة التنفيذ التي كُتب فيها هذا المقال هي جلسة معالجة دفعية بدون واجهة رسومية، حيث تشغيل Node.js محظور بموجب السياسة المتبعة، لذا لم يتسنَّ تشغيل <code class="language-plaintext highlighter-rouge">npx serve-sim</code> مباشرة والتقاط الشاشة فعلياً. وعليه، فإن الأوامر ووصف السلوك في هذا المقال مستندة إلى ما ورد في ملف README الخاص بالمستودع والمواد التعريفية الرسمية، دون اختلاق أي أرقام قياس أداء. يُنصح بالتحقق من مشهد بث المحاكي الفعلي وزمن الاستجابة الحقيقي عبر تشغيل الأمر أعلاه مباشرة في بيئة macOS مع محاكي Xcode مُقلَع.</p>

<h2 id="دلالات-على-منتجات-thakicloud">دلالات على منتجات ThakiCloud</h2>

<p>يبدو serve-sim للوهلة الأولى أداة موجهة لمطوري iOS، لكن خلفها يكمن تيار أوسع هو التطوير المصمم أصلاً للوكلاء (agent-native development).</p>

<p><strong>عدسة Paxis (التطوير المصمم للوكلاء).</strong> Paxis من ThakiCloud هي مستوى تحكم لسحابة مخصصة للوكلاء يشغّل المهارات في صناديق رملية معزولة ويمرر كل سلوك عبر بوابات سياسات وسجلات تدقيق. ومعيار Agent Skills المفتوح الذي يعتمده serve-sim هو نفس نموذج العقد الذي تتعامل معه بنية مهارات Paxis. فكرة أن تقدّم مهارة واحدة قدرة “النقر على المحاكي وتدويره وقراءة شاشته” لعدة مضيفي وكلاء مختلفين تسير في نفس اتجاه بنية Paxis التي تختار أكثر من 960 مهارة عبر خوارزمية BM25 وتنفذها في عزل. وبشكل خاص، فإن أعباء العمل التي يتحكم فيها الوكيل فعلياً في واجهة مستخدم حقيقية، كما في قناة التحكم لدى serve-sim، لا يمكن رفعها بأمان إلى بيئة الإنتاج إلا إذا مرّ ذلك التحكم عبر بوابة سياسات وسُجّل في سجل تدقيق. إذا كان serve-sim يقدّم “القدرة”، فإن Paxis تقدّم طبقة “الضبط الآمن” لتلك القدرة.</p>

<p><strong>عدسة ai-platform (بنية التنفيذ بدون واجهة رسومية).</strong> تكمن الجاذبية الحقيقية لـ serve-sim في عمله على جهاز Mac بعيد بدون واجهة رسومية. وفكرة البناء والبث على خادم بدون واجهة رسومية تشبه فلسفياً الطريقة التي تجدول بها منصة ai-platform من ThakiCloud أعباء العمل وتنفذها على Kubernetes دون الحاجة إلى واجهة رسومية. وأي خط أنابيب (pipeline) يُلحق فيه مشغّل macOS المطلوب لبناء تطبيقات iOS عند الطلب، يبني الوكيل عليه ويختبر تلقائياً، ثم يُبث النتيجة فقط إلى المستخدم البشري، يمكن أن يمتد إلى ما هو أبعد من التكامل المستمر (CI) نحو “ضمان جودة يقوده الوكيل”. وهذه بنية تجعل فيها البنية التحتية للتنفيذ بدون واجهة رسومية منخفضة التكلفة (ai-platform) ركيزة تدعم جدوى أتمتة الوكلاء اقتصادياً (Paxis).</p>

<h2 id="القيود-والحجج-المضادة">القيود والحجج المضادة</h2>

<p>هناك عدة نقاط ينبغي تناولها بموضوعية.</p>

<p>أولاً، يستهدف serve-sim المحاكي وليس الجهاز الفعلي. وبما أنه محاكٍ لا جهاز مادي حقيقي، تبقى المشكلات التي تظهر فقط على الأجهزة الفعلية، كالكاميرا والحساسات وخصائص الأداء، خارج نطاق الاكتشاف. ويبقى القيد القديم قائماً: نجاح الاختبار على المحاكي لا يضمن نجاحه على الجهاز الفعلي.</p>

<p>ثانياً، بث MJPEG بسيط ومتوافق على نطاق واسع، لكن كفاءة ضغطه ليست عالية. فبث فيديو عالي الجودة بمعدل 60 إطاراً في الثانية باستمرار عبر نفق بعيد قد يجعل عرض النطاق الترددي وزمن الاستجابة عنق زجاجة. وفي اختبارات الإيماءات التي تتطلب سرعة استجابة، ينعكس زمن الرحلة عبر الشبكة مباشرة كتأخير في التحكم.</p>

<p>ثالثاً، إتاحة “الرؤية والتحكم” للوكيل شيء، ودقة قراره شيء آخر تماماً. يظل احتمال أن يُسيء الوكيل تفسير التدفق ويضغط على زر خاطئ قائماً، وهذه بالتحديد هي النقطة التي تحتاج إلى بوابة سياسات ومراجعة بشرية. فكلما فتحت الأداة مزيداً من القدرات، ازدادت أهمية الطبقة التي تضبط تلك القدرات.</p>

<p>مع ذلك، فإن اتجاه serve-sim واضح. لقد أرسى جسراً عملياً حقيقياً للانتقال من “مرحلة يكتفي فيها الوكيل بكتابة الكود” إلى “مرحلة يبني فيها الوكيل ويشغّل ويتحكم مباشرة في الشاشة للتحقق”. وأي فريق يريد تطوير تطبيقات جوّال بواسطة وكلاء ذكاء اصطناعي على سحابة بدون واجهة رسومية يمكنه فتح هذا العالم فوراً بسطر واحد هو <code class="language-plaintext highlighter-rouge">npx serve-sim</code>.</p>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li>Evan Bacon. “serve-sim: The <code class="language-plaintext highlighter-rouge">npx serve</code> of Apple Simulators.” GitHub. <a href="https://github.com/EvanBacon/serve-sim">https://github.com/EvanBacon/serve-sim</a></li>
  <li>@levelsio، تغريدة تعريفية بـ serve-sim. <a href="https://x.com/levelsio/status/2075328941317886210">https://x.com/levelsio/status/2075328941317886210</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="dev" /><category term="ios-simulator" /><category term="agent-skills" /><category term="developer-tools" /><category term="headless" /><category term="claude-code" /><category term="expo" /><summary type="html"><![CDATA[عند وضع Mac Mini في السحابة، ينعدم وجود واجهة رسومية تتيح رؤية محاكي iOS. يبث serve-sim الإطارات المرئية للمحاكي إلى المتصفح، ويفتح أيضاً قناة تحكم عبر WebSocket، مما يتيح لوكلاء البرمجة بالذكاء الاصطناعي بناء تطبيقات iOS والتفاعل معها واختبارها فعلياً في بيئة بدون واجهة رسومية.]]></summary></entry><entry xml:lang="ar"><title type="html">لم يكن هناك Q4 حقيقي تقريبا داخل Q4_K_M: تشريح دقيق لآلية التكميم في GGUF</title><link href="https://thakicloud.github.io/ar/llmops/gguf-quantization-internals/" rel="alternate" type="text/html" title="لم يكن هناك Q4 حقيقي تقريبا داخل Q4_K_M: تشريح دقيق لآلية التكميم في GGUF" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/llmops/gguf-quantization-internals</id><content type="html" xml:base="https://thakicloud.github.io/ar/llmops/gguf-quantization-internals/"><![CDATA[<p><img src="/assets/images/gguf-quantization-internals-hero.png" alt="رسم توضيحي تجريدي لأوزان شبكة عصبية مكممة يعاد ترتيبها إلى كتل بأحجام مختلفة" /></p>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>إذا سبق لك تشغيل نموذج لغوي كبير محليا، فمن المرجح أنك رأيت تسميات مثل <code class="language-plaintext highlighter-rouge">Q4_K_M</code> و<code class="language-plaintext highlighter-rouge">Q5_K_M</code> و<code class="language-plaintext highlighter-rouge">Q8_0</code>. يتوقف معظم الناس عند فهم مفاده أن “Q4 يعني 4 بت، إذن لا بد أنه الأصغر والأسرع”، ثم يقومون بتحميل الملف وتشغيله مباشرة. لكن هذه التسمية تخفي أكثر مما تظهر. قلة قليلة من الناس فتحوا فعليا ملفا موسوما بـ <code class="language-plaintext highlighter-rouge">Q4_K_M</code> وتحققوا، مصفوفة تلو الأخرى، مما إذا كان ممتلئا حقا ببيانات ذات 4 بت.</p>

<p>هذا المقال موجه لقادة الهندسة، والممارسين المسؤولين عن تكلفة الاستدلال، والفرق التي تسعى لتقديم النماذج محليا (on-premises). قمنا بتحميل ملف GGUF لنموذج Qwen2.5-0.5B-Instruct على عدة مستويات تكميم، وقسنا أحجام الملفات الفعلية، وقمنا بتشريح ملف واحد من نوع <code class="language-plaintext highlighter-rouge">Q4_K_M</code> بشكل كامل مصفوفة تلو الأخرى. جاءت النتيجة مختلفة تماما عن الحدس. نوضح لماذا يهم فهم هذه الفجوة لتكلفة الخدمة وجودتها، وماذا يعني ذلك بالنسبة لبنية الاستدلال التحتية لدى ThakiCloud.</p>

<p>ولنذكر الخلاصة أولا: في ملف <code class="language-plaintext highlighter-rouge">Q4_K_M</code> الخاص بهذا النموذج، لم تشكل المصفوفات التي هي فعلا تكميم K رباعي البت (Q4_K) سوى 6.1 بالمئة من إجمالي سعة الأوزان، وكان عرض البت الفعلي للملف ليس 4 بل <strong>6.16 بت</strong>. أي أن التسمية كانت أقرب إلى كذبة تقريبا.</p>

<h2 id="ما-هي-هذه-التقنية">ما هي هذه التقنية</h2>

<p>GGUF هو صيغة نموذج أحادية الملف تستخدم في منظومة llama.cpp. يجمع ملف واحد بين البيانات الوصفية (البنية المعمارية، أداة تجزئة الرموز، المعاملات الفائقة) وأوزان جميع المصفوفات المكممة معا. النقطة الجوهرية هي أن <strong>كل مصفوفة يمكن أن تستخدم نوع تكميم مختلفا</strong>. لذلك فإن تسمية على مستوى الملف مثل <code class="language-plaintext highlighter-rouge">Q4_K_M</code> لا تشير إلا إلى “النوع السائد”، وليس إلى أن الملف بأكمله من ذلك النوع.</p>

<p>تنقسم أنواع التكميم في llama.cpp إلى فئتين رئيسيتين. الأولى هي <strong>الفئة القديمة (legacy)</strong> (Q4_0، Q5_0، Q8_0) التي تجمع 32 وزنا في كتلة واحدة. والثانية هي <strong>فئة تكميم K</strong> (Q4_K، Q5_K، Q6_K) التي تجمع 256 وزنا في كتلة فائقة واحدة (superblock). ولأن تكميم K يقسم المقياس (scale) والحد الأدنى داخل الكتلة الفائقة بشكل أدق، فإنه يقدم جودة أفضل من الفئة القديمة عند نفس عرض البت. الحرف <code class="language-plaintext highlighter-rouge">K</code> في <code class="language-plaintext highlighter-rouge">Q4_K_M</code> يشير إلى تكميم K هذا، بينما <code class="language-plaintext highlighter-rouge">M</code> يعني الإعداد المسبق “المتوسط” الذي يرفع بعض المصفوفات الحساسة إلى دقة أعلى (Q6_K).</p>

<p>بالنظر عن قرب إلى بنية الكتلة الفائقة، يتضح سبب كفاءة تكميم K الأعلى. على سبيل المثال، يخزن Q4_K 256 وزنا في 144 بايت. من ذلك، تشغل القيم النقية ذات 4 بت مساحة 256 × 4 بت = 128 بايت، أما البايتات الـ16 المتبقية فهي بيانات وصفية تقسم الكتلة الفائقة إلى 8 كتل فرعية وتعيد تكميم مقياس كل منها وحدها الأدنى بـ6 بت. بعبارة أخرى، القيم نفسها ذات 4 بت، لكن الاحتفاظ بمقاييس دقيقة لإعادة بنائها يقلل من الخطأ. وهذا يتباين مع Q4_0 القديم الذي يحتفظ بمقياس واحد فقط لكل 32 وزنا. لذا فإن عرض البت الفعلي لـ Q4_K هو 144 × 8 ÷ 256 = 4.5 بت، أكبر قليلا من 4 بت النقية، لكن الجودة أكثر استقرارا بكثير.</p>

<p>هناك قيد حاسم واحد هنا. <strong>لا يمكن استخدام تكميم K إلا عندما يكون عدد أعمدة المصفوفة (<code class="language-plaintext highlighter-rouge">ne[0]</code> بمصطلحات ggml) قابلا للقسمة على 256.</strong> والسبب أن الكتلة الفائقة تعمل بوحدات من 256. وإذا لم يتحقق هذا الشرط، فإن llama.cpp يعود بصمت إلى الفئة القديمة (غالبا Q5_0). هذه القاعدة الواحدة تفسر نتيجة تجربة اليوم بأكملها.</p>

<pre><code class="language-mermaid">flowchart TB
    A["ملف GGUF (Q4_K_M)"] --&gt; B["تحديد النوع لكل مصفوفة&lt;br/&gt;llama_tensor_get_type()"]
    B --&gt; C{"هل عدد الأعمدة ne[0]&lt;br/&gt;قابل للقسمة على 256؟"}
    C --&gt;|"نعم"| D["استخدام تكميم K&lt;br/&gt;Q4_K / Q6_K (كتلة فائقة 256)"]
    C --&gt;|"لا"| E["العودة إلى الفئة القديمة&lt;br/&gt;Q5_0 (كتلة 32)"]
    B --&gt; F["رفع الدقة للمصفوفات الحساسة"]
    F --&gt; G["output.weight -&gt; Q8_0&lt;br/&gt;attn_v.weight -&gt; Q8_0&lt;br/&gt;ffn_down.weight -&gt; Q6_K"]
    D --&gt; H["تجميع عرض البت الفعلي"]
    E --&gt; H
    G --&gt; H
    H --&gt; I["عرض البت الفعلي لكامل الملف = 6.16&lt;br/&gt;(التسمية 'Q4' = 4.0)"]
</code></pre>

<h2 id="الإعداد-والتكامل">الإعداد والتكامل</h2>

<p>يمكن إعادة إنتاج التجربة دون أي تبعيات إضافية. تعيد واجهة برمجة تطبيقات Hugging Face عدد البايتات الفعلي لحجم الملف، ويمكن قراءة أنواع المصفوفات مباشرة باستخدام قارئ <code class="language-plaintext highlighter-rouge">gguf</code>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># 1) تثبيت أداة القراءة والتحميل</span>
pip <span class="nb">install </span>gguf huggingface_hub

<span class="c"># 2) تحميل ملف واحد فقط من نوع Q4_K_M (أقل من 500 ميجابايت لأنه نموذج 0.5B)</span>
hf download Qwen/Qwen2.5-0.5B-Instruct-GGUF <span class="se">\</span>
  qwen2.5-0.5b-instruct-q4_k_m.gguf <span class="nt">--local-dir</span> ./gguf
</code></pre></div></div>

<p>فيما يلي الشيفرة الخاصة بفتح أنواع مصفوفات الملف المحمل. يحتوي رأس (header) ملف GGUF على اسم كل مصفوفة وأبعادها ورقم نوع ggml مباشرة، لذا فإن مجرد تجميع هذه القيم يكشف بالضبط ما الذي يملأ الملف فعليا.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="n">collections</span> <span class="kn">import</span> <span class="n">Counter</span>
<span class="kn">from</span> <span class="n">gguf</span> <span class="kn">import</span> <span class="n">GGUFReader</span>

<span class="n">r</span> <span class="o">=</span> <span class="nc">GGUFReader</span><span class="p">(</span><span class="sh">"</span><span class="s">gguf/qwen2.5-0.5b-instruct-q4_k_m.gguf</span><span class="sh">"</span><span class="p">)</span>
<span class="n">hist</span> <span class="o">=</span> <span class="nc">Counter</span><span class="p">()</span>
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">r</span><span class="p">.</span><span class="n">tensors</span><span class="p">:</span>
    <span class="n">hist</span><span class="p">[</span><span class="n">t</span><span class="p">.</span><span class="n">tensor_type</span><span class="p">.</span><span class="n">name</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">1</span>
    <span class="c1"># التحقق من النوع الفعلي لبعض المصفوفات التمثيلية
</span>    <span class="k">if</span> <span class="n">t</span><span class="p">.</span><span class="n">name</span> <span class="ow">in</span> <span class="p">(</span><span class="sh">"</span><span class="s">token_embd.weight</span><span class="sh">"</span><span class="p">,</span> <span class="sh">"</span><span class="s">output.weight</span><span class="sh">"</span><span class="p">,</span>
                  <span class="sh">"</span><span class="s">blk.0.attn_v.weight</span><span class="sh">"</span><span class="p">,</span> <span class="sh">"</span><span class="s">blk.0.ffn_down.weight</span><span class="sh">"</span><span class="p">,</span>
                  <span class="sh">"</span><span class="s">blk.0.attn_q.weight</span><span class="sh">"</span><span class="p">):</span>
        <span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="si">{</span><span class="n">t</span><span class="p">.</span><span class="n">name</span><span class="si">:</span><span class="mi">26</span><span class="n">s</span><span class="si">}</span><span class="s"> </span><span class="si">{</span><span class="n">t</span><span class="p">.</span><span class="n">shape</span><span class="si">}</span><span class="s"> -&gt; </span><span class="si">{</span><span class="n">t</span><span class="p">.</span><span class="n">tensor_type</span><span class="p">.</span><span class="n">name</span><span class="si">}</span><span class="sh">"</span><span class="p">)</span>
<span class="nf">print</span><span class="p">(</span><span class="nf">dict</span><span class="p">(</span><span class="n">hist</span><span class="p">))</span>
</code></pre></div></div>

<p>عدد البايتات لكل كتلة يأتي مباشرة من تعريفات ggml. فمثلا، يخزن Q4_K 256 وزنا في 144 بايت أي 4.5 بت لكل وزن، ويخزن Q6_K 256 وزنا في 210 بايت أي 6.5625 بت لكل وزن، بينما يخزن Q5_0 القديم 32 وزنا في 22 بايت أي 5.5 بت لكل وزن. وبجمع (عدد العناصر ÷ حجم الكتلة) × بايتات الكتلة لكل مصفوفة، يمكن حساب عرض البت الفعلي للملف بدقة.</p>

<h2 id="نتائج-التجربة-الفعلية">نتائج التجربة الفعلية</h2>

<p>أولا، أحجام الملفات. هذه هي القيم المقاسة فعليا لنفس النموذج بعد تحميله على 7 مستويات تكميم، مقارنة بالأصل بصيغة fp16 (1266 ميجابايت).</p>

<table>
  <thead>
    <tr>
      <th>التكميم</th>
      <th>حجم الملف</th>
      <th>مقارنة بـ fp16</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Q2_K</td>
      <td>415.2 MB</td>
      <td>32.8%</td>
    </tr>
    <tr>
      <td>Q3_K_M</td>
      <td>432.0 MB</td>
      <td>34.1%</td>
    </tr>
    <tr>
      <td>Q4_0</td>
      <td>428.7 MB</td>
      <td>33.9%</td>
    </tr>
    <tr>
      <td><strong>Q4_K_M</strong></td>
      <td><strong>491.4 MB</strong></td>
      <td><strong>38.8%</strong></td>
    </tr>
    <tr>
      <td>Q5_K_M</td>
      <td>522.2 MB</td>
      <td>41.2%</td>
    </tr>
    <tr>
      <td>Q6_K</td>
      <td>650.4 MB</td>
      <td>51.4%</td>
    </tr>
    <tr>
      <td>Q8_0</td>
      <td>675.7 MB</td>
      <td>53.4%</td>
    </tr>
  </tbody>
</table>

<p>هناك ما يثير الغرابة بالفعل هنا. الفرق بين Q2_K (415 ميجابايت) و Q4_0 (429 ميجابايت) هو 14 ميجابايت فقط. خفضنا عدد البتات إلى النصف، لكن حجم الملف لم ينخفض تقريبا. بل إن <code class="language-plaintext highlighter-rouge">Q4_K_M</code> (491 ميجابايت) أكبر فعليا من <code class="language-plaintext highlighter-rouge">Q4_0</code> (429 ميجابايت) ذي 4 بت النقية. بالنظر إلى الأسماء وحدها، هذه النتيجة غير مفهومة.</p>

<p>يتضح السبب الحقيقي عند فتح ملف <code class="language-plaintext highlighter-rouge">Q4_K_M</code> مصفوفة تلو الأخرى. فيما يلي توزيع الأنواع عبر 291 مصفوفة فيه.</p>

<table>
  <thead>
    <tr>
      <th>النوع الفعلي</th>
      <th>عدد المصفوفات</th>
      <th>عرض البت الاسمي</th>
      <th>حصة سعة الأوزان</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Q5_0</td>
      <td>133</td>
      <td>5.5</td>
      <td>54.9%</td>
    </tr>
    <tr>
      <td>Q8_0</td>
      <td>13</td>
      <td>8.5</td>
      <td>30.1%</td>
    </tr>
    <tr>
      <td>Q6_K</td>
      <td>12</td>
      <td>6.5625</td>
      <td>8.8%</td>
    </tr>
    <tr>
      <td>Q4_K</td>
      <td>12</td>
      <td>4.5</td>
      <td>6.1%</td>
    </tr>
    <tr>
      <td>F32 (norm/bias)</td>
      <td>121</td>
      <td>32.0</td>
      <td>0.1%</td>
    </tr>
  </tbody>
</table>

<p><img src="/assets/images/gguf-quantization-internals-results.png" alt="مخطط يظهر أحجام الملفات عبر مستويات التكميم لنموذج Qwen2.5-0.5B، وتكوين أنواع المصفوفات الفعلي داخل Q4_K_M. عرض البت الفعلي لـ Q4_K_M هو 6.16، بعيدا كثيرا عن رقم التسمية 4.0" /></p>

<p>على الرغم من تسمية <code class="language-plaintext highlighter-rouge">Q4_K_M</code>، لم يشكل تكميم K الحقيقي رباعي البت (Q4_K) سوى <strong>6.1 بالمئة</strong> من إجمالي سعة الأوزان. وبدلا من ذلك، استحوذ النوع القديم Q5_0 ذو 5.5 بت على أكثر من النصف (54.9 بالمئة)، واستهلك Q8_0 ذو 8.5 بت نسبة 30 بالمئة. وعند حساب عرض البت الفعلي لكامل الملف، نحصل على <strong>6.16 بت</strong>، أي أكثر من 1.5 ضعف الـ4 بت التي توحي بها التسمية.</p>

<p>بالتحقق من المصفوفات التمثيلية واحدة تلو الأخرى، يتضح النمط بجلاء. كانت الأنواع المقاسة فعليا كما يلي:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">token_embd.weight</code> (896 × 151936) -&gt; <strong>Q5_0</strong></li>
  <li><code class="language-plaintext highlighter-rouge">output.weight</code> (896 × 151936) -&gt; <strong>Q8_0</strong></li>
  <li><code class="language-plaintext highlighter-rouge">blk.0.ffn_down.weight</code> (4864 × 896) -&gt; <strong>Q6_K</strong></li>
  <li><code class="language-plaintext highlighter-rouge">blk.0.attn_v.weight</code> (896 × 128) -&gt; <strong>Q8_0</strong></li>
  <li><code class="language-plaintext highlighter-rouge">blk.0.attn_q.weight</code> (896 × 896) -&gt; <strong>Q5_0</strong></li>
</ul>

<p>هل تلاحظ النمط؟ لم تظهر المصفوفات التي تحمل تكميم K (Q4_K، Q6_K) إلا حيث كان عدد الأعمدة <code class="language-plaintext highlighter-rouge">ne[0]</code> يساوي 4864، كما في <code class="language-plaintext highlighter-rouge">ffn_down</code>. والرقم 4864 قابل للقسمة على 256 (19 × 256). أما معظم المصفوفات الأخرى فعدد أعمدتها <code class="language-plaintext highlighter-rouge">ne[0]</code> يساوي 896، والرقم 896 غير قابل للقسمة على 256 (3.5 × 256). لذلك لم تتمكن هذه المصفوفات من استخدام تكميم K إطلاقا وعادت جميعها إلى الفئة القديمة Q5_0. وإذا أضفنا إلى ذلك رفع الدقة (Q5_0، Q8_0) للمصفوفات الحساسة للجودة مثل التضمين (embedding) والمخرجات وقيمة الانتباه (attention value)، نحصل على ملف موسوم بـ <code class="language-plaintext highlighter-rouge">Q4_K_M</code> لكن جوهره الفعلي كتل تتراوح بين 5.5 و8.5 بت.</p>

<p>هذا بالضبط مصدر عرض البت الفعلي البالغ 6.16. يحتوي هذا الملف على ما مجموعه 630 مليون وزن خاضع للتكميم، مخزنة في نحو 485 ميجابايت من البايتات. 485,452,288 بايت × 8 ÷ 630,167,424 وزنا = 6.16 بت لكل وزن. وبإضافة نحو 6 ميجابايت من البيانات الوصفية للملف وحشو المحاذاة (alignment padding)، تتطابق النتيجة تماما مع حجم الملف الفعلي البالغ 491 ميجابايت. وتطابق الحساب مع حجم الملف هو أيضا دليل على دقة قراءة أنواع المصفوفات.</p>

<p>هذا يفسر أيضا النقطتين الغريبتين في جدول أحجام الملفات. السبب في أن Q2_K (415 ميجابايت) أصغر بالكاد من Q4_0 (429 ميجابايت) هو أن مصفوفات التضمين والمخرجات في هذا النموذج الصغير تشكل حصة كبيرة من إجمالي الأوزان، وهي تبقى بدقة عالية عند أي مستوى تكميم. مهما خفضت عدد البتات، تبقى تكلفة ثابتة في القاع لا تنخفض. أما سبب كون <code class="language-plaintext highlighter-rouge">Q4_K_M</code> أكبر من <code class="language-plaintext highlighter-rouge">Q4_0</code> النقي ذي 4 بت، فهو أن الإعداد المسبق <code class="language-plaintext highlighter-rouge">M</code> دفع ثمن رفع المصفوفات الحساسة إلى Q6_K وQ8_0 على شكل زيادة في حجم الملف. رقم التسمية أقل، لكن عرض البت الفعلي أعلى في الواقع.</p>

<p>وباختصار، أظهرت هذه التجربة من خلال القياس ثلاث حقائق. أولا، تشير التسمية على مستوى الملف إلى النوع السائد فقط ولا تضمن عرض البت الفعلي. ثانيا، في النماذج الصغيرة التي لا يكون فيها الحجم المخفي (hidden size) من مضاعفات 256، يتعطل تكميم K إلى حد كبير، مما يوسع الفجوة بين التسمية والجوهر. ثالثا، تشكل مصفوفات التضمين والمخرجات في النماذج الصغيرة حصة كبيرة من إجمالي السعة، وبمجرد الاحتفاظ بها بدقة عالية، تتضاءل بشكل كبير وفورات “التكميم الرباعي البت” المفترضة.</p>

<h2 id="الدلالات-على-منتجات-thakicloud">الدلالات على منتجات ThakiCloud</h2>

<p>اقتصرت هذه التجربة على تشريح نموذج صغير واحد، لكن دروسها تنتقل مباشرة إلى بنية الخدمة الإنتاجية التحتية. تقدم منصة ai-platform التابعة لـ ThakiCloud النماذج لبيئات عملاء متنوعة فوق Kubernetes وجدولة موارد GPU القائمة على Kueue. وفي هذا السياق، فإن “أي تكميم نختار” ليس مسألة ذوق، بل قرار يحدد تخصيص ذاكرة GPU، وحجم الدُفعة (batch)، وفي النهاية التكلفة لكل رمز (token).</p>

<p>الثقة بالتسمية كما هي تخل بتخطيط السعة. إذا افترضت أن <code class="language-plaintext highlighter-rouge">Q4_K_M</code> يعني “4 بت، إذن ربع الحجم الأصلي” وخصصت ذاكرة GPU على هذا الأساس، فستجد، كما في التجربة أعلاه، أنه يستهلك فعليا نحو 40 بالمئة من الأصل، وتنفد فتحات الدُفعات أسرع مما هو متوقع. يهم هذا الأمر بشكل خاص في الخدمة متعددة المستأجرين (multi-tenant)، حيث يجب حشر العديد من النماذج الصغيرة بكثافة على عقدة واحدة. وهناك، فإن الفرق بين قياس عرض البت الفعلي فعليا والاكتفاء بالثقة بالتسمية ينعكس مباشرة على عدد النماذج التي يمكن للعقدة استيعابها. لهذا السبب بالتحديد نتحقق من ملفات GGUF مصفوفة تلو الأخرى عند بناء صور الخدمة (serving images). وبالنسبة للعملاء الذين يتطلبون استضافة ذاتية أو نشرا محليا أو سياديا على وجه الخصوص، تتحول عادة القياس هذه بدلا من الافتراض إلى ميزة تنافسية حقيقية من حيث التكلفة.</p>

<p>جعل هذا التحقق نفسه مهمة قابلة للتكرار هو دور Paxis. وPaxis هي منصة التحكم الخاصة بـ ThakiCloud للسحابة الأصلية للوكلاء (Agent-Native Cloud) التي تعمل فوق ai-platform، وتتعامل مع المهارات والأدوات والسياسات وسجلات التدقيق كموارد من الدرجة الأولى. فإذا تم تسجيل تجربة اليوم، أي تحميل ملف GGUF وتجميع أنواع المصفوفات وإطلاق تحذير عند تجاوز عرض البت الفعلي حدا معينا، كمهارة واحدة، فإنها تعمل في بيئة معزولة (sandbox) وتمر جميع النتائج عبر بوابات السياسات وسجلات التدقيق. وبدلا من أن يفتح شخص الملف يدويا في كل مرة يصل فيها نموذج جديد إلى السجل، يعمل هيكل معتمد (validated skeleton) تلقائيا. هكذا يترابط الاقتصاد الذي تخلقه الخدمة منخفضة التكلفة (ai-platform) مع التنسيق (Paxis) الذي يجعل تلك الخدمة قابلة للتكرار بأمان.</p>

<h2 id="القيود-والحجج-المضادة">القيود والحجج المضادة</h2>

<p>هناك بعض النقاط التي يجب توضيحها بشكل صريح.</p>

<p>أولا، هذه النتائج تقترب من حالة قصوى خاصة بنموذج Qwen2.5-0.5B الذي يبلغ حجمه المخفي 896. أما في النماذج الأكبر التي يكون فيها الحجم المخفي من مضاعفات 256 (مثل 4096 أو 8192)، فإن تكميم K يُطبق بشكل طبيعي، ويقترب عرض البت الفعلي لـ <code class="language-plaintext highlighter-rouge">Q4_K_M</code> كثيرا من التسمية، عند نحو 4.8 بت.</p>

<p>بعبارة أخرى، الدرس الصحيح ليس أن “التسمية كذبة دائما”، بل أن “الفجوة بين التسمية والجوهر تختلف بشكل كبير حسب بنية النموذج، وتكون أكبر كلما كان النموذج أصغر”.</p>

<p>ثانيا، ليس بالضرورة أن يكون حجم الملف الكبير أمرا سيئا. فالاحتفاظ بمصفوفات التضمين والمخرجات بدقة عالية هو خيار متعمد لمنع انهيار الجودة في النماذج الصغيرة. بعبارة أخرى، ملف <code class="language-plaintext highlighter-rouge">Q4_K_M</code> هذا ليس ملفا “سيء الصنع”، بل هو نتيجة منطقية لرفع الدقة تلقائيا للحفاظ على الجودة في نموذج صغير. غير أن هذا الثمن لا يظهر في التسمية.</p>

<p>ثالثا، اقتصر هذا المقال على قياس بنية الملف وسعته، ولم يقس جودة الاستدلال الفعلية (الحيرة اللغوية perplexity، أو نتائج المعايير القياسية). وتتطلب العلاقة بين عرض البت والجودة تجربة منفصلة، نتركها موضوعا لمقال قادم. وما يمكن قوله هنا هو مبدأ تشغيلي واحد فقط: لا تخطط للسعة والذاكرة استنادا إلى التسمية، بل قسها فعليا.</p>

<p>الفرق بين الاكتفاء بالضغط على زر تشغيل نموذج محلي ومعرفة ما بداخل الملف فعليا يكمن بالضبط في عادة القياس هذه. خمس دقائق تقضيها في التحقق من الأرقام وراء التسمية يمكن أن تغير دقة خطة تكلفة الخدمة بأكملها.</p>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li>مستودع نموذج Qwen2.5-0.5B-Instruct-GGUF: <a href="https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF">huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF</a></li>
  <li>وثائق التكميم في llama.cpp: <a href="https://github.com/ggml-org/llama.cpp/blob/master/tools/quantize/README.md">github.com/ggml-org/llama.cpp</a></li>
  <li>تم قياس أحجام الملفات وتوزيعات أنواع المصفوفات وعروض البت الفعلية مباشرة من ملفات فعلية تم تحميلها من المستودع أعلاه.</li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="llmops" /><category term="quantization" /><category term="gguf" /><category term="llama-cpp" /><category term="llmops" /><category term="self-hosting" /><category term="vllm" /><category term="paxis" /><summary type="html"><![CDATA[هناك فرق حقيقي بين من يحمل ملف GGUF من Hugging Face ويضغط زر التشغيل فقط، ومن يعرف بالضبط أي المصفوفات (tensors) مخزنة وبكم بت داخل ذلك الملف. قمنا فعليا بتحميل ملف Q4_K_M لنموذج Qwen2.5-0.5B وفتحناه مصفوفة تلو الأخرى. وعلى الرغم من الاسم، لم تشكل مصفوفات Q4_K الحقيقية ذات 4 بت سوى 6 بالمئة من الملف، وكان عرض البت الفعلي ليس 4 بل 6.16. يشرح هذا المقال سبب حدوث ذلك، بالاستناد إلى بيانات مقاسة فعليا حول بنية الكتل الفائقة (superblock) في تكميم K وقاعدة القسمة على 256.]]></summary></entry><entry xml:lang="ar"><title type="html">تذكّر القرار لا الوصف: دراسة بمشاركة Meta تعيد صياغة ذاكرة الوكلاء كمسألة rate-distortion</title><link href="https://thakicloud.github.io/ar/research/demem-agent-memory/" rel="alternate" type="text/html" title="تذكّر القرار لا الوصف: دراسة بمشاركة Meta تعيد صياغة ذاكرة الوكلاء كمسألة rate-distortion" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/research/demem-agent-memory</id><content type="html" xml:base="https://thakicloud.github.io/ar/research/demem-agent-memory/"><![CDATA[<p><img src="/assets/images/demem-agent-memory-hero.png" alt="رسم تجريدي يصوّر ذكريات تتفرّع إلى مسارات منفصلة تؤدي إلى قرارات مختلفة" /></p>

<blockquote>
  <p>📄 <strong>المراجعة المتعمقة الكاملة (DOCX)</strong>: <a href="https://drive.google.com/file/d/1oxsADQALTfdn7I_mmZbaZfMnmqoCMF9o/view">نزّل المراجعة التفصيلية من Google Drive</a>.</p>
</blockquote>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>كل من شغّل وكيلاً حوارياً لفترة طويلة رأى هذا الفشل من قبل. تفضيل أو قرار أعلنه المستخدم بوضوح قبل أيام ينساه الوكيل في لحظة ما، ويتصرف على عكسه. نافذة السياق محدودة، وعندما تطول المحادثة بما يكفي، يجب ضغط جزء من الماضي أو التخلص منه. السؤال الحقيقي هو: ماذا نتخلص منه؟</p>

<p>أجابت ذاكرة الوكلاء حتى الآن على هذا السؤال في الغالب بمعايير <strong>وصفية</strong>: هل هذا مرتبط بالموضوع؟ هل هو بارز؟ هل يُلخَّص بشكل جيد؟ تجادل هذه الورقة، “Remember the Decision, Not the Description” (arXiv 2605.10870)، التي شارك في تأليفها باحث من Meta AI، بأن هذا المعيار نفسه خاطئ. هذا المقال موجّه للمهندسين والباحثين الذين يصممون وكلاء الذكاء الاصطناعي، وللفرق التي تحتاج إلى وضع ذاكرة طويلة المدى في الإنتاج. نلخّص هنا إعادة الصياغة الجوهرية للورقة والنتائج التجريبية الداعمة لها، ونستعرض كيف ينطبق هذا المبدأ على Paxis، منصة الوكلاء لدى ThakiCloud.</p>

<h2 id="أين-تكمن-المشكلة">أين تكمن المشكلة</h2>

<p>ينطلق المؤلفون من رؤية بسيطة. الذاكرة قيّمة للوكيل ليس لأنها تصف الماضي بأمانة، بل لأنها <strong>تحافظ على الفصل بين تاريخَين يتطلبان سلوكَين مختلفَين حتى ضمن ميزانية ثابتة</strong>.</p>

<p>لنأخذ مثالاً بسيطاً. قال المستخدم بالأمس: “يجب ألا يتم هذا النشر إلا بعد موافقة يدوية”. واليوم، في سياق مشابه، قال: “يمكن تشغيل هذا السكربت تلقائياً”. العبارتان متشابهتان جداً في ظاهرهما. تتقاطعان في كلمات مثل النشر والتنفيذ والموافقة، وعند تلخيصهما تصبحان تقريباً نفس الجملة. من السهل أن تدمج الذاكرة القائمة على الصلة هاتين الحالتين في كتلة واحدة توصف بـ”تعليمات متعلقة بالنشر”. في تلك اللحظة يفقد الوكيل القدرة على تمييز أي تعليمة تنطبق على أي موقف، ويرتكب خطأ دفع نشر يتطلب موافقة يدوية بشكل تلقائي. الملخّص صحيح وصفياً، لكن الدمج قاتل من حيث القرار.</p>

<p>نمط الفشل الملموس هو كالتالي. موقفان يبدوان متشابهَين نصياً لكنهما في الواقع يتطلبان إجراءَين متعارضَين. عندما تكون ميزانية الذاكرة ضيقة، يصبح الضغط ضرورياً، والضغط يستدعي حتماً الدمج. إذا نظرنا فقط إلى التشابه الوصفي، سيُدمج هذان الموقفان في واحد. والنتيجة أن الوكيل يتخذ قراراً خاطئاً باستمرار كلما وصل إلى تلك الحالة. الصلة أو جودة التلخيص لا تجيبان عن السؤال الحقيقي، وهو: هل يمكن دمج هذين حقاً؟ المعيار يجب ألا يكون ما يبدو متشابهاً، بل ما يتطلب سلوكاً مختلفاً.</p>

<h2 id="الفكرة-الجوهرية-rate-distortion-محوره-القرار">الفكرة الجوهرية: rate-distortion محوره القرار</h2>

<p>ينقل المؤلفون هذه المشكلة إلى إطار نظرية المعلومات الخاص بـ rate-distortion. تتناول نظرية rate-distortion أصلاً مقدار التشويه (distortion) الناتج عن قدر معين من الضغط (rate)، والخطوة المحورية هنا هي إعادة تعريف التشويه نفسه. بدلاً من أن يكون التشويه خطأ إعادة بناء الإشارة، يُعرَّف كـ <strong>الخسارة في جودة القرار القابلة للتحقيق نتيجة الضغط (decision loss)</strong>.</p>

<pre><code class="language-mermaid">flowchart TB
    A["تاريخ تفاعل طويل&lt;br/&gt;(ميزانية ذاكرة ثابتة)"] --&gt; B{"هل ندمج الموقفين؟"}
    B --&gt; C["معيار محوره الوصف&lt;br/&gt;الصلة، البروز، جودة التلخيص"]
    B --&gt; D["معيار محوره القرار&lt;br/&gt;هل تسبب الحالة المشتركة تعارضاً في القرار"]
    C --&gt; E["الدمج إذا بدا الموقفان متشابهَين&lt;br/&gt;-&gt; دمج سلوكَين متعارضَين في واحد"]
    E --&gt; F["أخطاء قرار مستمرة"]
    D --&gt; G["الفصل فقط عند إثبات تعارض القرار&lt;br/&gt;certified refinement"]
    G --&gt; H["حدّ نسيان دقيق (exact forgetting boundary)&lt;br/&gt;+ حدود memory-distortion frontier"]
    H --&gt; I["جودة قرار أفضل عند نفس الميزانية"]
</code></pre>

<p>إليكم تشبيهاً. عند ضغط الصوت، نتخلص أولاً من الترددات التي لا تسمعها الأذن البشرية، لأن معيار التشويه هو “ما يسمعه الإنسان”. يرى المؤلفون أن ذاكرة الوكلاء يجب أن تعمل بالطريقة نفسها. ما يجب التخلص منه ليس “الذكرى التي تبدو أقل صلة”، بل “الذكرى التي لن يتغير أي قرار مستقبلي لو حذفناها”. هنا، rate هو ميزانية الذاكرة، وdistortion هو خسارة القرار التي يسببها هذا الضغط. إذا لم يؤدِّ دمج موقفَين في نفس الخانة إلى أي قرار خاطئ مستقبلاً، فإن هذا الدمج مجاني. وعلى العكس، إذا كان الدمج يطمس سلوكَين متعارضَين، فهو تشويه باهظ الثمن.</p>

<p>يترتب على هذا التعريف أمران. أولاً، <strong>حد النسيان الدقيق (exact forgetting boundary)</strong>، الذي يحدد بدقة حدود ما يمكن نسيانه بأمان دون الإضرار بجودة القرار. ثانياً، <strong>حدود memory-distortion frontier</strong>، التي تصف منحنى المفاضلة الأمثل بين ميزانية الذاكرة وجودة القرار. بعبارة أخرى، تضع الورقة نظرياً حداً أدنى مفاده: “إذا خفّضت الميزانية بهذا القدر، فستنخفض جودة القرار حتماً بمقدار لا يقل عن كذا”.</p>

<h2 id="demem-تحويل-النظرية-إلى-خوارزمية">DeMem: تحويل النظرية إلى خوارزمية</h2>

<p>DeMem هي التي تنقل هذه النظرية إلى ذاكرة وكيل فعلية قائمة على الخانات (slots). DeMem خوارزمية تعلّم ذاكرة عبر الإنترنت (online)، وتعمل وفق مبدأ واحد: <strong>لا تُقسِّم قسمة الذاكرة (partition) إلا عندما تُثبت البيانات (certify) أن حالة مشتركة تسبب تعارضاً في القرار.</strong></p>

<p>كلمة “تُثبت” هنا مهمة. لا يُفصل الموقفان بمجرد أن يبدوا مختلفَين، بل يُفصلان فقط بعد أن تتراكم أدلة فعلية على أن نفس حالة الذاكرة تتطلب قرارَين مختلفَين. وعلى العكس، إذا لم تتوفر مثل هذه الأدلة، يُبقى على الدمج توفيراً للميزانية. هذا التحفظ هو جوهر الطريقة. الفصل المتسرع يهدر الميزانية ولا يترك مكاناً للتمييزات المهمة فعلاً، بينما الدمج المتسرع يطمس سلوكيات متعارضة. certified refinement هو الانضباط الذي ينتظر، بين هذين الحدين، حتى تتحدث البيانات. يثبت المؤلفون أن هذا الإجراء يحقق ضماناً من نوع near-minimax regret، أي أن الندم (regret) بالمقارنة مع الأمثل يظل، حتى في أسوأ الحالات، مقيداً قريباً من الحد النظري.</p>

<p>يتحقق المؤلفون من هذه الآلية على مستويَين. أولاً، في بيئة تشخيصية اصطناعية، يصممون مهاماً يتعمدون فيها جعل التشابه الوصفي والتشابه القراري متباعدَين. هنا، تستمر المعايير الوصفية فقط في دمج المواقف المتشابهة ظاهرياً، مما يراكم الندم، بينما يتجنب DeMem هذا الفخ بالفصل فقط عند إثبات تعارض القرار. بعد ذلك، يتحققون مما إذا كانت هذه الأفضلية تنتقل إلى معايير قياس محادثات طويلة المدى فعلية، عبر نماذج تجارية ونماذج مفتوحة الأوزان على حد سواء. هذا البناء الذي ينطلق من النظرية، ويمر عبر تحقق آلي مضبوط، وينتهي عند معايير قياس واقعية، يحوّل النتائج إلى تفسير لـ”لماذا يفوز”، لا مجرد جدول أداء.</p>

<h2 id="نتائج-التجارب">نتائج التجارب</h2>

<p>في التشخيص الاصطناعي، سجّل DeMem أدنى ندم تراكمي (cumulative regret) بين جميع الأساليب المتساوية في الميزانية، واتسعت الأفضلية كلما زادت الفجوة بين التشابه الوصفي والتشابه القراري. بينما استمرت المعايير الوصفية فقط في دمج المواقف المتعارضة منتجةً أخطاء مستمرة، تجنّب DeMem ذلك بالفصل فقط عند إثبات تعارض القرار.</p>

<p>استمرت النتائج في معايير القياس الفعلية أيضاً. فيما يلي القيم المقاسة للدرجة الإجمالية على LoCoMo (بنموذج GPT-4.1-mini الأساسي).</p>

<table>
  <thead>
    <tr>
      <th>الطريقة</th>
      <th>Overall</th>
      <th>Temporal</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>DeMem</strong></td>
      <td><strong>0.921</strong></td>
      <td><strong>0.908</strong></td>
    </tr>
    <tr>
      <td>Mnemis</td>
      <td>0.891</td>
      <td>0.858</td>
    </tr>
    <tr>
      <td>EMem-G</td>
      <td>0.757</td>
      <td>0.660</td>
    </tr>
    <tr>
      <td>Nemori</td>
      <td>0.731</td>
      <td>0.454</td>
    </tr>
    <tr>
      <td>RAG</td>
      <td>0.710</td>
      <td>0.634</td>
    </tr>
    <tr>
      <td>FullContext</td>
      <td>0.692</td>
      <td>0.511</td>
    </tr>
    <tr>
      <td>Zep</td>
      <td>0.554</td>
      <td>0.383</td>
    </tr>
    <tr>
      <td>Mem0</td>
      <td>0.514</td>
      <td>0.428</td>
    </tr>
  </tbody>
</table>

<p>حقق DeMem أفضل درجة إجمالية، وكان قوياً بشكل خاص في فئات Temporal وOpen-Domain وMulti-Hop، حيث يكون الحفاظ على التمييز بين تفاعلات بعيدة زمنياً أمراً حاسماً. أما في فئة Single-Hop، التي تتعلق باسترجاع حقيقة واحدة، فقد تفوّق Mnemis (0.940) على DeMem (0.935) بفارق ضئيل، وهو ما يتفق مع تفسير أن فائدة الفصل المحوري بالقرار تكون أصغر في الاسترجاع أحادي الخطوة. وفي LongMemEval أيضاً، حقق DeMem أفضل متوسط درجات على كلا النموذجَين الأساسيَين، وكانت أكبر المكاسب في الفئات التي تتطلب دمجاً عبر جلسات متعددة. والأهم أن الأفضلية استمرت حتى على النموذج مفتوح الأوزان Llama-3.1-70B، مما يدل على أن هذه الميزة ليست مرتبطة بنموذج تجاري معين.</p>

<h2 id="دلالات-على-منتجات-thakicloud">دلالات على منتجات ThakiCloud</h2>

<p>تلتقي رؤية هذه الورقة تماماً مع تصميم الذاكرة في Paxis، مستوى التحكم لمنصة Agent-Native Cloud لدى ThakiCloud. Paxis هو مستوى تحكم يعمل فوق ai-platform ويتعامل مع المهارات (skills) والأدوات والسياسات وسجلات التدقيق كموارد من الدرجة الأولى، وضمن ذلك يحدد محرك المعرفة وطبقة الذاكرة يومياً ما الذي يُدمج وما الذي يُفصل.</p>

<p>أولاً، يمكن نقل معيار الدمج في محرك معرفة HKE Wiki ليصبح محورياً بالقرار. إذا دُمجت العناصر المتشابهة بمجرد التشابه النصي، فهناك خطر أن تُدمج حالتان تتطلبان إجراءَين متعارضَين في واحدة. وضع بوابة قبل الدمج مباشرة تسأل “هل يسبب هذان الأمران سلوكَين مختلفَين؟” هو نقل مباشر لمبدأ certified refinement في هذه الورقة.</p>

<p>ثانياً، يمنح هذا أساساً نظرياً لإدارة ميزانية الذاكرة الساخنة المقيمة في الجلسة (session-resident hot memory). الذاكرة الساخنة تفرض بالفعل ميزانيتها بحد أقصى من الأحرف، ومحاذاة معيار ما يُبقى وما يُحذف مع مبدأ “الحفاظ على التمييزات المؤثرة في القرار” يرفع جودة التقليم (pruning). أي إعطاء الأولوية للعناصر التي تفرّق بين القرارات، لا العناصر التي تُلخَّص بسلاسة.</p>

<p>ثالثاً، تُعد بوابات السياسات وسجلات التدقيق التي يخلّفها Paxis مصدر بيانات طبيعياً لإثبات لاحقاً أن “نفس الحالة أفضت إلى قرار مختلف”. إذا كان تشغيل certified refinement عبر الإنترنت لدى DeMem في الوقت الفعلي صعباً، يمكن اتباع مسار عملي بتحليل سجلات التدقيق هذه على دفعات غير متصلة (offline) وتحديث سياسة الدمج والفصل بشكل دوري. وهنا يلتقي مبدأ الذاكرة المحورية بالقرار مع التنسيق (orchestration) القائم على التدقيق الذي يجعل هذا المبدأ قابلاً للتكرار بأمان.</p>

<h2 id="القيود-والاعتراضات">القيود والاعتراضات</h2>

<p>لا بد من توضيح بعض النقاط.</p>

<p>أولاً، الإثبات (certify) له تكلفة. إثبات تعارض القرار من البيانات يتطلب تراكم ملاحظات، وفي بيئات البداية الباردة (cold start) أو التفاعل النادر، يتأخر الفصل، ولذلك يصعب الحكم من نص الورقة وحده على مصير جودة القرار في المراحل المبكرة.</p>

<p>ثانياً، تقدير “خسارة جودة القرار” عبر الإنترنت في بيئة الإنتاج يتطلب إشارة مكافأة أو حكماً (judge). تملك معايير القياس إجابات صحيحة تجعل الحصول على هذه الإشارة سهلاً، لكن كيفية تأمين هذه الإشارة في محادثات فعلية بلا إجابة صحيحة تبقى مهمة قادمة. قد يكون استخدام سجلات التدقيق المقترح أعلاه أحد الحلول، لكن ذلك خارج نطاق الورقة.</p>

<p>ثالثاً، يتضمن الملحق إثباتاً لصعوبة حسابية (computational hardness)، وهو ما يعني أن إيجاد القسمة (partition) المثلى صعب بشكل عام. DeMem هو تقريب عملي لذلك، وتلزم حدود إضافية حول الشروط التي ينهار عندها هذا التقريب.</p>

<p>ومع ذلك، فإن المبدأ نفسه، وهو نقل ذاكرة الوكيل من الوصف إلى القرار، بسيط وقوي، ويستحق النظر في تبنّيه الآن. إذا كان الوكيل ينسى باستمرار قراراته السابقة، فقد لا تكون المشكلة أن ذاكرته صغيرة، بل أن ذاكرته تحتفظ بالشيء الخطأ.</p>

<blockquote>
  <p>📄 <strong>المراجعة المتعمقة الكاملة (DOCX)</strong>: <a href="https://drive.google.com/file/d/1oxsADQALTfdn7I_mmZbaZfMnmqoCMF9o/view">نزّل المراجعة التفصيلية من Google Drive</a>.</p>
</blockquote>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li>الورقة: <a href="https://arxiv.org/abs/2605.10870">Remember the Decision, Not the Description: A Rate-Distortion Framework for Agent Memory (arXiv 2605.10870)</a></li>
  <li>معايير القياس: LoCoMo، LongMemEval / النماذج الأساسية: GPT-4o-mini، GPT-4.1-mini، Qwen2.5-14B-Instruct، Llama-3.1-70B</li>
  <li>الأرقام في الجدول مقتبسة من الجدول 1 (LoCoMo، GPT-4.1-mini) في الورقة.</li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="research" /><category term="agent-memory" /><category term="rate-distortion" /><category term="long-horizon-agents" /><category term="llm-agents" /><category term="paxis" /><summary type="html"><![CDATA[تعمل الوكلاء طويلة المدى ضمن ذاكرة محدودة، لكن أساليب الذاكرة حتى الآن كانت تنظّم الماضي وفق معايير وصفية مثل الصلة أو جودة التلخيص. هذه الورقة، التي شارك في تأليفها باحث من Meta AI، تقول إن هذا المعيار نفسه خاطئ. قيمة الذاكرة لا تكمن في وصف الماضي بأمانة، بل في الفصل بين المواقف التي تتطلب سلوكيات مختلفة حتى ضمن ميزانية ثابتة. يصوغ المؤلفون هذه المسألة كمسألة rate-distortion محورها القرار، ويقترحون خوارزمية تعلّم باسم DeMem تتفوق باستمرار على الأساليب القائمة عند نفس ميزانية الذاكرة.]]></summary></entry><entry xml:lang="ar"><title type="html">التعلّم المعزز للوكلاء لا ينتظر المجموعة: التعلّم من rollout واحد فقط</title><link href="https://thakicloud.github.io/ar/research/sao-single-rollout-async-agentic-rl/" rel="alternate" type="text/html" title="التعلّم المعزز للوكلاء لا ينتظر المجموعة: التعلّم من rollout واحد فقط" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/ar/research/sao-single-rollout-async-agentic-rl</id><content type="html" xml:base="https://thakicloud.github.io/ar/research/sao-single-rollout-async-agentic-rl/"><![CDATA[<p>لم يعد الحديث عن صقل الوكلاء عبر التعلّم المعزز مصطلحاً مختبرياً بحتاً. فالنماذج التي تُتقن مهاماً مثل إصلاح قواعد الأكواد على مدى عشرات الجولات كما في SWE-Bench، أو حل البراهين الرياضية عبر خطوات متعددة، لا تُبنى في الغالب بالتدريب المسبق وحده. جوهر الأمر يكمن في مرحلة ما بعد التدريب (post-training)، حيث يُشغَّل الوكيل فعلياً باستخدام الأدوات والتفاعل مع البيئة عبر rollout يُمنح على أساسه المكافأة. لكن كلما طال هذا الـ rollout، بدأ أسلوب التدريب الذي كان يُستخدم كمعيار قياسي حتى الآن في الانهيار.</p>

<p>تتناول الورقة البحثية “Single-Rollout Asynchronous Optimization for Agentic Reinforcement Learning” (arXiv 2607.07508)، التي نشرها باحثون من جامعة تسينغهوا وشركة Z AI في 8 يوليو 2026، هذه النقطة مباشرة. والخلاصة أن الباحثين تخلّوا عن “أخذ العينات الجماعي” (group sampling)، وهو جوهر GRPO الشائع الاستخدام. ولم يقتصر الأمر على تجربة هذا الأسلوب في تجارب الورقة فحسب، بل طبّقوه فعلياً في خط أنابيب حقيقي لتدريب النموذج المفتوح GLM-5.2 البالغ حجمه 750B.</p>

<h2 id="نظرة-عامة">نظرة عامة</h2>

<p>سبب أهمية هذه الورقة الآن هو أن عنق الزجاجة في تكلفة التدريب انتقل من الخوارزمية إلى معدل استغلال البنية التحتية. فدوال الخسارة التي تجعل النموذج أكثر ذكاءً موجودة بالفعل بأشكال متعددة. المشكلة الحقيقية هي أنه حتى مع تشغيل مئات وحدات GPU معاً، يُنفَق معظم الوقت في “الانتظار” لإنتاج خطوة تدريب واحدة فقط.</p>

<p>تُشغّل ThakiCloud أيضاً خمس تقنيات لما بعد التدريب، هي SFT وCPT وDPO وGRPO وGKD، ضمن نظام تدريب نماذج اللغة الكبيرة المبني على kubeflow. لذلك فإن الثمن الذي يدفعه أخذ العينات الجماعي في GRPO عند التعامل مع rollouts طويلة، والمخاطر الجديدة التي قد يجلبها أي بديل يُزيل هذا الثمن، ليست قضية بعيدة عنا. يستعرض هذا المقال ما غيّرته SAO، وما تعنيه هذه التغييرات لمؤسسة مثلنا تسعى لتدريب وكلاء على عناقيد GPU متعددة المستأجرين (multi-tenant).</p>

<p><img src="/assets/images/sao-single-rollout-async-agentic-rl-hero.png" alt="صورة تجريدية تقابل بين تدفق rollouts يصل واحداً تلو الآخر بشكل غير متزامن وrollouts تنتظر مجمّعة في مجموعة" />
<em>تصوير تخيلي يقابل بين rollout واحد يصل تباعاً بشكل مستمر، وrollouts تتجمّد في قائمة الانتظار إلى أن تكتمل المجموعة بأكملها.</em></p>

<h2 id="ما-هي-هذه-التقنية">ما هي هذه التقنية؟</h2>

<p>يجمع اسم SAO، كما هو، بين مفهومين: “rollout واحد” (single-rollout) و”التحسين غير المتزامن” (asynchronous optimization).</p>

<p>كانت خطوط أنابيب التعلّم المعزز التقليدية متزامنة (synchronous). تُحدَّد دفعة من الطلبات، ويُولَّد لكل طلب عدد من الـ rollouts، وعندما تكتمل جميعها تُحسَب المكافأة ويُنفَّذ تحديث واحد للسياسة. نجح هذا الأسلوب جيداً في المهام التي تُنتج إجابات قصيرة، لأن أطوال الـ rollouts كانت متقاربة.</p>

<p>لكن المشكلة تظهر في مهام الوكلاء. فمهمة برمجية واحدة قد تنتهي خلال 3 جولات فقط، بينما تستمر مهمة مجاورة في استدعاء الأدوات عبر 40 جولة. وفي خط الأنابيب المتزامن، تبقى بقية وحدات GPU عاطلة حتى ينتهي أبطأ rollout في الدفعة. ظهر التعلّم المعزز غير المتزامن أصلاً لإزالة هذا الهدر: يُحدَّث النموذج فور اكتمال كل rollout، بينما يستمر المولّد (generator) دون توقف في إنتاج الـ rollout التالي.</p>

<pre><code class="language-mermaid">flowchart TB
    subgraph SYNC[GRPO المتزامن]
        A1[دفعة من الطلبات] --&gt; A2[توليد G من الـ rollouts&lt;br/&gt;لكل طلب كمجموعة]
        A2 --&gt; A3[الانتظار حتى اكتمال&lt;br/&gt;أبطأ rollout]
        A3 --&gt; A4[حساب المكافأة النسبية للمجموعة&lt;br/&gt;تحديث واحد للسياسة]
        A4 -.توقف GPU.-&gt; A2
    end
    subgraph SAO[SAO غير المتزامن]
        B1[توليد rollout واحد&lt;br/&gt;لكل طلب] --&gt; B2[وصول فوري&lt;br/&gt;عند الاكتمال]
        B2 --&gt; B3[كبح تحديثات off-policy&lt;br/&gt;عبر تقليم الرموز ثنائي الاتجاه]
        B3 --&gt; B4[تحديث مستمر للسياسة]
        B4 --&gt; B1
    end
    SYNC --&gt;|إزالة حاجز المجموعة| SAO
</code></pre>

<p>هنا ينشأ التعارض الجوهري. فاسم GRPO (Group Relative Policy Optimization) يحمل معنى “النسبية الجماعية” منذ البداية. تُجمَع عدة rollouts لطلب واحد في مجموعة واحدة، وتُقارَن داخل هذه المجموعة الـ rollouts الأفضل نسبياً بالأسوأ لحساب الأفضلية (advantage). وميزة GRPO، التي هي في الوقت نفسه قيدها، أنها تُنتج إشارة التدريب من المقارنة داخل المجموعة فقط دون الحاجة إلى دالة قيمة (critic) منفصلة. فإن لم تكتمل المجموعة، يستحيل حساب الأفضلية. وهكذا يتعارض جوهرياً البناء غير المتزامن الذي يتعلّم فور وصول كل rollout مع GRPO الذي يفرض الانتظار حتى تكتمل المجموعة.</p>

<h2 id="لماذا-لا-يتناسب-grpo-مع-التعلّم-غير-المتزامن">لماذا لا يتناسب GRPO مع التعلّم غير المتزامن؟</h2>

<p>لنتأمل هذا التعارض بمزيد من التفصيل. فللحفاظ على المجموعة داخل خط أنابيب غير متزامن، لا مفر من أحد خيارين سيئين.</p>

<p>الأول هو الانتظار على مستوى المجموعة، وحينها تتلاشى ميزة اللاتزامن، وينتهي الأمر بالعودة فعلياً إلى النمط المتزامن الذي ينتظر أبطأ rollout.</p>

<p>والثاني هو توليد rollouts المجموعة الواحدة بسياسات (policies) مختلفة زمنياً. فإذا أنتجت سياسة قديمة بعض rollouts المجموعة، وأنتجت سياسة مُحدَّثة بعد بضع خطوات rollouts أخرى ضمن المجموعة نفسها، فإن تجميعها ومقارنتها نسبياً كمجموعة واحدة يصبح ملوّثاً إحصائياً من الأساس. فحين تتفاوت درجة off-policy من rollout إلى آخر، لكنها تُعامَل كأنها baseline واحد متجانس، يصبح التدريب غير مستقر.</p>

<p>إجابة SAO بسيطة: إلغاء المجموعة تماماً. يُولَّد rollout واحد فقط لكل طلب، وحالما يصل يُستخدَم مباشرة في التدريب. وبزوال حاجز المجموعة، لا يضطر المولّد إلى الانتظار إطلاقاً، فيتقلّص وقت خمول GPU بشكل كبير.</p>

<h2 id="ركيزتا-sao-rollout-واحد-وتقليم-الرموز-ثنائي-الاتجاه">ركيزتا SAO: rollout واحد وتقليم الرموز ثنائي الاتجاه</h2>

<p>لكن إلغاء المجموعة يعني فقدان ما كانت GRPO تحصل عليه مجاناً. فالمقارنة داخل المجموعة كانت تلعب بحد ذاتها دور baseline يُقلّل التباين. وحين يكون هناك rollout واحد فقط، يختفي معيار المقارنة القائم على “هل تفوّق هذا الـ rollout على متوسط المجموعة؟”. فضلاً عن ذلك، في البنية غير المتزامنة تنشأ فجوة زمنية بين السياسة التي أنتجت الـ rollout والسياسة التي يُراد تحديثها الآن. وهذه الفجوة، أي مشكلة off-policy، هي الخطر الثاني الذي يهدد استقرار التدريب.</p>

<p>تتصدى SAO لمشكلة الاستقرار هذه عبر “تقليم صارم ثنائي الاتجاه على مستوى الرمز” (strict double-side token-level clipping). فالتقليم (clipping) الذي كانت تستخدمه عائلة PPO أصلاً هو آلية تقصّ التدرّج (gradient) عندما تخرج نسبة الأهمية (importance ratio) عن نطاق محدد. وتُطبّق SAO هذا التقليم على مستوى كل رمز (token) على حدة، وبصرامة في الاتجاهين الأعلى والأسفل معاً. فعند الرموز التي تباعدت فيها rollout السياسة القديمة كثيراً عن السياسة الحالية، يُكبَح التحديث بقوة، مما يمنع الإشارات ذات الفجوة الزمنية الكبيرة من إفساد التدريب.</p>

<p>ونتيجة هذا المزيج، تُفيد الورقة بأن SAO واصلت التدريب باستقرار على مدى 1,000 خطوة. وإذا أخذنا بعين الاعتبار أن حالات التباعد أو الانهيار شائعة في التعلّم المعزز غير المتزامن بعد تجاوز بضع مئات من الخطوات، فإن استقرار التدريب لـ 1,000 خطوة يُعدّ دليلاً داعماً للمزاعم الأساسية لهذه الطريقة.</p>

<h2 id="النتائج-الفعلية-والتحقق">النتائج الفعلية والتحقق</h2>

<p>قارنت الورقة SAO بـ GRPO ومتغيراتها، وأفادت بتفوّقها باستمرار في معايير قياس الترميز والاستدلال الخاصة بالوكلاء. والمعايير المذكورة هي SWE-Bench Verified (حل مشكلات GitHub الحقيقية)، وBeyondAIME (رياضيات عالية الصعوبة)، وIMOAnswerBench (رياضيات بمستوى الأولمبياد). وتشترك المعايير الثلاثة في كونها مهام متعددة الخطوات وطويلة النَفَس، وليست إجابات قصيرة مباشرة، وهو بالضبط المجال الذي تستهدفه SAO.</p>

<p>أما التحقق الأكثر إقناعاً فليس في جداول المعايير، بل في واقعة النشر ذاتها. فقد استُخدِمت SAO في خط أنابيب فعلي للتعلّم المعزز للوكلاء لتدريب النموذج المفتوح GLM-5.2 (نموذج MoE بحجم إجمالي 750B وحجم فعّال 40B من المعاملات النشطة، 750B-A40B). وكون طريقة بحثية لم تبقَ حبيسة الورقة العلمية، بل استُخدِمت في تدريب إنتاجي لنموذج بحجم مئات المليارات، إشارة قوية على أن هذه الطريقة تصمد عند المقياس الحقيقي، لا في إعدادات تجريبية صغيرة فقط.</p>

<p>غير أن هذا المقال لا يقتبس الأرقام التفصيلية للمعايير. فإن تعذّر إعادة إنتاج الأرقام الدقيقة التي تحقّق منها النص الأصلي في هذا المكان، فالأمانة تقتضي نقل بنية الطريقة وأسماء المعايير المذكورة صراحة دون اختلاق أي رقم. ومن يحتاج إلى الدرجات الدقيقة، فليرجع إلى النص الأصلي أدناه مباشرة.</p>

<h2 id="دلالات-التطبيق-على-منتجات-thakicloud">دلالات التطبيق على منتجات ThakiCloud</h2>

<p>لا يقتصر درس SAO على كونه ورقة خوارزمية واحدة، بل يمسّ مباشرة طريقة تشغيل عناقيد GPU.</p>

<p><strong>عدسة ai-platform (البنية التحتية لتدريب GPU).</strong> تجدول منصة ai-platform التابعة لـ ThakiCloud تدريب GPU متعدد المستأجرين فوق Kubernetes وKueue. ونظام تدريب نماذج اللغة الكبيرة المبني على kubeflow يدعم بالفعل GRPO كأحد تقنيات ما بعد التدريب. والسؤال الذي تطرحه SAO واضح: كم يتراجع معدل استغلال GPU في مهام تدريبنا بسبب التفاوت في أطوال الـ rollouts؟ ففي المهام المتفاوتة الطول كـ rollouts الوكلاء، يتحوّل انتظار المجموعة المتزامن إلى تكلفة مباشرة. وفصل توليد الـ rollouts غير المتزامن عن التدريب يتيح استخلاص خطوات تدريب فعّالة أكثر من العدد نفسه من وحدات GPU، وهو ما يشكّل رافعة مباشرة لخفض تكلفة التدريب لكل مستأجر في بيئة متعددة المستأجرين. كما أن التحقق مما إذا كانت جدولة gang scheduling وإدارة الطوابير في Kueue تفرض نمط “الانتظار حتى تكتمل المجموعة” يُعدّ نقطة تحسين عملية أخرى.</p>

<p><strong>عدسة Paxis (نتاج تدريب الوكلاء).</strong> Paxis، وهي منصة Agent-Native Cloud التابعة لـ ThakiCloud، مستوى تحكّم يُشغّل المهارات (skills) في صناديق رملية معزولة (sandbox) ويمرّر كل سلوك عبر بوابات سياسات وسجلات تدقيق. والوكيل الذي تسعى SAO لتدريبه جيداً، أي وكيل يستدعي الأدوات عبر جولات متعددة ويُصلح قواعد الأكواد، هو بالضبط عبء العمل الذي تُشغّله Paxis. بل إن آثار الوكلاء (agent traces) الفعلية التي تُولّدها Paxis داخل الصناديق الرملية المعزولة يمكن أن تكون بحدّ ذاتها مصدر rollouts للتعلّم المعزز غير المتزامن على غرار SAO. وبذلك تكتمل حلقة: تُنتج ai-platform الـ rollouts وتدرّب عليها بتكلفة منخفضة، وتُشغّل Paxis الوكيل الناتج بأمان، لتُولّد بدورها بيانات تدريب جديدة. إنها بنية تقوم فيها بنية التدريب منخفضة التكلفة (ai-platform) بدعم جدوى الوكلاء الاقتصادية (Paxis).</p>

<h2 id="القيود-والاعتراضات">القيود والاعتراضات</h2>

<p>قبل تبنّي هذه الطريقة دون تمحيص، ينبغي التوقف عند بضع نقاط.</p>

<p>أولاً، يتخلّى الـ rollout الواحد عن تقليل التباين الذي كانت توفّره المجموعة. وتُعوّض SAO عن ذلك بالتقليم، لكن التقليم بطبيعته آلية تقصّ إشارة التدريب. فالتقليم الصارم أكثر مما ينبغي قد يُلقي حتى بالتدرّجات الصالحة، مما يُبطئ التدريب. ونقطة التوازن بين “الاستقرار” و”سرعة التعلّم” قابلة للتغيّر بشكل كبير تبعاً للمهمة والمقياس.</p>

<p>ثانياً، التحقق عبر تدريب نموذج بحجم 750B مثير للإعجاب، لكن نجاحه عند هذا المقياس لا يعني أنه الأمثل بالضرورة في إعدادات المؤسسات الصغيرة. فخط الأنابيب غير المتزامن يتطلّب تعقيداً إضافياً في البنية التحتية لفصل المولّد عن المدرّب. وبالنسبة للفرق التي تُجري ضبطاً دقيقاً قصيراً بعدد محدود من الـ rollouts، قد يكون GRPO المتزامن أبسط وكافياً.</p>

<p>ثالثاً، توجد مقاربات نشطة في الاتجاه المعاكس أيضاً. فقد ظهرت في الفترة نفسها دراسة تتناول العلاقة بين staleness ومعدل التعلّم في RLHF غير المتزامن عبر قوانين تحجيم (scaling laws) (arXiv 2607.01083)، كما ظهرت مقاربات تُثبّت التدريب غير المتزامن عبر محاذاة التدرّجات (gradient alignment). ولذلك فالأدق أن نعتبر مبدأ SAO القائم على “إلغاء المجموعة وكبح ذلك بالتقليم” واحداً من عدة إجابات قوية محتملة على مسألة مفتوحة هي التعلّم المعزز غير المتزامن للوكلاء، لا الإجابة الوحيدة الصحيحة.</p>

<p>ومع ذلك، فإن إسهام SAO واضح. فقد حدّدت المشكلة بدقة (عدم كفاءة أخذ العينات الجماعي عند طول الـ rollouts)، وتحقّقت من الحل (rollout واحد مع تقليم ثنائي الاتجاه) عبر تدريب إنتاجي فعلي بمقياس مئات المليارات من المعاملات. وأي مؤسسة يمثّل فيها معدل استغلال GPU تكلفة التدريب مباشرة، لديها سبب وجيه لحساب المبلغ الذي يُهدَر في خط أنابيبها بسبب “انتظار المجموعة”.</p>

<h2 id="المصادر">المصادر</h2>

<ul>
  <li>Zhenyu Hou, Yujiang Li, Jie Tang, Yuxiao Dong. “Single-Rollout Asynchronous Optimization for Agentic Reinforcement Learning.” arXiv 2607.07508 (2026-07-08). <a href="https://arxiv.org/abs/2607.07508">https://arxiv.org/abs/2607.07508</a></li>
  <li>ذو صلة: “Staleness-Learning Rate Scaling Laws for Asynchronous RLHF.” arXiv 2607.01083. <a href="https://arxiv.org/abs/2607.01083">https://arxiv.org/abs/2607.01083</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="research" /><category term="reinforcement-learning" /><category term="agentic-rl" /><category term="grpo" /><category term="async-rl" /><category term="llm-training" /><category term="post-training" /><summary type="html"><![CDATA[عند تدريب مهام الوكلاء الطويلة عبر التعلّم المعزز، يُبقي أخذ العينات الجماعي في GRPO وحدات GPU عاطلة في انتظار أبطأ rollout. استخدمت جامعة تسينغهوا وZ AI طريقة SAO فعلياً في تدريب GLM-5.2، إذ تتخلّى تماماً عن المجموعة وتتعلّم من rollout واحد، وتحافظ على الاستقرار عبر تقليم الرموز ثنائي الاتجاه بدلاً من ذلك.]]></summary></entry><entry xml:lang="en"><title type="html">A Cross-Vendor Workflow Where Fable 5 Conducts and Grok 4.5 Implements: fable-advisor</title><link href="https://thakicloud.github.io/en/agentops/fable-advisor-multi-model-orchestration/" rel="alternate" type="text/html" title="A Cross-Vendor Workflow Where Fable 5 Conducts and Grok 4.5 Implements: fable-advisor" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/en/agentops/fable-advisor-multi-model-orchestration</id><content type="html" xml:base="https://thakicloud.github.io/en/agentops/fable-advisor-multi-model-orchestration/"><![CDATA[<p>Anyone who has used a coding agent for a while eventually arrives at a natural question. Writing a precise spec and sharply reviewing a resulting diff is a different kind of work from actually typing out code line by line, so why should the same single model have to do both? The recently released and widely discussed <code class="language-plaintext highlighter-rouge">fable-advisor</code> plugin answers this question head on. It is a cross-vendor workflow in which <strong>Claude Fable 5 does nothing but conduct, while Grok 4.5 handles all of the actual implementation</strong>. This post breaks down that structure and examines what this design suggests from ThakiCloud’s operational perspective, where multi-agent systems and model routing are treated as first-class resources.</p>

<h2 id="overview">Overview</h2>

<p>Until now, multi-agent coding workflows have largely stayed within a single vendor. In Claude Code, Opus conducts while Sonnet or Haiku runs as subagents. What makes <code class="language-plaintext highlighter-rouge">fable-advisor</code> interesting is that it structures this division of labor <strong>across vendor boundaries</strong>. Anthropic’s Fable 5 handles the orchestration layer, while xAI’s Grok 4.5 handles the implementation layer.</p>

<p>The core insight of this design is straightforward. Conducting and implementing demand different capabilities, and they have different cost structures. Spec writing and diff review are matters of judgment and reasoning, so they require a model suited to conducting, whereas bulk code typing is where throughput and cost efficiency matter most. <code class="language-plaintext highlighter-rouge">fable-advisor</code> places each of these two roles on models from different vendors, letting each layer use whichever model fits it best. The fact that it is free and open source, with routing logic that can be customized directly, also lowers the barrier to real-world adoption.</p>

<h2 id="what-this-technology-is">What This Technology Is</h2>

<p><code class="language-plaintext highlighter-rouge">fable-advisor</code> is a plugin layered on top of Claude Code that enforces a three-way separation of roles.</p>

<p>First, the <strong>conductor (Fable 5)</strong> writes specs and reviews outcomes. It takes the user’s request, breaks it down into an implementation spec, and reviews the resulting diff once implementation is done. The important point is that the conductor <strong>never writes code directly</strong>. It focuses entirely on judgment and contract definition.</p>

<p>Second, the <strong>implementer (Grok 4.5)</strong> handles all the actual typing. It receives the spec passed down by the conductor and writes code through the Grok CLI, powered by Grok 4.5. Looking at the repository’s history, starting with v3 the existing Sonnet/Opus implementation agent was replaced by <code class="language-plaintext highlighter-rouge">grok-implementer</code>, making Grok 4.5 the default typing lane. In other words, this plugin was not cross-vendor from the start; it is the result of an evolution that moved the implementation lane toward a lower-cost, higher-throughput model.</p>

<p>Third, there is <strong>parallel execution</strong>. Independent specs are run simultaneously as parallel agents. When the conductor breaks work down into units that do not depend on each other, each unit proceeds concurrently as a separate implementation agent. This is not simple sequential delegation but closer to a division of labor shaped like a DAG (directed acyclic graph).</p>

<p>The overall flow looks like this in diagram form.</p>

<pre><code class="language-mermaid">flowchart TB
    U[User request] --&gt; F[Fable 5 conductor&lt;br/&gt;spec writing &amp; diff review]
    F --&gt;|split into independent specs| S1[Spec A]
    F --&gt;|split into independent specs| S2[Spec B]
    S1 -.Grok CLI.-&gt; G1[Grok 4.5 implementer A]
    S2 -.Grok CLI.-&gt; G2[Grok 4.5 implementer B]
    G1 --&gt;|diff| F
    G2 --&gt;|diff| F
    F --&gt; R[Integration &amp; review result]
</code></pre>

<h2 id="installation-and-integration">Installation and Integration</h2>

<p>Installing the plugin takes one line. You add the repository to Claude Code’s plugin marketplace.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>claude plugin marketplace add DannyMac180/fable-advisor
</code></pre></div></div>

<p>The Grok CLI, which handles the implementation lane, requires separate authentication. Logging in with <code class="language-plaintext highlighter-rouge">grok login</code> sets up OAuth authentication based on a SuperGrok or X Premium+ subscription, and according to the repository description, this path lets you run the implementation agent <strong>without per-token API charges</strong>, purely through your subscription. This is the crux of the cost structure. The conductor makes only a small number of judgment-heavy calls, while the bulk of code typing happens within the subscription plan, minimizing exposure to usage-based billing.</p>

<p>From an integration standpoint, it is worth noting that the routing logic is open. You can adjust directly which task goes to which model and under what conditions work gets parallelized, so a team can reconfigure the lanes to fit its budget and quality requirements.</p>

<h2 id="how-this-design-actually-performs">How This Design Actually Performs</h2>

<p><code class="language-plaintext highlighter-rouge">fable-advisor</code> is not a tool that touts benchmark numbers but a workflow pattern, so instead of reproducible performance figures, this section covers the structural effects the design produces. Since the repository does not present quantitative metrics, this post also avoids inventing numbers and sticks to structural benefits.</p>

<p>The biggest effect is the <strong>separation of cost and quality</strong>. When orchestration that requires judgment goes to the conductor and implementation that requires throughput goes to a low-cost implementer, the overall workflow’s unit cost drops while judgment quality is preserved. The arrangement “call the conductor sparingly and cheaply, call the implementer often but not expensively” falls into place naturally.</p>

<p>The second effect is <strong>cross-verification</strong>. The fact that the implementer and the reviewer are models from different vendors produces an interesting side effect. When the same model reviews its own code, it tends to overlook the same mistakes it made in the first place, but when a model from a different lineage reviews the diff, there is more room for it to catch the other’s blind spots. The conductor-worker split becomes more than a simple division of labor; it functions as a kind of mutual verification mechanism.</p>

<p>The third effect is <strong>reduced latency through parallelization</strong>. When independent specs are implemented at the same time, total working time converges not to the sequential sum but to the length of the single longest chain. The better the conductor breaks work down, the larger this benefit becomes.</p>

<h2 id="generalizing-the-conductor-worker-pattern">Generalizing the Conductor-Worker Pattern</h2>

<p>If we look at <code class="language-plaintext highlighter-rouge">fable-advisor</code> not as an individual plugin but as a design pattern, a broader context comes into view. The essence of this pattern is “the main session only conducts, and heavy work gets delegated.” Crossing vendors is just one variant of this pattern; it also holds within a single vendor. For example, a setup where Claude Code uses Fable 5 as the conductor, routes exploration to Haiku, implementation to Sonnet, and complex reasoning to an Opus subagent is already widely used. What <code class="language-plaintext highlighter-rouge">fable-advisor</code> did was extend the target models of this delegation beyond the vendor boundary.</p>

<p>Seen from this angle, the selection criteria for the conductor model become clear. Since the conductor is responsible for judgment, branching, and aggregation, accuracy and reasoning quality matter, but call frequency is relatively low. The implementer, by contrast, cares about throughput and unit cost. Good orchestration, then, is not “put the most expensive model in the conductor seat and route everything through it,” but rather “place at each layer the model whose characteristics that layer actually requires.” The v3 evolution that moved <code class="language-plaintext highlighter-rouge">fable-advisor</code>’s implementation lane to a low-cost subscription model is exactly the result of following this principle.</p>

<p>One thing worth watching is that this pattern only works if the boundaries of delegation are clear. If the conductor hands off an ambiguous spec, the implementer fills in the gaps by guessing, and the resulting review burden actually grows. The gains of delegation are realized only when the spec is sufficiently concrete. This is no different from division of labor in human organizations. The clearer the specification, the better delegation works.</p>

<h2 id="implications-for-thakiclouds-products">Implications for ThakiCloud’s Products</h2>

<p>This design overlaps strikingly with how ThakiCloud operates its own agents.</p>

<p>It is most directly relevant from a <strong>Paxis perspective</strong>. Paxis is ThakiCloud’s Agent-Native Cloud control plane, and it treats DAG-shaped multi-agent execution as a core capability. The “spec writing to distributed implementation to cross review” structure that <code class="language-plaintext highlighter-rouge">fable-advisor</code> demonstrates shares the same skeleton as Paxis’s skill harness, which breaks work into subtasks, runs them in parallel inside isolated sandboxes, and closes the loop with a verification stage. In particular, the principle that the conductor focuses on judgment and contract definition rather than writing code directly matches exactly with our own design philosophy of drawing capability from surrounding contract structures rather than model tier. The flow where the conductor reviews results produced by a different model also lines up with our own operating principle of closing multi-agent fan-out with a verification stage, so that hallucinations do not accumulate unchecked.</p>

<p>It also holds up from an <strong>ai-platform perspective</strong>, particularly around cost structure. ThakiCloud’s ai-platform schedules GPU workloads on K8s and Kueue, serving the inference and training workloads of its customers. The idea behind <code class="language-plaintext highlighter-rouge">fable-advisor</code> of delegating the implementation lane to a low-cost model to bring down overall workflow unit cost is a pattern that GPU cloud customers can apply directly when designing their own workloads. When the small number of judgment steps that need heavy inference and the larger number of execution steps that need throughput are placed on resource tiers matched to each, the same result can be obtained at lower cost. Since low-cost serving is what makes agent economics work in the first place, ai-platform’s cost efficiency and Paxis’s agent orchestration complement each other.</p>

<h2 id="limitations-and-counterarguments">Limitations and Counterarguments</h2>

<p>This design comes with clear trade-offs. The first is <strong>operational complexity</strong>. Weaving two vendors’ models into a single workflow means managing two authentication systems, two pricing plans, and two points of failure. If one vendor’s CLI changes or its authentication expires, the entire workflow can stop. This is a trade against the simplicity of a single-vendor workflow, and whether the benefit justifies the complexity may differ from team to team.</p>

<p>The second is <strong>the risk of delegating quality</strong>. Delegating implementation to a low-cost model means that if the conductor’s spec and review are not tight enough, low-quality implementation can pass through unchecked. The quality of this workflow ultimately depends on how strict the conductor’s review gate is. If the review is a formality, the cross-verification benefit of cross-vendor division of labor disappears, and what remains is a low-quality pipeline that merely saved on cost.</p>

<p>The third is <strong>the constraint of subscription-based authentication</strong>. The fact that the Grok CLI runs on subscription-based OAuth is a cost advantage for individuals or small teams, but for large-scale automation or unattended pipelines, subscription limits and authentication renewal can become bottlenecks. The advantage of having no usage-based billing is, flipped around, also a statement that scaling stops the moment usage exceeds the plan’s limit.</p>

<p>Even so, the message <code class="language-plaintext highlighter-rouge">fable-advisor</code> sends is clear. The future of coding agents lies not in one all-purpose model but in orchestration that combines the model best suited to each layer. This points to exactly the same direction as ThakiCloud’s approach of treating multi-agent systems and model routing as first-class resources.</p>

<h2 id="sources">Sources</h2>

<ul>
  <li><a href="https://github.com/DannyMac180/fable-advisor">fable-advisor (GitHub)</a></li>
  <li><a href="https://x.ai/cli">Grok CLI (x.ai/cli)</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="agentops" /><category term="claude-code" /><category term="multi-agent" /><category term="model-routing" /><category term="fable" /><category term="grok" /><category term="agentops" /><category term="paxis" /><summary type="html"><![CDATA[We break down the conductor-worker split of the fable-advisor plugin, in which Claude Fable 5 conducts spec writing and diff review while Grok 4.5 handles the actual code typing, and verify it from ThakiCloud's perspective of treating multi-agent systems and model routing as first-class resources.]]></summary></entry><entry xml:lang="en"><title type="html">Coding Agents That Remember Through Folders, Not Vector Databases: A Look at personal-monorepo-template</title><link href="https://thakicloud.github.io/en/agentops/personal-monorepo-template-agent-memory/" rel="alternate" type="text/html" title="Coding Agents That Remember Through Folders, Not Vector Databases: A Look at personal-monorepo-template" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/en/agentops/personal-monorepo-template-agent-memory</id><content type="html" xml:base="https://thakicloud.github.io/en/agentops/personal-monorepo-template-agent-memory/"><![CDATA[<p>Anyone who uses a coding agent daily runs into the same wall over and over. Decisions made yesterday, conventions set last week, a particular colleague’s way of working: the agent asks about all of it again every session, as if hearing it for the first time. A repository that solves this problem without an expensive vector database or dedicated memory infrastructure, using nothing more than <strong>a plain folder structure and a single markdown file</strong>, has recently gone public and stirred up developers. It is <code class="language-plaintext highlighter-rouge">personal-monorepo-template</code>, released by jxnl (Jason Liu), the creator of the <code class="language-plaintext highlighter-rouge">Instructor</code> library. This post breaks down that structure and examines what this design implies from ThakiCloud’s operational standpoint, where we treat skills and knowledge as first-class resources.</p>

<h2 id="overview">Overview</h2>

<p>The common approach to an agent’s memory problem is a vector database: embed conversations and documents, store them, and retrieve them via semantic search when needed. It is powerful, but the operational burden is significant. You have to manage an embedding pipeline, a vector index, and a reindexing schedule, which is a lot of infrastructure for an individual to bolt onto their own workflow.</p>

<p><code class="language-plaintext highlighter-rouge">personal-monorepo-template</code> takes the opposite direction. It reframes memory not as a search problem but as <strong>a file-structure problem</strong>. People live in a <code class="language-plaintext highlighter-rouge">people/</code> folder, projects live as project packets, and recurring ways of working live as skills inside the repository itself. The agent loads this entire structure persistently through <code class="language-plaintext highlighter-rouge">AGENTS.md</code> every time a session starts. Instead of the approximate matching of vector search, memory is accessed through the exact address of a folder path.</p>

<p>The background of the person who built this adds weight to the design. jxnl is the creator of <code class="language-plaintext highlighter-rouge">Instructor</code>, a structured-output library downloaded millions of times a month, reportedly cited by OpenAI as an inspiration for its own structured output feature. He currently works as a Developer Experience engineer on the OpenAI Codex team, which makes this a tool built by someone who runs coding agents in daily production use to solve their own problem, giving it real reference value.</p>

<h2 id="what-this-technology-is">What This Technology Is</h2>

<p>The core idea is simple. <strong>Represent an agent’s memory as plain folders and markdown inside a monorepo, and load it automatically every session.</strong> It breaks down into three parts.</p>

<p>The first is <strong>a record of people and projects</strong>. The repository scans Slack, email, calendar, and GitHub to generate <code class="language-plaintext highlighter-rouge">people</code> files and project packets, and proposes updates to the persistently loaded <code class="language-plaintext highlighter-rouge">AGENTS.md</code>. Mention a particular colleague’s name, and the agent reads that person’s file and instantly restores the context. Without any vector database, it locates “who this person is” through an exact folder path.</p>

<p>The second is <strong>repository-local skills</strong>. Recurring ways of working are placed as skills inside the repository, loaded automatically every session so the agent follows those procedures. A notable example is the built-in write-like-me skill, which learns from a user’s sent emails and Slack messages to write in that person’s own voice. The user’s past output becomes the training data for the skill itself.</p>

<p>The third is <strong>automatic check-ins</strong>. The repository is designed to run automatic check-ins at 9am and 4pm every day, summarizing that day’s project status and people-related context and proposing updates. Rather than waiting for a manual invocation, this is a loop where the agent refreshes its own memory on a fixed schedule.</p>

<p>The overall flow looks like this in diagram form.</p>

<pre><code class="language-mermaid">flowchart TB
    SRC[Slack, Email, Calendar, GitHub] --&gt;|scan| SCAN[Check-in script]
    SCAN --&gt; PEOPLE[Propose people files]
    SCAN --&gt; PKT[Propose project packets]
    SCAN --&gt; AGD[Propose AGENTS.md updates]
    AGD -.loaded persistently at session start.-&gt; AGENT[Coding agent]
    PEOPLE -.looked up by folder path.-&gt; AGENT
    SKILL[Repository-local skills&lt;br/&gt;including write-like-me] -.loaded automatically.-&gt; AGENT
    CRON[Automatic check-in at 9am and 4pm daily] --&gt; SCAN
</code></pre>

<p>This design is interesting precisely because it connects to the “Codex-maxxing” philosophy the repo’s author laid out in a separate post. Rather than bolting a better model onto the agent, the direction is to <strong>build up the surrounding structure</strong> so the agent never starts from a blank slate.</p>

<h2 id="installation-and-integration">Installation and Integration</h2>

<p>This repository is exactly what its name says: a template. You integrate it by cloning it into your own GitHub account and configuring your coding agent (Codex or a similar CLI) to use the repository root as its working directory. The core entry point is <code class="language-plaintext highlighter-rouge">AGENTS.md</code> at the repository root, which the agent reads at the start of every session to understand the folder structure, the people and project context, and the list of skills it should load.</p>

<p>The key integration point here is that <code class="language-plaintext highlighter-rouge">AGENTS.md</code> is <strong>not a plain document but a persistently loaded contract</strong>. Because this file lands at the front of the context every session, what you write in it defines the agent’s default behavior. Since the folder structure is fixed, the agent accesses memory deterministically, in the sense of “if I need context on colleague A, I read <code class="language-plaintext highlighter-rouge">people/A.md</code>.” Unlike the probabilistic approximation of vector search, a file path always points to the same place.</p>

<p>Automatic check-ins are integrated by hooking the check-in script to a scheduler (a cron-style job) so it runs at a fixed time every day. This mechanism keeps the agent’s memory current without requiring a human to invoke it each time, and it is also an important design decision from a cost standpoint. Because it runs a finite number of times a day rather than polling continuously, it does not burn tokens in an infinite loop.</p>

<h2 id="how-this-design-actually-plays-out">How This Design Actually Plays Out</h2>

<p>This repository is not a tool that leads with benchmark numbers; it is <strong>a workflow pattern</strong>, so here we examine the structural effects it produces in practice. The repository does not offer reproducible performance figures, and the author himself points to improvements in day-to-day workflow rather than quantitative metrics as the justification. So this post does not invent numbers either and sticks to the structural advantages.</p>

<p>The biggest effect is <strong>eliminating the cost of context restoration</strong>. A vector database lookup runs an embedding computation and a similarity search on every query, while a folder-path lookup is a single file read. When a person says “that project from last time,” the agent reads the corresponding project packet directly and restores the exact context, with no false positives from approximate search. The precision of memory now depends on the quality of the folder design rather than the quality of retrieval.</p>

<p>The second effect is <strong>auditability</strong>. Because all memory is stored as human-readable markdown, a developer can open it directly to check, and correct, what the agent knows. Vector embeddings are hard for a human to verify by eye, but <code class="language-plaintext highlighter-rouge">people/A.md</code> is just a text file. Being able to fix the agent’s memory on the spot when it is wrong makes a real difference in practice.</p>

<p>The third effect is <strong>portability</strong>. Because it isn’t tied to any specific vector database vendor or embedding model, the repository itself is a complete, self-contained memory. Move it to a different machine or a different agent and the folders and markdown still work as-is. This lack of infrastructure lock-in connects directly to the on-premise and sovereign-cloud angle discussed below.</p>

<h2 id="implications-for-thakicloud-products">Implications for ThakiCloud Products</h2>

<p>This design touches both of the axes on which ThakiCloud operates agents.</p>

<p>The most direct connection is to <strong>Paxis</strong>. Paxis is ThakiCloud’s Agent-Native Cloud control plane, which treats Skills, Tools, Policies, and Audit Logs as first-class resources. The pattern <code class="language-plaintext highlighter-rouge">personal-monorepo-template</code> demonstrates, “repository-local skills plus a persistently loaded contract (<code class="language-plaintext highlighter-rouge">AGENTS.md</code>),” maps precisely onto the direction of Paxis’s skill-harness design. Paxis already selects among many skills via BM25 and runs them in an isolated sandbox, and this repository’s approach answers a step upstream of that, “what knowledge should sit persistently in the session context,” with a clean answer expressed as folder structure. In particular, keeping memory as human-readable files with every update auditable is the same philosophy as Paxis’s principle of routing every agent action through a policy gate and an audit log. The very idea of drawing an agent’s capability from its surrounding structure rather than its model tier is isomorphic to our own design of treating skills as first-class resources.</p>

<p>From the <strong>ai-platform</strong> angle, the infrastructure-burden perspective is what stands out. ThakiCloud’s ai-platform is K8s-based AI/ML infrastructure that serves workloads for on-premise and sovereign-AI customers. For these customers, a memory architecture that requires running a vector database at all times represents extra infrastructure surface and management cost. A memory expressed as folders and markdown, by contrast, runs on the filesystem alone with no separate state store, which is a much lighter operational burden in regulated environments or air-gapped networks. The angle of “minimizing memory infrastructure while still giving the agent persistence” could be a genuine selling point for customers who require sovereign AI.</p>

<h2 id="limitations-and-counterarguments">Limitations and Counterarguments</h2>

<p>This design is not a silver bullet. The clearest limitation is <strong>scale</strong>. Folder-path access is powerful when the person or the agent already knows the address of the memory. But when you need to find information “you don’t know the location of” among tens of thousands of documents, semantic vector search is still superior. This repository assumes a relatively small, clearly structured memory space consisting of one person’s people, projects, and experiences. Scale it up to a team’s entire, sprawling knowledge base, and folder structure alone starts to hit its limits.</p>

<p>The second counterargument is <strong>the privacy of the scanning process</strong>. Scanning Slack, email, and calendar to build people files also means that sensitive conversations get stored as plain-text markdown. That’s convenient for personal use, but bringing it into an organization requires access control and retention policy without question. Auditability is a strength, but with no control over who can access those files, it becomes a liability just as easily.</p>

<p>The third is <strong>the reliability of automatic updates</strong>. If a twice-daily automatic check-in writes a wrong summary into a person file, that error keeps getting injected into every subsequent session. This is exactly why the repository frames updates as “proposals” that assume a human will confirm them. Push all the way to full automation and memory can quietly get corrupted, so leaving a human review gate in place is the safer approach.</p>

<p>Finally, this approach is pitched as “a free alternative to a human assistant’s salary,” but actually sustaining this level of workflow requires substantial engineering skill to design and refine the repository structure yourself. The tool being free and the cost of operating it well being free are two different things.</p>

<p>Even so, the core message this repository sends is clear. An agent’s memory does not have to be heavy infrastructure, and a good folder structure paired with a persistently loaded contract can deliver a surprising amount of persistence. That points in exactly the same direction as ThakiCloud’s own approach of treating skills and knowledge as first-class resources.</p>

<h2 id="sources">Sources</h2>

<ul>
  <li><a href="https://github.com/jxnl/personal-monorepo-template">jxnl/personal-monorepo-template (GitHub)</a></li>
  <li><a href="https://jxnl.co/writing/2026/05/10/codex-maxxing/">Codex-maxxing (jxnl.co)</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="agentops" /><category term="agent-memory" /><category term="coding-agent" /><category term="agents-md" /><category term="codex" /><category term="agentops" /><category term="paxis" /><summary type="html"><![CDATA[OpenAI Codex engineer jxnl has released personal-monorepo-template, which gives agents persistent memory through folder structure and an AGENTS.md file, no vector database needed. We break down this design and validate it from ThakiCloud's perspective of treating skills as first-class resources.]]></summary></entry><entry xml:lang="en"><title type="html">The Agent That Studied Its Own Screwups</title><link href="https://thakicloud.github.io/en/comics/trace-targeted-self-improvement/" rel="alternate" type="text/html" title="The Agent That Studied Its Own Screwups" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/en/comics/trace-targeted-self-improvement</id><content type="html" xml:base="https://thakicloud.github.io/en/comics/trace-targeted-self-improvement/"><![CDATA[<p>The talk of the week is TRACE, a paper that just picked up a Spotlight at an ICML workshop. The idea is refreshingly plain: instead of an agent grinding away at everything, it reads back its own failure logs, figures out the one capability those failures point to, and trains exactly that. Turns out this targeted approach beats blunt reinforcement learning, prompt-shuffling, and dumping in synthetic data. Knowing your weak spot, it seems, beats brute force.</p>

<p><img src="/assets/images/posts/comics/trace-targeted-self-improvement/strip.png" alt="The Agent That Studied Its Own Screwups" /></p>

<blockquote>
  <p>Source: <a href="https://x.com/hjguyhan/status/2075500035207565421">RT @hangoo_kang: “TRACE: Capability-Targeted Agentic Training” got Spotlight @ ICML AIWILD 🎉</a> · twitter</p>
</blockquote>

<h2 id="what-this-means-for-thakicloud">What this means for ThakiCloud</h2>

<p>This lines up neatly with what ThakiCloud has been building. Paxis conducts the agents; Metis retrains the ones that come up short. TRACE says: diagnose your failures and retrain just the weak spot. But those failure logs are among the most sensitive things a company owns. Ship them to someone else’s cloud to train on, and both the weakness and the fix leak out with them. That is the case for on-prem and for sovereignty: keeping your models, data, and infrastructure under your own roof. Fix your flaws at home and they stay home. For what it is worth, this very blog runs on a self-improvement loop that reviews its own misses and resharpens.</p>

<hr />

<p><em>An auto-generated comic riffing on this week’s industry news.</em></p>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="comics" /><category term="TRACE" /><category term="agentic-training" /><category term="self-improvement" /><category term="on-prem" /><category term="sovereignty" /><category term="ai-coding" /><summary type="html"><![CDATA[Fix the one skill you lack and you win. Paxis's missing skill? Knowing when to stop.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thakicloud.github.io/assets/images/posts/comics/trace-targeted-self-improvement/strip.png" /><media:content medium="image" url="https://thakicloud.github.io/assets/images/posts/comics/trace-targeted-self-improvement/strip.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="en"><title type="html">Testing iOS Apps in a Browser from a Headless Cloud Mac: serve-sim</title><link href="https://thakicloud.github.io/en/dev/serve-sim-ios-simulator-web/" rel="alternate" type="text/html" title="Testing iOS Apps in a Browser from a Headless Cloud Mac: serve-sim" /><published>2026-07-11T00:00:00+09:00</published><updated>2026-07-11T00:00:00+09:00</updated><id>https://thakicloud.github.io/en/dev/serve-sim-ios-simulator-web</id><content type="html" xml:base="https://thakicloud.github.io/en/dev/serve-sim-ios-simulator-web/"><![CDATA[<p>Ask an AI coding agent to build an iOS app and you run into one fundamental wall. The agent can write code and even build it, but it cannot actually see what happens on screen. The problem gets worse once you move your development environment to a Mac Mini in the cloud, because on a headless server with no GUI the Xcode Simulator window never even appears.</p>

<p><a href="https://github.com/EvanBacon/serve-sim">serve-sim</a>, built by Evan Bacon of the Expo core team, aims straight at that wall. It became widely known after indie developer levelsio showed it off, saying it let him “watch, in a browser, in real time, an iOS app that Claude Code built on a cloud Mac Mini.” Its slogan is simple: “npx serve for Apple Simulators.”</p>

<h2 id="overview">Overview</h2>

<p>What makes serve-sim interesting is that it is not just a screen-mirroring tool. It opens two things at once: a video stream that sends the simulator screen to a browser, and a control channel that lets a browser or an agent operate the simulator. In other words, it makes both “watching” and “operating” possible remotely.</p>

<p>That combination matters because it completes the development loop for AI coding agents. An agent can fix code, build it, run it, look at the resulting screen, tap a button to move to the next step, and cycle through all of that without a human in the loop. This lines up exactly with what ThakiCloud’s Agent-Native Cloud, Paxis, is aiming for: agents doing real work inside isolated environments. That makes it worth a closer look at how one open-source tool implements that workflow.</p>

<p><img src="/assets/images/serve-sim-ios-simulator-web-hero.png" alt="An abstract image of a smartphone screen on a headless cloud server dissolving into particles of light that flow through the network into a browser window" />
<em>A visualization of a headless server’s simulator screen becoming a stream that flows into a remote browser.</em></p>

<h2 id="what-serve-sim-is">What serve-sim Is</h2>

<p>The way serve-sim works is simpler and more clever than it sounds. There is no separate Xcode plugin to install, and no instrumentation code to embed in the app. Instead it spins up a small Swift helper process that captures the framebuffer of an already-booted iOS Simulator through Apple’s own <code class="language-plaintext highlighter-rouge">simctl io</code> interface.</p>

<p>The captured screen is exposed in two ways. First, it sends the video to the browser as an MJPEG stream at up to 60 FPS. Second, it opens a WebSocket control channel alongside it, so input from the browser side, taps and gestures, can be sent back to the simulator. On top of that sits a React-based preview UI, so a person can operate the app in the browser as if it were a real device.</p>

<pre><code class="language-mermaid">flowchart TB
    A[Booted iOS Simulator] --&gt; B[Swift helper process]
    B --&gt; C[Captures framebuffer&lt;br/&gt;via simctl io]
    C --&gt; D[MJPEG video stream&lt;br/&gt;up to 60 FPS]
    C --&gt; E[WebSocket control channel]
    D --&gt; F[Browser React preview UI]
    E --&gt; F
    E --&gt; G[Agent CLI&lt;br/&gt;tap, gesture, rotate, camera]
    F -.human operates.-&gt; E
    G -.agent operates.-&gt; E
</code></pre>

<p>The key point is that it targets “any booted simulator.” Since it requires no modification to the app, it can be attached to an existing project as-is. It can also forward simulator logs to the browser, so browser-use style MCP tools can read those logs to judge state. There is even a convenience feature where dragging a video or image into the browser window adds it as a file on the simulator device.</p>

<h2 id="installation-and-use">Installation and Use</h2>

<p>The barrier to entry for serve-sim is low. On a Mac with Node.js, one line is enough.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx serve-sim
</code></pre></div></div>

<p>Once running, you can view the preview at <code class="language-plaintext highlighter-rouge">http://localhost:3200</code> locally. It supports three modes: using it locally, connecting from another device on the same LAN, or hosting it on a remote Mac and reaching it from anywhere through a tunnel. levelsio’s case is the third mode: running it on a headless Mac Mini in the cloud and viewing it through a remote browser.</p>

<p>Agent integration is provided as a separate Agent Skill. This skill, packaged at <code class="language-plaintext highlighter-rouge">skills/serve-sim</code> in the repository, teaches any host that implements the open Agent Skills standard, including Claude Code, Cursor, Codex CLI, and Gemini CLI, how to operate the simulator through the CLI. That includes taps, gestures, hardware buttons, screen rotation, injecting camera input, and handing the stream off to the host’s own preview window.</p>

<h2 id="a-note-on-reproduction">A Note on Reproduction</h2>

<p>This post was written in a headless batch session with no GUI, where running Node.js is blocked by policy, so we were not able to run <code class="language-plaintext highlighter-rouge">npx serve-sim</code> directly ourselves and capture the screen. The commands and behavior described in this post are therefore based on facts confirmed in the repository README and the official announcement material, and we have not fabricated any benchmark numbers. Please verify the actual simulator streaming screen and latency yourself, on a macOS machine with a booted Xcode Simulator, using the commands above.</p>

<h2 id="implications-for-thakicloud-products">Implications for ThakiCloud Products</h2>

<p>On the surface, serve-sim is a tool for iOS developers, but underneath it sits a much bigger trend: agent-native development.</p>

<p><strong>Paxis lens (agent-native development).</strong> ThakiCloud’s Paxis is an Agent-Native Cloud control plane that runs skills in isolated sandboxes and passes every action through policy gates and audit logs. The open Agent Skills standard that serve-sim adopts is the same kind of contract model that Paxis’s skill harness handles. The idea that a single skill can give “tap, rotate, and read the screen of a simulator” capability to multiple agent hosts points in exactly the same direction as Paxis’s structure of selecting from 960-plus skills via BM25 and running them in isolation. In particular, workloads where an agent operates a real UI, like serve-sim’s control channel, need those operations to pass through policy gates and be recorded in audit logs before they can safely go into production. If serve-sim provides the “capability,” Paxis provides the layer that “safely governs” that capability.</p>

<p><strong>ai-platform lens (headless execution infrastructure).</strong> What really makes serve-sim compelling is that it runs on a headless, remote Mac. The idea of building and streaming from a GUI-less server shares its philosophy with how ThakiCloud’s ai-platform schedules and runs workloads on Kubernetes without a GUI. A pipeline that attaches macOS runners on demand for iOS builds, lets an agent automatically build and test on top of them, and streams only the results back to a human, could extend beyond CI into “agent-driven QA.” It is a structure where low-cost headless execution infrastructure (ai-platform) underpins the economics of agent automation (Paxis).</p>

<h2 id="limits-and-counterarguments">Limits and Counterarguments</h2>

<p>A few things deserve a sober look.</p>

<p>First, serve-sim targets the simulator. Because it is a simulator and not a physical device, issues that only surface on real hardware, camera, sensors, performance characteristics, still go uncaught. The old limitation that passing on the simulator does not guarantee passing on a real device remains unchanged.</p>

<p>Second, MJPEG streaming is simple and compatible but not very efficient at compression. Continuously streaming a 60 FPS, high-quality feed over a remote tunnel can turn bandwidth and latency into a bottleneck. For gesture testing where responsiveness matters, network round-trip delay translates directly into input lag.</p>

<p>Third, an agent being able to “see and operate” the screen is a separate matter from that judgment being correct. It remains entirely possible for an agent to misread the stream and tap the wrong button, and this is exactly why policy gates and human review are needed. The more capability a tool opens up, the more important the layer that governs that capability becomes.</p>

<p>Even so, serve-sim’s direction is clear. It has built a real bridge needed to move from “the agent only writes code” to “the agent builds, runs, and verifies by directly operating the screen.” If you are a team trying to develop mobile apps with agents from a headless cloud, you can open that world right now with a single line: <code class="language-plaintext highlighter-rouge">npx serve-sim</code>.</p>

<h2 id="sources">Sources</h2>

<ul>
  <li>Evan Bacon. “serve-sim: The <code class="language-plaintext highlighter-rouge">npx serve</code> of Apple Simulators.” GitHub. <a href="https://github.com/EvanBacon/serve-sim">https://github.com/EvanBacon/serve-sim</a></li>
  <li>@levelsio, tweet introducing serve-sim. <a href="https://x.com/levelsio/status/2075328941317886210">https://x.com/levelsio/status/2075328941317886210</a></li>
</ul>]]></content><author><name>{&quot;name&quot;=&gt;nil, &quot;avatar&quot;=&gt;nil, &quot;bio&quot;=&gt;nil, &quot;location&quot;=&gt;&quot;Seoul, Korea&quot;, &quot;email&quot;=&gt;&quot;info@thakicloud.co.kr&quot;, &quot;uri&quot;=&gt;nil, &quot;home&quot;=&gt;nil, &quot;links&quot;=&gt;[{&quot;label&quot;=&gt;&quot;Website&quot;, &quot;icon&quot;=&gt;&quot;fas fa-fw fa-link&quot;, &quot;url&quot;=&gt;&quot;https://thakicloud.co.kr&quot;}, {&quot;label&quot;=&gt;&quot;GitHub&quot;, &quot;icon&quot;=&gt;&quot;fab fa-fw fa-github&quot;, &quot;url&quot;=&gt;&quot;https://github.com/thakicloud&quot;}]}</name><email>info@thakicloud.co.kr</email></author><category term="dev" /><category term="ios-simulator" /><category term="agent-skills" /><category term="developer-tools" /><category term="headless" /><category term="claude-code" /><category term="expo" /><summary type="html"><![CDATA[Put a Mac Mini in the cloud and you lose the GUI, which means you lose the iOS Simulator too. serve-sim streams the simulator's framebuffer to a browser and opens a WebSocket control channel on top of it, letting AI coding agents build and actually operate an iOS app in a headless environment.]]></summary></entry></feed>