Archive

1422 posts · Page 5 of 119. ← Blog

Pratik Dhanave · ·4 min read

Simulating Time — Testing the Behavior That Only Happens Later

Some of the most consequential code in any system runs when nobody is deploying: renewals at midnight, trials expiring on day 14, tokens timing out, retries backing off, data retention sweeping on schedule. Testing it by waiting is absurd; testing it by mocking one clock call is fragile; testing it properly means making time itself a controllable dependency of the system under test — and that choice, it turns out, improves the architecture even before it improves the tests.

Time becomes testable as an injected dependency: audit its disguises (timeouts, backoffs, TTLs, expiries), drive schedules through clock-driven executors, simulate by scope — discrete-event clocks in-process, one-clock slices across services, simulation as a product feature for platforms. Calendar edges are shared fixtures.

Pratik Dhanave · ·4 min read

What Evolves? A Map of Self-Evolving AI

The phrase "self-evolving agent" gets attached to systems so different that arguments about it are usually category errors: an agent that rewrites its own prompts, a loop that breeds faster GPU kernels, and a model that updates its weights from its own consensus answers are all "self-evolving" — and almost nothing else about them is alike. This series builds a working taxonomy by asking three questions that dissolve the terminology fights: what evolves, what feedback drives it, and where does the loop close?

The anatomy — model, harness, artifact — and the three loci of evolution: artifact (improve the products), harness (improve the scaffolding), model (improve the weights without gold answers), crossed by two axes: what feedback drives the loop and where it closes. Three questions replace the definition fights. Opens the series.

Pratik Dhanave · ·5 min read

Conversation Memory and Compaction — Surviving the Long Session

The first memory problem every agent hits is the humblest: the conversation itself outgrows the window. Tool outputs pile up, reasoning accumulates, and somewhere past the first hour the agent must start forgetting parts of its own session — the only question is whether it forgets with judgment or at random. Compaction is where memory engineering starts, and it's harder than it looks because the thing doing the summarizing is the thing that needs the summary.

The strategy ladder — buffer, sliding window, selective eviction, compaction — and why the top rung needs engineering: a preservation contract for what survives verbatim, structured rolling summaries, boundary-triggered timing, and the architectural rule that compaction should demote to episodic storage, never delete.

Pratik Dhanave · ·6 min read

AI Readiness — Processes, Data, Systems, Culture

A good use case pointed at an unready organization still fails — it just fails more expensively. Before building, the honest question is whether the organization can actually support what you're about to build: are the processes understood, is the data reachable and trustworthy, can the systems integrate, and will the people use it? Readiness assessment is the least glamorous stage of the adoption lifecycle and the one that most reliably predicts the outcome.

A good use case pointed at an unready organization still fails — just more expensively. The honest assessment across four pillars: processes mapped as they actually run, data that's reachable and trustworthy, systems that can be integrated with, and a culture that will actually use the thing. The output is a gap list that becomes the roadmap.

Pratik Dhanave · ·5 min read

Agentic Software Engineering in Go: The Complete Harness

Integrating context, specifications, and verification loops

Context, specifications, and verification loops composed into a single Go harness with one entry point — no path through it skips a discipline. The real execution flow and a real run, plus the honest wiring diagram: where the agent actually plugs in, and the artifact-compile gap that is the system's highest-leverage missing piece.

Pratik Dhanave · ·5 min read

Conditioning and Classifier-Free Guidance — How Text Steers the Image

Everything so far generates an image — any image the training distribution contains. A product needs the image you asked for. Conditioning is how a prompt gets wired into every denoising step, and classifier-free guidance — a two-line trick discovered almost apologetically — is the single knob that most determines whether the output actually obeys the prompt. The famous "CFG scale" slider in every image UI is this post.

Conditioning wires the prompt into every denoising step via text encoders and cross-attention — but the honest conditional distribution follows prompts too loosely. Classifier-free guidance fixes it: co-train an unconditional mode, then extrapolate the difference at sampling. One knob for fidelity vs diversity, 2× cost, and negative prompts for free.

