Skip to main content

09. Advanced Concepts

Persistent Agents, Evaluation and Benchmarking

Persistent agents keep an identity, durable memory, and goals across sessions: they wake on schedules or events, work under budgets, checkpoint state, then sleep until the next trigger. Evaluation and benchmarking turn demos into gates β€” offline golden sets, shadow traffic, online success/SLA/cost/safety metrics, and regression bars that block shipping. Public benches inform; your private suite decides production readiness.

What you will learn

  • Contrast persistent agents with single-session chat agents
  • Design wake-act-checkpoint-sleep lifecycles with budgets
  • Build offline, shadow, and online evaluation layers
  • Use benchmarks wisely and set regression ship gates
  • Answer interview questions with short, solid answers
Identity memory wake act checkpoint eval pipeline
Interview staple: persistence needs checkpoints; shipping needs eval gates.

Definition

A persistent agent is a long-lived system with a stable identity, stored memory/state, and the ability to resume work across time β€” via schedules, queues, or user returns β€” rather than a single chat session that forgets everything. Evaluation is how you measure whether that agent (or any agent) meets task, safety, latency, and cost goals. Benchmarking compares agents or versions on fixed suites.

Persistence without budgets becomes a cost and risk sink. Benchmarks without private golden sets become vanity leaderboards.

Introduction

This lesson (#10 in Advanced Concepts) closes Module 09. Multimodal and voice extend channels; persistence and eval decide what stays reliable over weeks of operation.

Next module: Agent Communication Protocols β€” starting with Introduction to AI Agent Protocols (MCP, A2A, and friends).

Why persistence

  • Goals span hours or days (research, ops, onboarding)
  • Users expect continuity: preferences, open tasks, history
  • Schedulers enable proactive checks without always-on GPUs
  • Checkpoints survive crashes and deploys
  • Still need retention policies and cost caps

Lifecycle

  • Provision - agent id, roles, tool allowlists, memory store
  • Schedule / event - cron, webhook, user open, SLA timer
  • Wake - load checkpoint, goals, budgets remaining
  • Act - budgeted tool loop toward current goals
  • Checkpoint - save state, traces, next wake conditions
  • Sleep / retire - free compute; honor retention and delete

Wake-act-checkpoint loop

Think durable workflow + agent reasoning, not infinite chat.

Schedule wake work checkpoint sleep resume loop
Each wake is a bounded session with explicit stop and save rules.
  • Schedule or event fires the wake
  • Load durable memory and open goals
  • Work under step/token/time budgets
  • Checkpoint progress and failures
  • Sleep until next trigger or HITL
  • Alert on stuck goals or budget exhaustion

What to persist

  • Identity, roles, and policy version
  • Goals / task queue with statuses
  • Episodic summaries and structured facts (with TTLs)
  • Tool allowlists and credential references (not raw secrets)
  • Eval scores and last regression results
  • Not: raw secrets, unbounded chat dumps, stale PII

Evaluation layers

Stack offline β†’ shadow β†’ online; never jump straight to prod trust.

Offline shadow online regression gate layers
A failed offline or shadow gate should block promotion.
  • Offline - golden fixtures, unit-like agent scenarios
  • Shadow - run new version without side effects; compare
  • Online - success rate, SLA, cost, safety incidents
  • Human ratings - sample reviews for quality and tone
  • Regression gates - min scores to ship or wake more traffic
  • Slice by task type, locale, and modality

Benchmarking wisely

  • Public benches (coding, tool-use, web) help compare research
  • Contamination and prompt overfitting are real risks
  • Private suites mirror your tools, data, and policies
  • Report confidence intervals and cost, not only accuracy
  • Version fixtures; treat eval code as product code

Failure modes

  • Always-on agents burning tokens with no schedule
  • Memory bloat and stale facts causing wrong actions
  • No checkpoints β€” crash loses multi-day work
  • Shipping on demo vibes without regression gates
  • Overfitting to a public leaderboard
  • Ignoring safety and cost in β€œsuccess” metrics

Map to earlier modules

  • Memory / long-horizon = what persistence stores and resumes
  • Workflows = schedulers and durable step runners
  • Observability = traces feeding online eval
  • Reflection = offline critics and rubric scores
  • Next: protocols so agents can talk to tools and each other

Program / implementation notes

Store agent_state (goals, memory pointers, budget left) in SQL/KV. Wake via queue/cron. Run a max-step session, write checkpoint, emit metrics. Maintain a golden JSONL suite in CI; fail the build on score drop.

  • Start with one scheduled agent and ten golden cases
  • Next: Introduction to AI Agent Protocols

Advantages and limitations

  • Advantage: continuity across days and crashes
  • Advantage: proactive work via schedules
  • Advantage: eval gates reduce silent regressions
  • Limitation: persistence increases privacy and drift risk
  • Limitation: benchmarks can mislead without private suites
  • Limitation: online metrics lag β€” need shadow first

Key points

  • Persistent agents: identity + durable memory + wake/checkpoint.
  • Each wake is budgeted work, then sleep with saved state.
  • Eval stack: offline golden β†’ shadow β†’ online metrics.
  • Regression gates block ship when scores drop.
  • Public benches inform; private suites decide production.
  • Track success, SLA, cost, and safety β€” not demos alone.

FAQs

Persistent agent vs chatbot with history?

Chat history is usually session-scoped context. Persistent agents keep identity, goals, and structured state across sessions and can wake without the user present.

Offline eval vs online eval?

Offline uses fixed fixtures before deploy. Online measures live success, latency, cost, and incidents. Use both; online alone is too late for many failures.

What is shadow evaluation?

Running a candidate agent on real inputs without applying its side effects, then comparing outputs or scores to the production agent.

Are public benchmarks enough to ship?

No. They help research comparison. Ship on private suites that match your tools, data, policies, and regression gates.

Interview questions

  1. What is a persistent agent?

    Answer A long-lived agent with stable identity and durable state that resumes goals across sessions via schedules or events, under budgets and retention policies.

  2. Describe the wake-act-checkpoint loop.

    Answer A trigger wakes the agent, it loads state and works under budgets, then checkpoints progress and sleeps until the next wake or HITL.

  3. How should you evaluate agents before production?

    Answer Run offline golden suites, then shadow traffic without side effects, then promote with online metrics and human sample reviews.

  4. What belongs in a regression ship gate?

    Answer Minimum task success, safety checks, latency/cost budgets, and no drop beyond a set threshold versus the last good version.

  5. Public benchmark vs private eval suite?

    Answer Public benches compare research systems. Private suites mirror your tools and policies and are the source of truth for shipping.

  6. What risks grow with persistence?

    Answer Stale memory, PII retention, cost runaway from frequent wakes, and silent drift without continuous evaluation.

Related topics

Practice task

Complete each numbered practice step in a notebook or doc before opening the next lesson.

  1. Define agent_state fields for a weekly research digest agent (goals, memory refs, budgets).
  2. Write wake triggers and max step/token budgets per wake.
  3. Sketch ten golden fixture cases and pass/fail criteria.
  4. List regression gate metrics that would block a release.
  5. Answer interview questions 1, 3, and 5 in two sentences each.