跳到正文
原文
Tomasz Tunguz 博客·· 2026-08-24AI 评分52

How Long Should an AI Agent Live?

How Long Should an AI Agent Live?

文章要点
  • 1作者主张日常协调 Agent 只活 24 小时,午夜清空对话并把持久偏好存入文件。
  • 2引用研究称长上下文记忆随输入增长退化,另有论文称压缩在 30-59% 场景丢掉长期规则。
  • 3长会话存在安全风险,持有多年读写权限的助手可被一封恶意邮件投毒、数月后劫持日程。
  • 4作者称 Grok Bot 等现有助手不会自动执行每日重置,需手动新建会话或依赖压缩。
决策要点

Agent 会话寿命正变成需要显式设计的工程决策,长期记忆应放进文件而不是无限延续的对话历史。

  • 影响:企业自建或采购 Agent 时需把会话边界和权限时效写进设计;长期开着的会话会积累记忆退化,并放大被单封恶意邮件投毒的风险敞口;持久偏好与规则需要落盘成文件来统一管理。
  • 参考:可考虑盘点在用 Agent 的会话策略,给日常助手设定重置周期并把关键规则写入文件;试点时把单任务派给只带必需工具的短命子 Agent 并记录效果。
  • 依据:论点来自作者个人设计模式,辅以 Chroma 长上下文退化与记忆投毒等引用论文,属作者转述,暂无企业侧落地验证。
正文

Mary, Mary, quite contrary, how long do your agents live?

New products like Grok Bot & other meta-harnesses ask us to create agents. How long should they live?

When you design a calendar agent, how long should its session run? Should it stay alive for your entire five-year tenure at a company, or reset every day?

Grok Bot specialized agent interface showing dedicated calendar, email, and news agents

Ever more powerful models tempt us to build perpetual sessions that never close. But long-running sessions rot from the inside out.

As conversational turns pile up, attention degrades. Modern models easily spot a single fact in a long document. But research shows even across frontier models, agent memory is like human memory : it degrades as it grows.1

Temporary commands turn into permanent ghosts. Tell your bot in March, “I have a cold this week, cancel morning meetings,” & by November it is still avoiding morning slots.

Long sessions also break security. An agent holding multi-year read & write access to your inbox & calendar is an open door. One malicious email or calendar invite can poison the conversation, quietly hijacking your schedule months down the road.2

The winning pattern is simple : give your daily assistant a 24-hour life, & delegate individual tasks to narrow specialists.

A daily reset matches how humans actually work. During the day, your assistant remembers immediate context : “I’m running fifteen minutes late,” or “keep two to three free for prep.” At midnight, the active conversation wipes clean so tomorrow starts fresh.

When work needs doing, the daily coordinator hands the job to a single-purpose helper : a calendar agent to schedule, an email agent to draft a reply, or a news agent to search the web. Each helper lives for thirty seconds with only the specific tools it needs, does the job, & disappears.3

For the daily coordinator, the system prompt acts as a dispatcher :

You are Tomasz's daily coordinator.
Your session lives for 24 hours.

Workflow:
- Morning: Load preferences from `preferences.md`
  & today's calendar.
- Intraday: Do not execute directly. Delegate
  to sub-agents (`calendar_bot`, `email_bot`).
- Night: At midnight, save durable learnings
  to `preferences.md` and terminate.

For the calendar helper, the system prompt is a stateless executor :

You are an ephemeral calendar specialist.
Process this single request, call the tool,
report the result, & terminate.

Rules:
- Time zone: America/Los_Angeles.
- Duration: 30 minutes.
- Hours: 9:00 AM – 6:00 PM.
- Always check availability first.
  Never double-book.
- If full, propose 2 nearest openings & stop.

Output: Return event title, time, & attendees,
then exit.

Before the day’s session wipes at midnight, a quick consolidation pass runs. An offline summarizer reviews the day, saves lasting preferences (“Tomasz prefers thirty-minute meetings”) into a permanent note on disk, & throws away the rest of the daily chatter.4

Does Grok Bot or your chat assistant perform this sleep cycle automatically?

Not today. Most bots leave threads open forever until you click “+ New Chat” or context compaction silently erases your rules.

An editorial line illustration of a robot kneeling in a garden, carefully cultivating rows of cockle shells and silver bells

The nursery rhyme asks about a garden : silver bells & cockle shells, all in a row. Things that persist, in an order someone chose. The answer for an agent is the same : throw away the conversation ; keep the rules in a file to keep your agent & its garden healthy.


  1. Amirali Ebrahimzadeh and Seyyed Muhammad Salili, “Not All Needles Are Found: How Fact Distribution and Prompting Shape Inference in Long-Context LLMs,” arXiv:2601.02023, January 2026; Kelly Hong et al., “Context rot: How increasing input tokens impacts LLM performance,” Chroma Research, 2025. ↩︎

  2. “Sleeper Memory Poisoning in LLM Agents,” arXiv:2605.15338, May 2026. Demonstrates persistent cross-session memory poisoning attacks in stateful AI assistants. ↩︎

  3. Shiyang Chen, “Governance Decay: How Context Compaction Silently Erases Safety Constraints in Long-Horizon LLM Agents,” arXiv:2606.22528, June 2026. Demonstrates that compaction drops standing rules in 30–59% of episodes. ↩︎

  4. Anthropic, “Dreams: Memory Consolidation,” research preview dreaming-2026-04-21, April 2026; and the Letta v2 stateful agent framework (2026). ↩︎

来源:Tomasz Tunguz 博客 · tomtunguz.com