Pratik Dhanave · ·4 min read

Why Billing Is an Engineering Problem

Most teams treat billing as a form you fill in at a payment provider — until the first incident teaches them otherwise. Billing sits at the intersection of money, state machines, and time: it must be exactly right, it changes under regulation and pricing strategy, and every bug is either lost revenue or an angry customer charged twice. This series treats monetization as the engineering discipline it actually is, from pricing models to metering to revenue integrity.

Billing is a correctness-critical, time-dominated system, not a form at a payment provider. The failure modes — public overcharging, silent undercharging, double-charges, price drift — demand financial-grade engineering, and the AI era raises the stakes: usage-based pricing makes metering and entitlements load-bearing. Opens an 8-post series.

Pratik Dhanave · ·4 min read

The Label Problem — Delay, Noise, and the Data Your Own Decisions Hide

Supervised learning assumes someone hands you the truth. In fraud, the truth arrives 30 to 90 days late, labeled by processes with their own agendas, for only the transactions you approved — and silence means nothing, because unreported fraud and un-disputed legitimate purchases are indistinguishable until they aren't. Label engineering is the least glamorous layer of a fraud system and the one that decides whether everything upstream learns reality or a convenient fiction.

Labels are an engineered pipeline: maturity horizons (recent silence is not legitimacy), labels as versioned state trajectories, early proxies weighted then reconciled; noise handled by provenance; and censoring confronted with bought data — bounded exploration of would-be declines booked as data acquisition cost.

Pratik Dhanave · ·4 min read

Test Environments — From the Staging Queue to Ephemeral Everything

Every scaling organization hits the same wall: one shared staging environment, N teams queuing for it, test runs colliding in it, and a database whose state is the accumulated sediment of every experiment ever run there. "It passed in staging" slowly loses all meaning. The way out isn't a better staging — it's dissolving the singleton: environments that are created per purpose, seeded to a known state, isolated from each other, and destroyed without ceremony.

The staging singleton fails by structure: contention, interference, accreted state, unowned fidelity decay. The cure is ephemeral environments — declared, purpose-scoped, seeded to known state, isolated by construction, created in minutes, reaped by TTL — paired honestly with canaries and flags for what only production reveals.

Pratik Dhanave · ·5 min read

The Memory Hierarchy of an Agent

Cognitive science spent a century mapping human memory into distinct systems — working, episodic, semantic, procedural — and agent engineering has been rediscovering the same partition from the opposite direction, because the same pressures produce the same shapes. The hierarchy isn't biomimicry for its own sake: each memory type answers a different question, is stored differently, retrieved differently, and fails differently. Confusing them is the root of most memory-system design mistakes.

Agent memory decomposes into four types with different jobs: working (the context window), episodic (what happened — read as history), semantic (what is true — needs revision, not just insertion), and procedural (how to act — evolves like code). They differ in storage, retrieval, and lifecycle, and most memory bugs are type confusions.

Pratik Dhanave · ·6 min read

Finding High-Value AI Use Cases

The fastest way to waste an enterprise's AI budget is to build the wrong thing impressively. Before any model is chosen, the decisive work is choosing which problems to point AI at — and doing it as a portfolio, weighing real business value against honest feasibility, rather than chasing whatever demos well. Use-case selection is where enterprise AI adoption is won or lost.

The fastest way to waste an AI budget is to build the wrong thing impressively. Use-case selection as a portfolio: value x feasibility scoring, the signatures of problems suited to AI (and the anti-signatures), resisting AI theater, and sequencing early wins against foundational bets so the program compounds.

Pratik Dhanave · ·6 min read

Agentic Software Engineering in Go: AI-TDD Verification Loops

Automated verification of agent-generated code

AI-TDD: every agent artifact runs a verification pipeline — build, test, lint — with structured findings driving bounded fix-retry loops. The real Go verification engine, plus the three bugs dogfooding found in the verifier itself: toolchain skew, a parser that reported '0 errors' while failing, and findings treated as crashes instead of verdicts.