Skip to main content

Engineering blog

Notes from building real systems.

Production lessons from full-stack development, scalable architecture, TypeScript, JavaScript, Python, Generative AI, real-time systems and the decisions behind software that has to keep working after launch.

What you’ll find hereArchitecture breakdowns, debugging lessons, multi-language examples, implementation patterns, code and production trade-offs.
AI Engineering17 min read

Your Agent Wrote the Code. Treat It Like an Untrusted Tenant.

Model-generated code should cross a real security boundary before it executes. Design production agent sandboxes with layered isolation, default-deny capabilities, bounded resources, controlled egress, side-effect gateways, reproducible manifests, and audit-ready execution records.

Read article
AI Engineering14 min read

Your Agent Changed Production. Where Is the Decision Record?

Agent traces can show what executed without proving why a consequential action was allowed. Build durable decision records that bind evidence, policy, authorization, tool activity, side-effect receipts, and reconciliation into an audit-grade history for production AI agents.

Read article
AI Engineering12 min read

The Trace Says Your Agent Failed. It Doesn’t Say Why.

A production trace tells you what happened. It does not prove which prompt, model, retrieval snapshot, tool schema, policy, or dependency caused the failure. Freeze the incident, run controlled counterfactual replays, repeat stochastic variants, and turn attribution evidence into regression gates.

Read article
AI Engineering12 min read

Your Agent Retried the Failure. Then It Learned the Wrong Lesson.

Retries are not safe just because they use backoff. A failed agent attempt can carry stale evidence, speculative reasoning, malformed tool arguments, and ambiguous side effects into the next attempt. Build clean retry forks from validated checkpoints, reconcile uncertain writes, and make retry policy explicit.

Read article
AI Engineering13 min read

Your Backup Model Is Not a Failover Plan.

When the primary model provider degrades, production agents need more than retries. Add failure classification, circuit breakers, eval-gated fallbacks, durable workflow state, idempotent side effects, backpressure, and explicit degradation modes.

Read article
AI Engineering9 min read

How I Build Generative UI with LangGraph and React

A practical example of Generative UI using a shopping assistant: LangGraph understands the request, the backend searches real product data, and React renders safe, reusable components such as product cards and purchase confirmation.

Read article
AI Engineering11 min read

A Reasoning Model Is a Job, Not a Very Slow HTTP Request

Long-running reasoning models can spend minutes planning, calling tools, and revising results. Treat them as durable jobs with explicit budgets, checkpoints, cancellation, leases, resumable events, and provider-state boundaries instead of stretching a synchronous request until it breaks.

Read article
AI Engineering9 min read

AI Transparency Is an Output Pipeline, Not a Disclaimer

AI transparency is not solved by adding “generated by AI” under a button. A production design for disclosure, machine-readable provenance, C2PA Content Credentials, editorial responsibility, and auditable policy decisions under current EU AI Act transparency rules.

Read article
AI Engineering7 min read

Treat Agent Skills Like Dependencies, Not Prompt Snippets

Agent skills can bundle instructions, resources, scripts, and tool workflows. That makes installation a software-supply-chain decision: verify origin, pin versions, inspect requested capabilities, sandbox execution, and make updates auditable instead of auto-trusting a convenient folder.

Read article
AI Engineering6 min read

Model Routing Should Be a Policy Engine, Not a Vibe Check

Not every AI request needs the strongest model, but routing by intuition creates silent quality regressions. A production model router that combines task class, risk, context, latency, budget, capability requirements, and evaluation data.

Read article
AI Engineering8 min read

Prompt Caching Rewards Boring Prompt Architecture

Provider prompt caches work best when reusable instructions, tool contracts, and background context form a stable prefix. This article restructures agent prompts for cacheability without mixing tenant data, hiding prompt changes, or optimizing away correctness.

Read article
AI Engineering7 min read

An AI Budget Should Fail Before the Invoice Does

Logging token cost after the fact is accounting, not control. This article designs per-tenant AI budgets with atomic reservations, actual-usage settlement, soft and hard limits, and concurrency-safe metering for RAG and agent workloads.

Read article
AI Engineering8 min read

Backpressure Is What Keeps Agent Fan-Out From Becoming an Outage

Per-run concurrency limits are not enough when hundreds of agents share the same dependencies. This article builds system-level backpressure with bounded queues, rate limits, admission control, and circuit breakers so overload fails predictably instead of cascading.

Read article
AI Engineering8 min read

Tracing an AI Agent Like a Distributed System

An agent run is a distributed trace: model calls, retrieval, tools, retries, queue waits, approvals, and token usage all need one correlation model. A practical OpenTelemetry design for debugging latency, failures, and AI spend without logging sensitive prompts by default.

Read article
AI Engineering7 min read

You Cannot Debug an Agent Run You Cannot Replay

LLM agents combine nondeterministic models, time, randomness, retrieval, and external tools. A replayable run records those boundaries so developers can reproduce decisions without re-triggering real side effects.

Read article
AI Engineering7 min read

Single-Turn Evals Miss the Ways Agents Actually Fail

Tool-using agents often fail after several exchanges: they ask the wrong clarification, forget constraints, repeat work, or take unsafe shortcuts. A simulated-user harness can test full trajectories while keeping the user model separate from scoring.

Read article
AI Engineering7 min read

LLM Judges Need Their Own Test Suite

An LLM judge can automate semantic evaluation, but it brings position bias, verbosity bias, self-preference, rubric drift, and variance. A practical calibration workflow using blinded pairwise tests and human-labeled anchors.

Read article
AI Engineering7 min read

Security Does Not End When the Agent Finishes Reasoning

An agent can obey its tool permissions and still leak secrets or sensitive data in the final response. This article adds a separate egress boundary for destination checks, secret detection, structured redaction, and policy-aware release.

Read article
AI Engineering6 min read

MCP Does Not Mean Every Tool Belongs in Every Prompt

Large MCP installations can waste context on tool schemas and intermediate results. A host-side design for progressive discovery, schema caching, and sandboxed programmatic execution that keeps the model focused on reasoning.

Read article
AI Engineering6 min read

Stop Putting Entire Tool Results Back Into the Prompt

Large logs, SQL results, API payloads, and documents should not automatically become model context. This pattern stores artifacts outside the prompt and returns a bounded preview plus a secure handle for targeted read-back.

Read article
AI Engineering6 min read

Stale Context Is a State-Versioning Bug

An agent can fit comfortably inside its context window and still act on obsolete facts. This design keys observations by resource identity and version so current state replaces stale context instead of accumulating beside it.

Read article
AI Engineering6 min read

Agent Tool Access Is Not User Authorization

An agent may have technical access to a tool while the current user has no right to perform the requested action. A practical authorization layer for multi-tenant tool calls using explicit actor context and least privilege.

Read article
AI Engineering5 min read

Tool Calls Fail Like APIs, Not Like Prompts

A production tool layer for AI agents should validate arguments, classify failures, budget retries, respect deadlines, and return useful observations instead of blindly asking the model to try again.

Read article