Kubai Kevin

39 articles tagged Generativeai

3 LLM context techniques: when each fails

Compare fine-tuning, retrieval-augmented generation and long context by failure mode, cost arithmetic and a decision checklist, with code for each.

15 min read · 1 November 2026

Context engineering: the real fix for agent hallucinations

Long-running agents fail because their context fills with stale tool output and contradictions. Here is how to structure, prune and measure that context.

16 min read · 27 October 2026

7 guardrails for safer LLM apps

A practical review of seven guardrail layers for LLM applications: what each catches, where it fails, and which to build first.

18 min read · 25 October 2026

Agentic systems: architecture principles that hold

How to enforce deadlines, token budgets, idempotency keys and bounded fan-out around multi-model agent graphs, with Python code and tests.

15 min read · 23 October 2026

Agent code review: 7 traps that slip through

Agent-written code passes its own tests and reads as deliberate. Here are seven recurring traps, the mechanical checks that catch them, and how to measure.

17 min read · 23 October 2026

Detecting silent agent failures

A layered quality gate that catches well-formed but wrong agent output: schema checks, PII scans, citation grounding, and a model judge, plus how to measure each.

15 min read · 13 October 2026

Agent audit trails: event log vs state snapshots

Event sourcing and state snapshots solve different audit problems for AI agents. Compare causal reconstruction, debugging fidelity, cost, and replay limits.

13 min read · 12 October 2026

LLM evals: LangSmith vs Promptfoo in prod

How to choose between hosted trace-based eval platforms and local CLI eval runners, with latency, cost, CI and data-residency tradeoffs.

15 min read · 3 October 2026

Who signs off on AI code?

AI coding assistants produce diffs fast, but accountability still needs a named human. Here is a review workflow with hooks, policy checks, and failure modes.

12 min read · 2 October 2026

Agentic workflows: surviving network partitions

How to keep agentic workflows correct when networks drop: idempotency keys, an outbox with stable action IDs, and reconciliation on reconnect.

18 min read · 1 October 2026

Multi-agent handoffs: the latency tax nobody measures

Multi-agent pipelines pay a latency tax at every handoff. Here is how to measure serialisation, transport and re-prompting cost, and what to fix first.

11 min read · 29 September 2026

Agent architecture: the new model trap

Newer models made prompt chaining obsolete but not policy enforcement. How to keep a deterministic layer around a capable planner.

17 min read · 27 September 2026

Multi-agent systems: when they quietly degrade

Multi-agent LLM systems drift into slow, costly behaviour without failing loudly. Here is what to instrument, what to budget, and how to catch the slide.

12 min read · 24 September 2026

When your agent goes silent: degrade gracefully

How to keep agent-backed features useful when a model is slow or confidently wrong: deadlines, fallbacks, circuit breakers, validation, and how to measure each.

13 min read · 21 September 2026

Context windows: agents that run for days

Long-running agents fail when context is treated as a log. Keep constraints verbatim, checkpoint durable state, and cap the working set per cycle.

17 min read · 19 September 2026

Most LLM cost dashboards lie…

Per-request token attribution, prompt caching, model routing and retry caps: how to instrument LLM spend so the numbers match the invoice.

13 min read · 19 September 2026

Multi-agent systems: why failures hide

Why multi-agent LLM pipelines fail silently, and how per-agent tracing, schema validation, budget enforcement, and loop detection make those failures loud.

13 min read · 18 September 2026

Stop Putting LLM Keys in .env

Why flat .env files fail at scale for LLM API keys, and how a secrets manager plus gateway brokering scoped credentials fixes rotation and leaks.

14 min read · 17 September 2026

LLM agents: why monoliths win

Why splitting an LLM agent into micro-services often costs latency, audit continuity and money, and how to measure before you decompose.

11 min read · 10 September 2026

Two engineer classes: the AI tool norm trap

