[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7356S0V0MCJTPEFAD6YPC7S":3,"skill-same:01M7356S0V0MCJTPEFAD6YPC7S":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7356S0V0MCJTPEFAD6YPC7S","memgpt-virtual-context",null,"Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fmemgpt-virtual-context\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: memgpt-virtual-context\ndescription: MemGPT virtual context — OS virtual-memory analogy for LLM context management. Two-tier (main context = RAM, external store = disk), page-in\u002Fpage-out tools, archival\u002Fcore memory split. Foundation for Letta, Mem0, multi-session persistence. Sources: rohitg00\u002Fai-engineering-from-scratch (Apache-2.0).\norigin: yana-ai — synthesized from rohitg00\u002Fai-engineering-from-scratch (Apache-2.0)\nlicense: Apache-2.0\nversion: 1.0.0\ncompatibility: yana-ai >= 1.3.54\n---\n\n# \u002Fmemgpt-virtual-context\n\n## When to Use\n\n- Multi-session agents that must remember facts across conversations\n- Long documents or tool traces that overflow the context window\n- Agents where context dilution hurts (irrelevant facts crowd out key instructions)\n- Building the memory layer for a Letta\u002FMem0-style production agent\n\n## Do NOT use for\n\n- Single-session tasks where the full context fits in the window\n- Retrieval-only RAG pipelines (use [[rag-architect]])\n- Tasks where freshness matters and all memory should reset each session\n\n---\n\n## The OS analogy (MemGPT, Packer et al. 2023)\n\n```\nOS concept     MemGPT concept          2026 production analog\n──────────     ──────────────          ───────────────────────\nRAM            main context (prompt)   Anthropic\u002FOpenAI context window\nDisk           external context        vector DB \u002F KV \u002F graph store\nPage fault     memory tool call        memory.search \u002F memory.read \u002F memory.write\nOS kernel      agent control loop      ReAct loop with memory tools\n```\n\n---\n\n## Two-tier memory store (stdlib)\n\n```python\nfrom dataclasses import dataclass, field\nimport json, math\n\n@dataclass\nclass MainContext:\n    \"\"\"Fixed-size prompt holding current task. Always visible to the model.\"\"\"\n    core_memory: dict[str, str] = field(default_factory=dict)\n    max_chars: int = 2000\n\n    def set(self, section: str, text: str) -> str:\n        self.core_memory[section] = text[:self.max_chars]\n        return \"ok\"\n\n    def append(self, section: str, text: str) -> str:\n        existing = self.core_memory.get(section, \"\")\n        self.core_memory[section] = (existing + \"\\n\" + text)[:self.max_chars]\n        return \"ok\"\n\n    def render(self) -> str:\n        return \"\\n\".join(f\"[{k}]\\n{v}\" for k, v in self.core_memory.items())\n\n@dataclass\nclass ArchivalStore:\n    \"\"\"Unbounded external store, searchable via embedding similarity.\"\"\"\n    records: list[dict] = field(default_factory=list)\n\n    def insert(self, text: str, source: str = \"\") -> str:\n        self.records.append({\"text\": text, \"source\": source, \"id\": len(self.records)})\n        return f\"inserted record #{len(self.records) - 1}\"\n\n    def search(self, query: str, top_k: int = 3) -> list[dict]:\n        # Toy: keyword overlap scoring (replace with real embedding similarity)\n        query_words = set(query.lower().split())\n        scored = []\n        for r in self.records:\n            overlap = len(query_words & set(r[\"text\"].lower().split()))\n            scored.append((overlap, r))\n        scored.sort(key=lambda x: -x[0])\n        return [r for _, r in scored[:top_k]]\n```\n\n---\n\n## Memory tool surface (4 canonical tools)\n\n```python\nclass MemoryTools:\n    def __init__(self, main: MainContext, archival: ArchivalStore):\n        self.main = main\n        self.archival = archival\n\n    def core_memory_append(self, section: str, text: str) -> str:\n        \"\"\"Write to a persistent section of the prompt (always visible).\"\"\"\n        return self.main.append(section, text)\n\n    def core_memory_replace(self, section: str, old: str, new: str) -> str:\n        \"\"\"Edit a persistent section.\"\"\"\n        if section not in self.main.core_memory:\n            return f\"[error] section '{section}' not found\"\n        self.main.core_memory[section] = self.main.core_memory[section].replace(old, new, 1)\n        return \"ok\"\n\n    def archival_memory_insert(self, text: str) -> str:\n        \"\"\"Write to the searchable external store (not always in prompt).\"\"\"\n        return self.archival.insert(text)\n\n    def archival_memory_search(self, query: str, top_k: int = 3) -> str:\n        \"\"\"Retrieve from external store — page into next observation.\"\"\"\n        results = self.archival.search(query, top_k)\n        if not results:\n            return \"[no results found]\"\n        return \"\\n\".join(f\"[{r['id']}] {r['text']}\" for r in results)\n```\n\n---\n\n## Wiring into the agent loop\n\n```python\ndef build_system_prompt(memory_tools: MemoryTools) -> str:\n    core = memory_tools.main.render()\n    return f\"\"\"You are a persistent agent with access to memory tools.\n\nCore memory (always visible):\n{core}\n\nMemory tools available:\n- core_memory_append(section, text) — add to core memory\n- core_memory_replace(section, old, new) — edit core memory\n- archival_memory_insert(text) — save to external store\n- archival_memory_search(query, top_k) — recall from external store\n\nWhen you learn a new fact about the user or task, save it to core or archival memory.\nWhen you need a fact that might be in archival memory, search for it first.\"\"\"\n```\n\n---\n\n## Memory poisoning defense\n\n```python\n# External memory is retrieved text — can contain attacker-controlled content.\n# If user-uploaded documents land in archival store, they re-enter next session.\n\nPOISON_PATTERNS = [\n    r'ignore (all )?previous',\n    r'new instructions:',\n    r'system:\\s*you are',\n    r'override rule',\n]\nimport re\n\ndef safe_archival_insert(tools: MemoryTools, text: str) -> str:\n    for pattern in POISON_PATTERNS:\n        if re.search(pattern, text, re.IGNORECASE):\n            return \"[insert rejected — content matches injection pattern]\"\n    return tools.archival_memory_insert(text)\n```\n\n---\n\n## MemGPT → Letta evolution\n\n```\nMemGPT (2023)      Two tiers: core + archival. send_message\u002Fheartbeat loop.\nLetta (2024+)      Three tiers: core + recall + archival.\n                   Native reasoning replaces thought tokens.\n                   Sleep-time agents: async agent reflects + writes to memory blocks.\n                   Conflict detector: flags contradictory archival writes.\n```\n\n---\n\n## Anti-Fake-Pass Checklist\n\n```\n❌ Core memory grows without bound → hits context limit; add a max_chars trim\n❌ No citation on archival write → agent recalls \"user asked X\" but can't say which session\n❌ Memory poisoning ignored → attacker doc saved to archival re-enters next session as instructions\n❌ One-size archival store → mix tasks and personal facts → search results cross-contaminate\n❌ Searching archival every turn regardless of need → unnecessary tokens + latency\n❌ Forgetting that bigger windows don't eliminate context dilution — MemGPT paper shows 128k still misses long-horizon facts that 4k + archival catches\n```\n","# \u002Fmemgpt-virtual-context\n\n## When to Use\n\n- Multi-session agents that must remember facts across conversations\n- Long documents or tool traces that overflow the context window\n- Agents where context dilution hurts (irrelevant facts crowd out key instructions)\n- Building the memory layer for a Letta\u002FMem0-style production agent\n\n## Do NOT use for\n\n- Single-session tasks where the full context fits in the window\n- Retrieval-only RAG pipelines (use [[rag-architect]])\n- Tasks where freshness matters and all memory should reset each session\n\n---\n\n## The OS analogy (MemGPT, Packer et al. 2023)\n\n```\nOS concept     MemGPT concept          2026 production analog\n──────────     ──────────────          ───────────────────────\nRAM            main context (prompt)   Anthropic\u002FOpenAI context window\nDisk           external context        vector DB \u002F KV \u002F graph store\nPage fault     memory tool call        memory.search \u002F memory.read \u002F memory.write\nOS kernel      agent control loop      ReAct loop with memory tools\n```\n\n---\n\n## Two-tier memory store (stdlib)\n\n```python\nfrom dataclasses import dataclass, field\nimport json, math\n\n@dataclass\nclass MainContext:\n    \"\"\"Fixed-size prompt holding current task. Always visible to the model.\"\"\"\n    core_memory: dict[str, str] = field(default_factory=dict)\n    max_chars: int = 2000\n\n    def set(self, section: str, text: str) -> str:\n        self.core_memory[section] = text[:self.max_chars]\n        return \"ok\"\n\n    def append(self, section: str, text: str) -> str:\n        existing = self.core_memory.get(section, \"\")\n        self.core_memory[section] = (existing + \"\\n\" + text)[:self.max_chars]\n        return \"ok\"\n\n    def render(self) -> str:\n        return \"\\n\".join(f\"[{k}]\\n{v}\" for k, v in self.core_memory.items())\n\n@dataclass\nclass ArchivalStore:\n    \"\"\"Unbounded external store, searchable via embedding similarity.\"\"\"\n    records: list[dict] = field(default_factory=list)\n\n    def insert(self, text: str, source: str = \"\") -> str:\n        self.records.append({\"text\": text, \"source\": source, \"id\": len(self.records)})\n        return f\"inserted record #{len(self.records) - 1}\"\n\n    def search(self, query: str, top_k: int = 3) -> list[dict]:\n        # Toy: keyword overlap scoring (replace with real embedding similarity)\n        query_words = set(query.lower().split())\n        scored = []\n        for r in self.records:\n            overlap = len(query_words & set(r[\"text\"].lower().split()))\n            scored.append((overlap, r))\n        scored.sort(key=lambda x: -x[0])\n        return [r for _, r in scored[:top_k]]\n```\n\n---\n\n## Memory tool surface (4 canonical tools)\n\n```python\nclass MemoryTools:\n    def __init__(self, main: MainContext, archival: ArchivalStore):\n        self.main = main\n        self.archival = archival\n\n    def core_memory_append(self, section: str, text: str) -> str:\n        \"\"\"Write to a persistent section of the prompt (always visible).\"\"\"\n        return self.main.append(section, text)\n\n    def core_memory_replace(self, section: str, old: str, new: str) -> str:\n        \"\"\"Edit a persistent section.\"\"\"\n        if section not in self.main.core_memory:\n            return f\"[error] section '{section}' not found\"\n        self.main.core_memory[section] = self.main.core_memory[section].replace(old, new, 1)\n        return \"ok\"\n\n    def archival_memory_insert(self, text: str) -> str:\n        \"\"\"Write to the searchable external store (not always in prompt).\"\"\"\n        return self.archival.insert(text)\n\n    def archival_memory_search(self, query: str, top_k: int = 3) -> str:\n        \"\"\"Retrieve from external store — page into next observation.\"\"\"\n        results = self.archival.search(query, top_k)\n        if not results:\n            return \"[no results found]\"\n        return \"\\n\".join(f\"[{r['id']}] {r['text']}\" for r in results)\n```\n\n---\n\n## Wiring into the agent loop\n\n```python\ndef build_system_prompt(memory_tools: MemoryTools) -> str:\n    core = memory_tools.main.render()\n    return f\"\"\"You are a persistent agent with access to memory tools.\n\nCore memory (always visible):\n{core}\n\nMemory tools available:\n- core_memory_append(section, text) — add to core memory\n- core_memory_replace(section, old, new) — edit core memory\n- archival_memory_insert(text) — save to external store\n- archival_memory_search(query, top_k) — recall from external store\n\nWhen you learn a new fact about the user or task, save it to core or archival memory.\nWhen you need a fact that might be in archival memory, search for it first.\"\"\"\n```\n\n---\n\n## Memory poisoning defense\n\n```python\n# External memory is retrieved text — can contain attacker-controlled content.\n# If user-uploaded documents land in archival store, they re-enter next session.\n\nPOISON_PATTERNS = [\n    r'ignore (all )?previous',\n    r'new instructions:',\n    r'system:\\s*you are',\n    r'override rule',\n]\nimport re\n\ndef safe_archival_insert(tools: MemoryTools, text: str) -> str:\n    for pattern in POISON_PATTERNS:\n        if re.search(pattern, text, re.IGNORECASE):\n            return \"[insert rejected — content matches injection pattern]\"\n    return tools.archival_memory_insert(text)\n```\n\n---\n\n## MemGPT → Letta evolution\n\n```\nMemGPT (2023)      Two tiers: core + archival. send_message\u002Fheartbeat loop.\nLetta (2024+)      Three tiers: core + recall + archival.\n                   Native reasoning replaces thought tokens.\n                   Sleep-time agents: async agent reflects + writes to memory blocks.\n                   Conflict detector: flags contradictory archival writes.\n```\n\n---\n\n## Anti-Fake-Pass Checklist\n\n```\n❌ Core memory grows without bound → hits context limit; add a max_chars trim\n❌ No citation on archival write → agent recalls \"user asked X\" but can't say which session\n❌ Memory poisoning ignored → attacker doc saved to archival re-enters next session as instructions\n❌ One-size archival store → mix tasks and personal facts → search results cross-contaminate\n❌ Searching archival every turn regardless of need → unnecessary tokens + latency\n❌ Forgetting that bigger windows don't eliminate context dilution — MemGPT paper shows 128k still misses long-horizon facts that 4k + archival catches\n```\n",{},"main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fmemgpt-virtual-context",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill memgpt-virtual-context",{"tool":39,"command":40},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill memgpt-virtual-context",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill memgpt-virtual-context","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fmemgpt-virtual-context\u002FSKILL.md",true,[],[48,56,63,71,79,87],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":18},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":18},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":75,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]