Skip to content

Instantly share code, notes, and snippets.

View Nishkalkashyap's full-sized avatar
In pursuit of excellence

Nishkal Kashyap Nishkalkashyap

In pursuit of excellence
View GitHub Profile
@Nishkalkashyap
Nishkalkashyap / puppeteer-architecture-blog.md
Last active January 28, 2026 10:16
Puppeteer Memory: Giving AI Agents Long-Term Memory Without the Context Window Tax (WIP)

Puppeteer Memory: Giving AI Agents Long-Term Memory Without the Context Window Tax

TL;DR: We built a two-agent architecture where a "Puppeteer" agent manages memory (timeline checkpoints + learned knowledge) and directs a stateless "Executor" agent. The executor is a Boltzmann brain—spawned fresh each run with no concept of history. But to the user, the system appears to have perfect memory.


The Problem: AI Agents Forget

Every AI agent has a fundamental constraint: limited context windows.

@Nishkalkashyap
Nishkalkashyap / gemini.object-converter.ts
Last active October 23, 2025 20:33
Zod Schema Converter for Google Generative AI Compatibility
/**
* Gemini generated object to original schema compatible object converter
*
* Utility to convert Gemini generated objects back to their original schema format.
* Pairs with gemini.schema-converter.ts
*/
import { z } from "zod";
function findDiscriminatorKey(schema: z.ZodTypeAny): string | null {
if (schema instanceof z.ZodUnion) {