Uneven AI tool adoption fractures teams through review load, not productivity. Here is how to make AI-assisted code reviewable with a PR template and one metric.

12 min read · 7 September 2026

LLM eval drift that users notice first

Three pipeline-level causes of user-visible LLM drift, how to instrument each one, and how to verify the fix with metrics rather than vibes.

16 min read · 28 August 2026

agent code review gap nobody admits

AI-generated PRs pass linting and unit tests yet break production. The gap is environment fidelity, not code quality. Here is how to close it.

13 min read · 27 August 2026

Validating AI-Generated Code Before It Reaches Production

AI-written code often fails quietly under load. Here is how to validate it at build time, guard it at runtime, and keep on-call triage fast.

10 min read · 20 August 2026

Agent frameworks: stop rewriting the same glue code

Agent glue code — retries, credentials, state — is mostly boilerplate. Here are three abstractions, worked examples, and how to measure the savings.

13 min read · 10 August 2026

Context windows live longer than you think

Long-running agents exhaust context windows through unbounded history growth. Covers pruning, summarisation, retrieval, and retention policies with code.

13 min read · 25 July 2026

AI code in prod? Postmortems still work

AI-generated code hides its assumptions. Capture the prompt, model snapshot and runtime context so incident reviews explain decisions, not just stack traces.

11 min read · 21 July 2026

Agents keep breaking prod: 3 boundary rules you still need

Agents that mutate external state fail silently when 2xx is mistaken for completion. Three boundary rules: outcome polling, schema drift gates, atomic claims.

14 min read · 17 July 2026

Stabilize multi-model agent routers: six production rules

Six rules for multi-model agent routers: bounded concurrency, idempotency keys, timeouts, observability, and how to measure each one yourself.

15 min read · 15 July 2026

Observability for LLM Features: Metrics That Drive Decisions

Log one structured event per LLM interaction instead of tracing every token, then alert only on user-facing outcomes that justify keeping a feature.

14 min read · 8 July 2026

LLMOps 2026: evaluation stack that replaced RAG dashboards

Why RAG dashboards miss real failures, and how to build an evaluation stack around task resolution, dataset rotation, prompt versioning, and drift checks.

13 min read · 5 July 2026

LLM drift: the silent quality drop metrics miss

Latency and error rate stay flat while LLM output quality quietly degrades. Here is how to log prompts, measure embedding drift, and catch it early.

11 min read · 4 July 2026

Test AI code without testing the AI

A practical testing strategy for AI-assisted code: property-based, contract, fuzz, snapshot, and chaos testing, with worked examples and a decision table.

16 min read · 1 July 2026

AI wrote the docs — humans wrote the gaps

AI generates API reference docs well but omits rate limits, deprecations and retry rules. A pattern for keeping human-written edge cases in sync with code.

13 min read · 1 July 2026

RAG is not enough: hybrid search + reranking in 2026

Dense retrieval alone ranks poorly. A two-stage pipeline of BM25 plus a cross-encoder reranker fixes it. Architecture, code, and how to measure it.

12 min read · 27 June 2026

LLM output metrics that actually move the needle

A layered approach to measuring LLM output quality in production: structured validation, p95 latency, cost per request, and retention signals.

10 min read · 26 June 2026

AI codebase onboarding: 2 paths compared

Two onboarding paths for AI-heavy repos: passive shadow-mode review versus guided scaffolding, with decision criteria and failure modes.

12 min read · 24 June 2026

JSON mode’s silent failures exposed

JSON mode enforces grammar, not your contract. Here is how to build a schema-validated envelope pipeline with deterministic repair and quarantine.

11 min read · 21 June 2026

AI stole system design

AI can generate a polished system design in seconds. Here is how to redesign interviews around live debugging so you test real understanding.

11 min read · 21 June 2026

LLM metrics that stop wasting time

A practical guide to LLM evaluation in production: grounding checks, drift detection, cost and latency metrics, and how to measure each one.

13 min read · 14 June 2026