Skip to content

Instantly share code, notes, and snippets.

View tanaikech's full-sized avatar

Kanshi TANAIKE tanaikech

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active July 15, 2026 03:37
Stop Your LLMs from Forgetting (Part 2): How a Graph-Anchor Pyramid Cures AI’s Relational Blindspots

Stop Your LLMs from Forgetting (Part 2): How a Graph-Anchor Pyramid Cures AI’s Relational Blindspots

Have you ever had a brilliant solution get completely crushed by a single comment on a technical blog post?

Just last week, on July 8, 2026, I published a post introducing the Pyramid Aggregator. It was a beautiful story of technical lineage: we took a string summation algorithm originally designed on October 13, 2016 (to optimize Google Apps Script) and applied it to modern Large Language Models (LLMs). By organizing document merging into a balanced, parallel tree topology, we successfully bypassed the AI's "Lost in the Middle" bias and achieved a 95% execution speedup using the Antigravity Python SDK.

The paper was archived on Zenodo, and the Medium article did great. But then, a reader dropped a comment that pointed out a massive, system-level blindsp

@tanaikech
tanaikech / submit.md
Created July 8, 2026 06:03
Stop Your LLMs from Forgetting: How a 2016 String Algorithm Solves AI's Biggest Memory Loss Problem

Stop Your LLMs from Forgetting: How a 2016 String Algorithm Solves AI's Biggest Memory Loss Problem

fig1a

Have you ever tried to read a massive pile of reports and summarize them in under 50 words? It’s hard. Now, imagine asking a cutting-edge Large Language Model (LLM)—like Gemini—to do it.

You might think AIs have perfect memories, but they don't. When forced to aggregate information from dozens of documents under strict length constraints, AIs suffer from severe "memory loss" biases. They either ignore the middle of your documents or completely forget the older information they read first.

In this article, we’ll introduce a simple yet powerful solution called Pyramid Aggregation. Intriguingly, this method is adapted from a 10-year-old string concatenation algorithm that was originally designed to make basic programming languages run faster. By applying it to modern AI, we solved the forgetting problem and achieved a **95% speed

@tanaikech
tanaikech / submit.md
Last active July 6, 2026 03:12
Investigation Report on Google Sheets PDF Generation Endpoints: `/export` vs `/pdf`

Investigation Report on Google Sheets PDF Generation Endpoints: /export vs /pdf

Background & Reference Gists

This document compiles the empirical architectural validation of the internal rendering pathways within the Google Sheets backend infrastructure. This investigation builds upon the foundations and reverse-engineering milestones established by the following developers:

@tanaikech
tanaikech / submit.md
Last active June 29, 2026 05:58
Exploring Sandboxing for AI-Generated Google Apps Script

Exploring Sandboxing for AI-Generated Google Apps Script

Native ggsrun Sandbox Execution Lifecycle Infographic

Abstract

Executing autonomous AI agent payloads in Google Workspace via the Apps Script API's scripts.run method introduces severe security risks. This article presents a novel sandboxing proposal designed specifically for the scripts.run method, using ggsrun as the orchestrator to execute code safely and efficiently. By performing in-memory token replacement and uploading a separate, alphabetically-prioritized guard file, this approach achieves robust API-level containment. Guided by ggsrun's automated backup and default rollback lifecycle (exe1), the remote environment is immediately restored, providing a clean, dependency-free security model for AI-driven Workspace automation.


@tanaikech
tanaikech / submit.md
Last active June 26, 2026 07:25
A Developer’s Guide to Agent Hooks in Antigravity CLI

A Developer’s Guide to Agent Hooks in Antigravity CLI

Core operational flow of the Antigravity CLI hooks subsystem, detailing lifecycle interception, out-of-band validation, and the execution response cycle.

Motivation

To be quite honest, "Hooks"—the shell commands we trigger at specific points when generative AI agents process tasks—were something I used blindly for a long time. Whenever colleagues asked me about them, I realized I lacked any real confidence in explaining how they actually work. However, when I migrated from Gemini CLI to the new Antigravity CLI, I noticed that the hooks system carried over. This felt like the right moment to stop guessing and finally develop a precise, deep understanding of the mechanism. I went back to the basics to analyze exactly how hooks operate under the hood and how we can use them effectively in the Antigravity environment. My goal is to demystify hooks so we can write them with confidence, an

@tanaikech
tanaikech / submit.md
Last active July 8, 2026 12:45
Orchestrating Google Workspace with Antigravity CLI: A High-Performance Agentic Framework

Orchestrating Google Workspace with Antigravity CLI: A High-Performance Agentic Framework

Abstract

This article explores the integration of Google Workspace with the Antigravity CLI, the high-performance successor to the legacy Gemini CLI. This integration is critical because it bridges the gap between low-latency, local agent execution and cloud-native enterprise productivity platforms. We demonstrate this framework by evaluating five core developer tools—the Google Workspace CLI, gas-fakes, ggsrun, GASADK/GoogleApiApp, and goodls—and mapping their capabilities into distinct local, hybrid, and cloud execution layers. Our analysis reveals how this unified architecture streamlines complex, multi-step agentic workflows while optimizing resource consumption, establishing a blueprint for next-generation workspace automation.

Introduction

The official release of the Antigravity CLI (agy) represents a significant paradigm shift, establ

@tanaikech
tanaikech / submit.md
Last active June 9, 2026 06:20
The 1-Second Timeout Hack: Running Infinite Parallel Workloads Natively on Google Apps Script

The 1-Second Timeout Hack: Running Infinite Parallel Workloads Natively on Google Apps Script

Infographic

Abstract

This paper presents a serverless architecture that overcomes the stateless nature and 6-minute execution limit of Google Apps Script (GAS). By configuring a 1-second immediate timeout in UrlFetchApp loopback calls, an orchestrator dispatches background tasks and terminates immediately. This design frees up the caller's execution quota while the target Web App runs to completion in an isolated container. Combined with a transactional Google Sheets state machine, this design supports self-perpetuating parallel MapReduce runs and multi-turn, state-hydrated generative AI agent networks without external compute infrastructure.

Introduction

@tanaikech
tanaikech / submit.md
Last active June 3, 2026 05:34
Executing Google Apps Script on Complex Schedules using Vibe Coding

Executing Google Apps Script on Complex Schedules using Vibe Coding

Infographics of TriggerApp

Abstract

Configuring complex time-driven triggers in Google Apps Script—such as executing tasks exclusively on weekday mornings—is notoriously intractable programmatically and strictly impossible via the standard UI. TriggerApp mitigates this architectural friction through a declarative JSON engine, allowing developers to completely bypass granular date-math logic. Now, by embedding a native Model Context Protocol (MCP) server, we cross into a definitive paradigm shift. Developers can orchestrate complex, continuously looping GAS schedules using natural language via Generative AI (Vibe Coding), preserve the hard 20-trigger quota limit through an elegant recursive daisy-chain architecture, and bypass the strict 6-minute execution timeout by dynamically queuing future execution batches.

Introduction

@tanaikech
tanaikech / submit.md
Created May 26, 2026 05:42
Vibe Code All Google APIs: The Zero-Trust Autonomous Agent for Google Apps Script

Vibe Code All Google APIs: The Zero-Trust Autonomous Agent for Google Apps Script

Autonomous Google API Agent (AGAA)

Abstract

Integrating autonomous AI agents into enterprise architectures exposes critical security and latency vulnerabilities. The Autonomous Google API Agent (AGAA) solves this by enforcing a deterministic, zero-trust execution framework directly within Google Apps Script (GAS). By merging GASADK, dynamic REST endpoint resolution via GoogleApiApp, and the Developer Knowledge API through the Model Context Protocol (MCP), AGAA executes complex cross-domain workflows exclusively via natural language. It autonomously researches API schemas, mitigates server-side formula latencies, handles recursive pagination, and mathematically enforces local Role-Based Access Control (RBAC). AGAA enables true "Vibe Coding" across all Google APIs—including Workspace, Analytics, and YouTube—without bloated client libraries.


@tanaikech
tanaikech / submit.md
Last active May 18, 2026 08:26
Agent Development Kit for Google Apps Script

Agent Development Kit for Google Apps Script

Infographics

Abstract

Google's Agent Development Kit (ADK) revolutionizes autonomous AI agents, yet its standard Node.js-based asynchronous ReAct architecture is fundamentally incompatible with the restrictive, synchronous, and time-bound execution environment of Google Apps Script (GAS). To unlock enterprise-grade AI natively within Google Workspace, this paper introduces GASADK. By abandoning the cyclical ReAct loop in favor of a deterministic Planner-Executor-Synthesizer (PES) architecture, GASADK proactively manages execution constraints, synchronous network blocking, and payload limits. This framework successfully implements multi-agent orchestration, the Model Context Protocol (MCP), and Agent-to-Agent (A2A) communication directly within GAS, empowering developers to build highly resilient, serverless AI workflows that seamlessly manipulate Workspace applications.

Introduction