"<!DOCTYPE html>\n<html lang=\"zh\" data-theme=\"light\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>fulltext.txt — Vercel Design System</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap\" rel=\"stylesheet\">\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css\">\n<style>\n\n:root {\n  /* Vercel Palette */\n  --geist-foreground: #171717;\n  --geist-background: #ffffff;\n  --geist-secondary: #4d4d4d;\n  --geist-tertiary: #666666;\n  --geist-quaternary: #808080;\n  --geist-border: #ebebeb;\n  --geist-surface-tint: #fafafa;\n  \n  /* Workflow Accents */\n  --develop-blue: #0a72ef;\n  --preview-pink: #de1d8d;\n  --ship-red: #ff5b4f;\n  \n  /* Interactive & Status */\n  --link-blue: #0072f5;\n  --ds-focus-color: hsla(212, 100%, 48%, 1);\n  --badge-blue-bg: #ebf5ff;\n  --badge-blue-text: #0068d6;\n  \n  /* Shadow-as-Border Philosophy */\n  --shadow-border: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(0, 0, 0, 0.16) 0px 0px 0px 1px;\n  --shadow-card: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(0, 0, 0, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.06) 0px 4px 6px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-full: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, rgba(0, 0, 0, 0.04) 0px 8px 8px -8px, #fafafa 0px 0px 0px 1px;\n  --shadow-ring: rgb(235, 235, 235) 0px 0px 0px 1px;\n  \n  /* Radius Scale */\n  --radius-xs: 2px;\n  --radius-sm: 4px;\n  --radius-md: 6px;\n  --radius-lg: 8px;\n  --radius-xl: 12px;\n  --radius-pill: 9999px;\n}\n\n[data-theme=\"dark\"] {\n  --geist-foreground: #ededed;\n  --geist-background: #000000;\n  --geist-secondary: #a1a1a1;\n  --geist-tertiary: #888888;\n  --geist-quaternary: #666666;\n  --geist-border: #222222;\n  --geist-surface-tint: #0a0a0a;\n  \n  --shadow-border: rgba(255, 255, 255, 0.14) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(255, 255, 255, 0.28) 0px 0px 0px 1px;\n  --shadow-card: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.4) 0px 2px 4px, #111111 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(255, 255, 255, 0.2) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 6px 12px, #111111 0px 0px 0px 1px;\n  --shadow-card-full: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 8px 16px -4px, #111111 0px 0px 0px 1px;\n  --shadow-ring: rgb(40, 40, 40) 0px 0px 0px 1px;\n  \n  --badge-blue-bg: rgba(10, 114, 239, 0.15);\n  --badge-blue-text: #70b5ff;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; }\nbody {\n  margin: 0;\n  font-family: \"Geist\", Arial, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  background-color: var(--geist-background);\n  color: var(--geist-foreground);\n  font-feature-settings: \"liga\" 1;\n  -webkit-font-smoothing: antialiased;\n  min-height: 100vh;\n}\n\na {\n  color: inherit;\n  text-decoration: none;\n  transition: color 0.15s ease;\n}\n\n/* 导航栏 (Vercel Clean Sticky Nav) */\n.vercel-nav {\n  position: sticky;\n  top: 0;\n  background-color: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  z-index: 100;\n  padding: 0 24px;\n  height: 64px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n.nav-brand {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n.vercel-triangle {\n  width: 22px;\n  height: 19px;\n  fill: var(--geist-foreground);\n}\n.nav-title {\n  font-size: 16px;\n  font-weight: 600;\n  letter-spacing: -0.32px;\n  color: var(--geist-foreground);\n}\n.nav-badge-pill {\n  font-family: \"Geist Mono\", ui-monospace, monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  background: var(--badge-blue-bg);\n  color: var(--badge-blue-text);\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n}\n\n.nav-links {\n  display: flex;\n  align-items: center;\n  gap: 24px;\n}\n.nav-link {\n  font-size: 14px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.nav-link:hover, .nav-link.active {\n  color: var(--geist-foreground);\n}\n.nav-link.active {\n  font-weight: 600;\n}\n\n.nav-actions {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n\n/* 按钮规范 */\n.btn-primary-dark {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: opacity 0.15s;\n}\n.btn-primary-dark:hover {\n  opacity: 0.9;\n}\n.btn-secondary-white {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: background 0.15s, box-shadow 0.15s;\n}\n.btn-secondary-white:hover {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border-hover);\n}\n.theme-toggle-btn {\n  background: transparent;\n  border: none;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  width: 36px;\n  height: 36px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--geist-foreground);\n}\n\n/* 核心容器 */\n.vercel-container {\n  max-width: 1200px;\n  margin: 0 auto;\n  padding: 56px 24px 100px;\n}\n\n/* Hero Section (Gallery Emptiness + Negative Letter-spacing) */\n.vercel-hero {\n  text-align: center;\n  max-width: 860px;\n  margin: 0 auto 56px;\n}\n.hero-stage-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 4px 14px;\n  border-radius: var(--radius-pill);\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  margin-bottom: 24px;\n}\n.stage-dot {\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n}\n.vercel-hero h1 {\n  font-size: 48px;\n  font-weight: 600;\n  line-height: 1.05;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 16px;\n}\n.vercel-hero p {\n  font-size: 20px;\n  font-weight: 400;\n  line-height: 1.80;\n  color: var(--geist-secondary);\n  margin: 0 auto 28px;\n}\n\n/* Workflow Pipeline (Develop -> Preview -> Ship) */\n.workflow-pipeline {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 768px) {\n  .workflow-pipeline { grid-template-columns: 1fr; }\n}\n.workflow-step {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px 22px;\n  transition: box-shadow 0.2s;\n}\n.workflow-step:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n.step-mono-label {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  margin-bottom: 8px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n.step-title {\n  font-size: 20px;\n  font-weight: 600;\n  letter-spacing: -0.96px;\n  color: var(--geist-foreground);\n  margin-bottom: 6px;\n}\n.step-desc {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n\n/* Metric Cards (Section 4 Spec) */\n.metric-grid {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 900px) {\n  .metric-grid { grid-template-columns: repeat(2, 1fr); }\n}\n.metric-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n}\n.metric-number {\n  font-size: 40px;\n  font-weight: 600;\n  line-height: 1.0;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin-bottom: 8px;\n  font-feature-settings: \"tnum\" 1;\n}\n.metric-label {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.4;\n}\n\n/* VAD 专栏 Banner (Ship Red & Vercel Clean) */\n.vad-showcase {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-xl);\n  padding: 32px;\n  margin-bottom: 48px;\n  position: relative;\n}\n.vad-header-row {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  flex-wrap: wrap;\n  gap: 12px;\n  margin-bottom: 12px;\n}\n.vad-header-row h2 {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  color: var(--geist-foreground);\n  margin: 0;\n}\n.vad-pillars-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n  gap: 14px;\n  margin-top: 24px;\n}\n.vad-pillar-item {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 14px 16px;\n}\n.vad-pillar-title {\n  font-size: 14px;\n  font-weight: 600;\n  color: var(--ship-red);\n  margin-bottom: 4px;\n}\n.vad-pillar-text {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n.vad-filter-bar {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  margin: 24px 0 16px;\n  padding: 12px 16px;\n  background: var(--geist-surface-tint);\n  border-radius: var(--radius-md);\n  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);\n}\n.vad-filter-btn {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  font-weight: 500;\n  padding: 6px 14px;\n  border-radius: 9999px;\n  border: none;\n  background: transparent;\n  color: var(--geist-secondary);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.vad-filter-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0,0,0,0.05);\n}\n.vad-filter-btn.active {\n  background: #171717;\n  color: #ffffff;\n}\n.vad-search-input {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  padding: 7px 12px;\n  border-radius: 6px;\n  border: 1px solid var(--geist-border);\n  background: #ffffff;\n  color: var(--geist-foreground);\n  width: 280px;\n  outline: none;\n  transition: border-color 0.15s, box-shadow 0.15s;\n}\n.vad-search-input:focus {\n  border-color: #0a72ef;\n  box-shadow: 0 0 0 2px rgba(10, 114, 239, 0.2);\n}\n\n/* 控制栏：搜索、视图、筛选 */\n.control-bar {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 24px;\n  flex-wrap: wrap;\n}\n.search-input-wrap {\n  position: relative;\n  flex: 1;\n  max-width: 480px;\n}\n.search-input {\n  width: 100%;\n  height: 40px;\n  padding: 0 38px 0 14px;\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  color: var(--geist-foreground);\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  outline: none;\n  transition: box-shadow 0.15s;\n}\n.search-input:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n.search-kbd {\n  position: absolute;\n  right: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  color: var(--geist-quaternary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n\n.view-switcher {\n  display: flex;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  background: var(--geist-background);\n  padding: 2px;\n}\n.view-btn {\n  background: transparent;\n  border: none;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-tertiary);\n  padding: 6px 12px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n  transition: color 0.15s, background 0.15s;\n}\n.view-btn.active {\n  background: var(--geist-surface-tint);\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 筛选芯片行 (Filter Pill Strip) */\n.filter-group-strip {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin-bottom: 28px;\n  padding: 16px 20px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-lg);\n}\n.filter-row {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  flex-wrap: wrap;\n}\n.filter-label-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  min-width: 68px;\n}\n.pill-badge {\n  background: var(--geist-background);\n  color: var(--geist-secondary);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 3px 12px;\n  border-radius: var(--radius-pill);\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: all 0.15s;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n}\n.pill-badge:hover {\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border-hover);\n}\n.pill-badge.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  font-weight: 600;\n  box-shadow: none;\n}\n.pill-badge.active-blue {\n  background: var(--develop-blue);\n  color: #ffffff;\n  box-shadow: none;\n}\n.pill-badge.active-red {\n  background: var(--ship-red);\n  color: #ffffff;\n  box-shadow: none;\n}\n\n/* Bento Grid Cards (Section 4 & 6 Spec) */\n.card-grid-bento {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  gap: 16px;\n}\n.vercel-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  transition: box-shadow 0.2s, transform 0.2s;\n  text-decoration: none;\n  color: inherit;\n  overflow: hidden;\n  min-width: 0;\n  word-break: break-word;\n}\n.vercel-card:hover {\n  box-shadow: var(--shadow-card-hover);\n  transform: translateY(-2px);\n}\n.card-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin-bottom: 12px;\n  gap: 8px;\n}\n.card-tag-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  letter-spacing: 0.5px;\n}\n.status-pill-badge {\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 500;\n  flex-shrink: 0;\n}\n.pub-accepted { background: #ebfdf2; color: #027a48; }\n.pub-workshop { background: #eff8ff; color: #175cd3; }\n.pub-submitted { background: #fff8e6; color: #b54708; }\n.pub-preprint { background: #f2f4f7; color: #475467; }\n.pub-other { background: #f9f5ff; color: #6941c6; }\n\n[data-theme=\"dark\"] .pub-accepted { background: rgba(2, 122, 72, 0.2); color: #32d583; }\n[data-theme=\"dark\"] .pub-workshop { background: rgba(23, 92, 211, 0.2); color: #84caff; }\n[data-theme=\"dark\"] .pub-submitted { background: rgba(181, 71, 8, 0.2); color: #fec84b; }\n[data-theme=\"dark\"] .pub-preprint { background: rgba(71, 84, 103, 0.2); color: #98a2b3; }\n[data-theme=\"dark\"] .pub-other { background: rgba(105, 65, 198, 0.2); color: #d6bbfb; }\n\n/* 必读标杆徽章 (Vercel Amber Accent) */\n.milestone-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  padding: 2px 7px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 600;\n  white-space: nowrap;\n  flex-shrink: 0;\n  transition: all 0.15s ease;\n}\n.milestone-badge.ms-idea, .milestone-badge:not([class*=\"ms-\"]) {\n  color: #b54708;\n  background: #fff8e6;\n  border: 1px solid rgba(247, 144, 9, 0.35);\n  box-shadow: 0 1px 2px rgba(181, 71, 8, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-idea, [data-theme=\"dark\"] .milestone-badge:not([class*=\"ms-\"]) {\n  color: #fec84b;\n  background: rgba(181, 71, 8, 0.22);\n  border-color: rgba(254, 200, 75, 0.35);\n}\n.milestone-badge.ms-writing {\n  color: #6941c6;\n  background: #f9f5ff;\n  border: 1px solid rgba(105, 65, 198, 0.3);\n  box-shadow: 0 1px 2px rgba(105, 65, 198, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-writing {\n  color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.22);\n  border-color: rgba(214, 187, 251, 0.35);\n}\n.milestone-badge.ms-value {\n  color: #027a48;\n  background: #ebfdf2;\n  border: 1px solid rgba(2, 122, 72, 0.3);\n  box-shadow: 0 1px 2px rgba(2, 122, 72, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-value {\n  color: #32d583;\n  background: rgba(2, 122, 72, 0.22);\n  border-color: rgba(50, 213, 131, 0.35);\n}\n\n/* 论文正文图表与插图卡片样式 (Geist Design) */\n.paper-figure, .article-body figure {\n  margin: 32px auto;\n  text-align: center;\n  max-width: 100%;\n}\n.paper-figure img, .article-body img {\n  max-width: 96%;\n  height: auto;\n  border-radius: var(--radius-md);\n  border: 1px solid var(--geist-border);\n  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);\n  background: #ffffff;\n  transition: transform 0.2s ease, box-shadow 0.2s ease;\n  display: block;\n  margin: 0 auto;\n}\n.paper-figure img:hover, .article-body img:hover {\n  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\n}\n.paper-figure figcaption, .article-body figcaption {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  margin-top: 10px;\n  line-height: 1.6;\n  font-style: italic;\n  max-width: 850px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n/* VAD 视图切换器 View Switcher */\n.vad-view-switcher {\n  display: inline-flex;\n  padding: 3px;\n  background: var(--geist-secondary-bg);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  margin-bottom: 20px;\n  gap: 2px;\n}\n.view-switch-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 6px 14px;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  border-radius: 6px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.view-switch-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0, 0, 0, 0.04);\n}\n[data-theme=\"dark\"] .view-switch-btn:hover {\n  background: rgba(255, 255, 255, 0.06);\n}\n.view-switch-btn.active {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  font-weight: 600;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n/* 关系图谱 Graph View Styles */\n.graph-container {\n  position: relative;\n  width: 100%;\n  height: 720px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);\n  margin-bottom: 40px;\n}\n.graph-toolbar {\n  position: absolute;\n  top: 14px;\n  left: 14px;\n  right: 14px;\n  z-index: 10;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  padding: 8px 14px;\n  border-radius: 8px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  flex-wrap: wrap;\n  gap: 8px;\n}\n.graph-tool-title {\n  font-size: 13px;\n  font-weight: 700;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  color: var(--geist-foreground);\n}\n.graph-filter-group {\n  display: flex;\n  gap: 6px;\n  align-items: center;\n  flex-wrap: wrap;\n}\n.graph-chip {\n  font-size: 11px;\n  padding: 3px 8px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.graph-chip:hover { background: var(--geist-secondary-bg); }\n.graph-chip.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-color: var(--geist-foreground);\n}\n.graph-search-input {\n  padding: 3px 8px;\n  font-size: 11px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  outline: none;\n  width: 150px;\n}\n#vad-graph-svg {\n  width: 100%;\n  height: 100%;\n  cursor: grab;\n}\n#vad-graph-svg:active { cursor: grabbing; }\n.graph-legend {\n  position: absolute;\n  bottom: 14px;\n  left: 14px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  padding: 10px 14px;\n  font-size: 11px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  z-index: 10;\n  line-height: 1.6;\n  pointer-events: none;\n}\n.graph-legend-row { display: flex; align-items: center; gap: 8px; }\n.graph-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }\n.graph-info-drawer {\n  position: absolute;\n  top: 66px;\n  right: 14px;\n  width: 310px;\n  max-height: 620px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  box-shadow: 0 8px 30px rgba(0,0,0,0.12);\n  z-index: 10;\n  padding: 16px;\n  overflow-y: auto;\n  display: none;\n  backdrop-filter: blur(10px);\n  transition: transform 0.2s ease, opacity 0.2s ease;\n}\n.graph-drawer-close {\n  position: absolute;\n  top: 10px;\n  right: 12px;\n  cursor: pointer;\n  font-size: 16px;\n  color: var(--geist-tertiary);\n}\n.graph-drawer-badge {\n  display: inline-block;\n  padding: 2px 6px;\n  border-radius: 4px;\n  font-size: 10px;\n  font-weight: 600;\n  margin-bottom: 6px;\n}\n.graph-drawer-title {\n  font-size: 13px;\n  font-weight: 700;\n  line-height: 1.4;\n  margin-bottom: 8px;\n  color: var(--geist-foreground);\n}\n.graph-drawer-meta {\n  font-size: 11px;\n  color: var(--geist-secondary);\n  margin-bottom: 12px;\n}\n.graph-drawer-core {\n  font-size: 12px;\n  line-height: 1.6;\n  color: var(--geist-foreground);\n  background: var(--geist-secondary-bg);\n  padding: 8px 10px;\n  border-radius: 6px;\n  margin-bottom: 12px;\n  border: 1px solid var(--geist-border);\n}\n.graph-drawer-link {\n  display: block;\n  text-align: center;\n  padding: 7px 12px;\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-radius: 6px;\n  font-size: 12px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: opacity 0.15s ease;\n  margin-bottom: 6px;\n}\n.graph-drawer-link:hover { opacity: 0.85; }\n.graph-drawer-pdf-link {\n  display: block;\n  text-align: center;\n  padding: 6px 12px;\n  background: var(--geist-secondary-bg);\n  color: var(--geist-foreground);\n  border: 1px solid var(--geist-border);\n  border-radius: 6px;\n  font-size: 11px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.graph-drawer-pdf-link:hover { background: var(--geist-border); }\n.node-circle {\n  cursor: pointer;\n  transition: r 0.2s, stroke-width 0.2s;\n}\n.node-label {\n  font-size: 10px;\n  font-weight: 600;\n  fill: var(--geist-foreground);\n  pointer-events: none;\n  text-shadow: 0 1px 2px var(--geist-background);\n}\n.link-line {\n  stroke: var(--geist-border);\n  stroke-opacity: 0.6;\n  stroke-width: 1.2;\n  transition: stroke 0.2s, stroke-width 0.2s, stroke-opacity 0.2s;\n}\n.link-label {\n  font-size: 9px;\n  fill: var(--geist-tertiary);\n  pointer-events: none;\n  text-anchor: middle;\n}\n\n/* 引用框与警示框 Alerts */\n.callout-alert {\n  margin: 20px 0;\n  padding: 14px 18px;\n  border-radius: var(--radius-md);\n  transition: all 0.15s ease;\n}\n.callout-important, .callout-idea {\n  border-left: 4px solid #b54708;\n  background: rgba(181, 71, 8, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(247, 144, 9, 0.3);\n}\n[data-theme=\"dark\"] .callout-important, [data-theme=\"dark\"] .callout-idea {\n  border-left-color: #fec84b;\n  background: rgba(181, 71, 8, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(254, 200, 75, 0.25);\n}\n.callout-writing {\n  border-left: 4px solid #6941c6;\n  background: rgba(105, 65, 198, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(105, 65, 198, 0.3);\n}\n[data-theme=\"dark\"] .callout-writing {\n  border-left-color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(214, 187, 251, 0.25);\n}\n.callout-value {\n  border-left: 4px solid #027a48;\n  background: rgba(2, 122, 72, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(2, 122, 72, 0.3);\n}\n[data-theme=\"dark\"] .callout-value {\n  border-left-color: #32d583;\n  background: rgba(2, 122, 72, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(50, 213, 131, 0.25);\n}\n\n.card-title {\n  font-size: 16.5px;\n  font-weight: 600;\n  line-height: 1.42;\n  letter-spacing: -0.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 10px;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n  hyphens: auto;\n}\n.card-title a {\n  color: var(--geist-foreground);\n  text-decoration: none;\n  display: inline;\n  transition: color 0.15s ease;\n}\n.card-title a:hover {\n  color: var(--develop-blue);\n  text-decoration: none;\n}\n.card-id-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-quaternary);\n  margin-right: 5px;\n}\n.card-meta-row {\n  display: flex;\n  gap: 6px;\n  flex-wrap: wrap;\n  margin-bottom: 12px;\n}\n.meta-token {\n  font-size: 12px;\n  color: var(--geist-tertiary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-ring);\n  padding: 2px 7px;\n  border-radius: var(--radius-sm);\n  white-space: nowrap;\n}\n.card-body-text {\n  font-size: 13.5px;\n  color: var(--geist-secondary);\n  line-height: 1.6;\n  margin-bottom: 16px;\n  flex-grow: 1;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n}\n.card-body-text strong {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n.card-footer {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 14px;\n}\n.card-link-action {\n  font-size: 13.5px;\n  font-weight: 500;\n  color: var(--link-blue);\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.card-link-action:hover {\n  opacity: 0.85;\n  transform: translateX(2px);\n}\na.meta-token {\n  transition: all 0.15s ease;\n  cursor: pointer;\n  text-decoration: none;\n}\na.meta-token:hover {\n  background: var(--geist-selection);\n  color: var(--geist-foreground);\n  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);\n}\n\n/* 紧凑列表视图 (List View) */\n.card-list-view {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n.list-row-item {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-md);\n  padding: 12px 18px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  transition: box-shadow 0.15s;\n}\n.list-row-item:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n\n/* 阅读详情页 (Report Detail) */\n.reading-container {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 260px;\n  gap: 40px;\n  align-items: start;\n}\n@media (max-width: 960px) {\n  .reading-container { grid-template-columns: 1fr; }\n  .reading-sidebar { display: none; }\n}\n\n.report-header-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 28px 32px;\n  margin-bottom: 28px;\n}\n.crumb-bar {\n  font-size: 13px;\n  color: var(--geist-tertiary);\n  margin-bottom: 10px;\n}\n.report-title {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  margin: 0 0 16px;\n  color: var(--geist-foreground);\n}\n.report-action-buttons {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 16px;\n  margin-top: 16px;\n}\n\n.article-body {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 36px 42px 80px;\n  font-size: 16px;\n  line-height: 1.75;\n  color: var(--geist-foreground);\n}\n.article-body h1, .article-body h2, .article-body h3 {\n  color: var(--geist-foreground);\n  scroll-margin-top: 80px;\n}\n.article-body h1 { font-size: 28px; font-weight: 600; letter-spacing: -1.28px; border-bottom: 1px solid var(--geist-border); padding-bottom: 8px; margin-top: 32px; }\n.article-body h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.96px; border-bottom: 1px solid var(--geist-border); padding-bottom: 6px; margin-top: 36px; }\n.article-body h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.32px; margin-top: 26px; }\n.article-body table {\n  width: 100%;\n  border-collapse: collapse;\n  margin: 24px 0;\n  font-size: 14px;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  overflow: hidden;\n}\n.article-body th, .article-body td {\n  padding: 10px 14px;\n  text-align: left;\n  border-bottom: 1px solid var(--geist-border);\n}\n.article-body th {\n  background: var(--geist-surface-tint);\n  font-weight: 600;\n  color: var(--geist-foreground);\n}\n.article-body blockquote {\n  border-left: 2px solid var(--geist-foreground);\n  margin: 20px 0;\n  padding: 8px 18px;\n  color: var(--geist-secondary);\n  font-style: normal;\n}\n.article-body code {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13.5px;\n  box-shadow: var(--shadow-ring);\n  background: var(--geist-surface-tint);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n.article-body pre {\n  position: relative;\n  background: #000000;\n  color: #ededed;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 18px;\n  margin: 24px 0;\n  overflow-x: auto;\n}\n.article-body pre code {\n  background: transparent;\n  box-shadow: none;\n  padding: 0;\n  color: inherit;\n  font-size: 13px;\n}\n.copy-code-btn {\n  position: absolute;\n  top: 8px;\n  right: 10px;\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  background: #171717;\n  color: #ffffff;\n  border: 1px solid #333333;\n  padding: 3px 8px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n}\n\n/* 侧边大纲 (TOC) */\n.reading-sidebar {\n  position: sticky;\n  top: 80px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  max-height: calc(100vh - 100px);\n  overflow-y: auto;\n}\n.sidebar-toc-title {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--geist-quaternary);\n  margin-bottom: 12px;\n}\n.reading-sidebar ul {\n  list-style: none;\n  padding-left: 0;\n  margin: 0;\n  font-size: 13px;\n}\n.reading-sidebar li {\n  margin: 6px 0;\n}\n.reading-sidebar ul ul {\n  padding-left: 14px;\n}\n.reading-sidebar a {\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.reading-sidebar a:hover, .reading-sidebar a.active {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 后台管理 (/admin) */\n.admin-card-container {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 32px;\n  margin-bottom: 32px;\n}\n.form-row-2 {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 16px;\n  margin-bottom: 16px;\n}\n@media (max-width: 600px) {\n  .form-row-2 { grid-template-columns: 1fr; }\n}\n.form-field {\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  margin-bottom: 16px;\n}\n.form-field label {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-foreground);\n}\n.form-field input, .form-field select, .form-field textarea {\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  padding: 9px 12px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  color: var(--geist-foreground);\n  outline: none;\n}\n.form-field input:focus, .form-field select:focus, .form-field textarea:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n\n/* 语法高亮 (Console Blue / Purple / Pink) */\n.codehilite .k, .codehilite .kd, .codehilite .kn { color: #eb367f; font-weight: 500; }\n.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #0070f3; }\n.codehilite .nf, .codehilite .na { color: #7928ca; font-weight: 500; }\n.codehilite .c, .codehilite .c1 { color: #666666; font-style: italic; }\n.codehilite .mi, .codehilite .mf { color: #ff5b4f; }\n\n</style>\n\n</head>\n<body>\n\n    <nav class=\"vercel-nav\">\n      <div class=\"nav-brand\">\n        <a href=\"/\" style=\"display:flex;align-items:center;gap:10px;text-decoration:none\">\n          <svg class=\"vercel-triangle\" viewBox=\"0 0 76 65\" fill=\"none\">\n            <path d=\"M37.5274 0L75.0548 65H0L37.5274 0Z\" fill=\"currentColor\"/>\n          </svg>\n          <span class=\"nav-title\">Agent Harness KB</span>\n        </a>\n        <span class=\"nav-badge-pill\">Geist 2.0</span>\n      </div>\n\n      <div class=\"nav-links\">\n        <a class=\"nav-link \" href=\"/\">全景总览</a>\n        <a class=\"nav-link \" href=\"/vad\" style=\"color:var(--ship-red)\">🎯 VAD 专栏 (144)</a>\n        <a class=\"nav-link\" href=\"https://m0rtzz.github.io/paper-notes/\" target=\"_blank\" rel=\"noopener\">顶会 669 篇 ↗</a>\n        <a class=\"nav-link\" href=\"/download/all\">整库打包</a>\n        \n      </div>\n\n      <div class=\"nav-actions\">\n        \n        <button class=\"theme-toggle-btn\" id=\"theme-toggle-btn\" onclick=\"toggleTheme()\" title=\"切换亮暗主题\">🌙</button>\n      </div>\n    </nav>\n    \n<main class=\"vercel-container\">\n\n        <div class=\"report-header-card\">\n          <div class=\"crumb-bar\"><a href=\"/\">Home</a> / <b>fulltext.txt</b></div>\n          <h1 class=\"report-title\">fulltext.txt</h1>\n          <div class=\"report-action-buttons\">\n            <a class=\"btn-primary-dark\" href=\"?dl=1\">Download Text</a>\n          </div>\n        </div>\n        <article class=\"article-body\"><pre><code>arXiv:2605.30140v1 [cs.CV] 28 May 2026\n\nAnomalyAgent: Training-Free Agentic Models for\nZero-/Few-Shot Anomaly Detection\n\nYi Zhang*, Jiawen Zhu*, Lele Fu, Guansong Pang\nSingapore Management University, Singapore\nSun Yat-sen University, China\ndylan.zhang9420@gmail.com\n\nAbstract\nBenefiting from generalizability of vision-language models (VLMs) such as CLIP,\nmany zero-/few-shot anomaly detection (AD) approaches have achieved impressive\ndetection performance across various datasets. Nevertheless, they require substantial training on large auxiliary datasets to adapt VLMs to anomaly detection, and\ntheir inference largely relies on visual–text embedding similarity-based anomaly\nscores, lacking reasoning abilities to detect complex anomalies that require in-depth\ncontextual understanding. To address this limitation, we propose AnomalyAgent,\na novel training-free, agentic framework that leverages the advanced reasoning\nand generalization capabilities of multimodal large language models (MLLMs)\nfor anomaly detection. The key ingredients include 1) a comprehensive anomalycentric toolset that enables adaptive MLLM-driven, agentic anomaly reasoning in\nzero-shot settings, and 2) a customized memory module that grounds anomaly reasoning with few-shot, in-context reference examples. We extend evaluation beyond\nthe detection of simple anomalies (e.g., surface defects like cracks and dents and\nclear legions) in widely used benchmarks to more diverse types of anomalies such\nas logical/contextual anomalies in logistics and manufacturing settings. Extensive\nexperiment results demonstrate that our AnomalyAgent achieves substantially better performance compared to training-free VLM-based AD and generic agentic\nmethods, highlighting its superior generalization capability in both zero-shot and\nfew-shot anomaly detection settings. The code implementation can be find at this\naddress.\n\n1\n\nIntroduction\n\nAnomaly detection (AD) is one key task in computer vision, aiming to identify instances that deviate\nsignificantly from the underlying data distribution. It is critical for a wide range of real-world\napplications, including industrial inspection, medical diagnosis, security monitoring, and autonomous\nsystems [3, 27, 2, 13]. A key challenge in AD lies in its inherent open-ended nature, ie, anomalies\nare rare, diverse and often unpredictable, making it impractical to exhaustively model all possible\nabnormalites during training. To tackle this challenge, conventional approaches [23, 4, 30] focus on\nlearning normal patterns from large normal training data instead. Recent advances have shifted from\nthis unsupervised learning paradigm toward data-efficient settings, particularly zero-shot [31, 9, 5]\nand few-shot AD [24, 36, 14], depending on the availability of normal reference samples.\nBenefiting from the strong zero/few-shot recognition capabilities of pre-trained vision-language\nmodels (VLMs), a line of work has emerged to adapt their unified visual-text representations for AD via parameter-efficient tuning, achieving impressive performance across multiple benchmarks [38, 39, 20]. Early studies such as WinCLIP [14] establish a trainingfree paradigm by exploiting handcrafted text prompts and multi-scale visual features from\nCLIP [37] for anomaly scoring, providing strong baselines for zero- and few-shot AD.\nPreprint.\n\n\fFollowing this direction, zero-shot\nAD methods typically enhance visual–text alignment via prompt learning to capture anomaly-relevant semantics [39, 38, 5, 20], while fewshot AD methods leverage normal\nreference samples to characterize expected normal patterns and detect\nanomalies through reference-based\ncomparison with query samples [40,\n7, 24].\n\nVLM-based AD\n\nPrevious MLLM-based AD\n\nAD Tuning\n\nAD Tuning\n\nVLMs\n\nMLLMs\n\nV-L Similarity\nMatching\n\nPost-hoc\nReasoning\n\nAnomalyAgent\n\nMemory\n\nAD-centric Reasoning\nPlan\n\nTool\n\nReflection\n\nReason\n\nMLLM-based AD Agent\n\nFigure 1: Comparison of conventional VLM-based AD, previous\n\nMLLM-based AD, and our AnomalyAgent. Existing VLM-based\nmethods mainly rely on similarity-based anomaly scoring, while\nprevious MLLM-based methods use MLLMs as post-hoc reasoning\nHowever, existing VLM-based meth- modules after task-specific adaptation. In contrast, AnomalyAgent\ncustomizes the agentic abilities of MLLMs for AD and directly\nods still require substantial training on integrate them into the AD process in a fully training-free manner.\n\nauxiliary datasets to adapt the VLMs\nto AD. Furthermore, their inference largely rely on visual–text representation similarity-based\nanomaly scoring, which provides only shallow alignment between text prompts and visual features,\nwith anomalies identified via thresholding of the resulting scores [31, 26]. While effective for\nrelatively simple and well-defined anomaly patterns, such as surface defects or localized lesions,\nthis paradigm lacks explicit reasoning, making it insufficient for handling anomalies that require\ncontextual, relational, or task-specific understanding. For example, detection of logical anomalies\nmay depend on object arrangement or operational rules [2, 36], while real-world industrial and\nlogistics scenarios often exhibit open-ended variations in object appearance, pose and environmental\nconditions [13].\nThese challenges go beyond shallow representation matching and require more structured reasoning\nabout such contextual and logical abnormalities. Recent advances in multimodal large language\nmodels (MLLMs) offer a promising foundation for such reasoning and beyond [1, 19, 16]. However,\ntheir application to the AD task remains largely underexplored. Existing MLLM-based AD methods\ntypically use reasoning either for anomaly interpretation [15, 32, 6, 12], or as auxiliary prior extraction\nfor downstream anomaly analysis [36]. In both cases, MLLM reasoning is not directly integrated into\nthe detection decision itself, restricting its utility for zero-shot and few-shot AD. As a consequence,\ntheir effectiveness in zero-shot and few-shot anomaly detection settings remains limited, often\nunderperforming strong VLM-based training-free baselines or requiring dataset-specific tuning to\nachieve competitive performance.\nTo address these challenges, we propose AnomalyAgent, a fully training-free agentic framework\nthat directly leverages the superior agentic abilities of MLLMs—planning, tool use, reasoning, and\nreflecting—specifically for anomaly detection. As illustrated in Fig. 1, unlike existing VLM-based\nmethods that rely on shallow similarity matching with auxiliary-domain tuning, or previous MLLMbased approaches that require task-specific adaptation for post-hoc reasoning, AnomalyAgent directly\nintegrates anomaly-centric agentic abilities into the detection process itself in a fully training-free\nmanner. To this end, an anomaly-centric toolset is introduced in AnomalyAgent to progressively\ngather and verify visual evidence through hypothesis-driven exploration, counterfactual verification,\nand reflective reasoning tailored for AD. This allows it to handle complex abnormality patterns\nbeyond simple appearance deviations. In scenarios where in-context examples are available, e.g.,\nfew-shot AD settings, a self calibration-based memory mechanism is further introduced to convert\nthe few-shot examples into actionable in-context memories to enable self calibration of the reasoning\nagainst dataset-specific normal patterns in AnomalyAgent.\nOverall, our contributions are summarized as follows:\n• We introduce AnomalyAgent, a novel training-free agentic framework tailored for AD. It\nshifts anomaly detection from visual-text representation similarity-based anomaly scoring to\ntool-and-memory-augmented anomaly reasoning,enabling score-thresholding-free anomaly\ndecision and in-depth reasoning over complex abnormality patterns.\n• We further propose an anomaly-centric reasoning toolset and a self calibration-based\nmemory mechanism to build an agentic AD-oriented planning–reasoning–reflecting\npipeline. With this pipeline, AnomalyAgent can actively gather, verify, and refine evidence against expected normal patterns throughout its reasoning, and bring in external\nmemories to perform self calibration when such information is available.\n2\n\n\f• We establish a comprehensive evaluation benchmark covering a wide range of anomaly\ntypes across multiple AD scenarios, including industrial inspection, medical imaging, and\nlogistics. Extensive comparisons with VLM-based methods and MLLM agents demonstrate\nthe strong generalization ability of AnomalyAgent in both zero-shot and few-shot settings.\n\n2\n\nRelated Work\n\nVLM-based Zero-/Few-Shot Anomaly Detection. To improve generalization to unseen domains,\nzero- and few-shot anomaly detection (ZSAD/FSAD) methods have emerged to identify anomalies\nwithout dataset-specific training. Recent advances are largely driven by vision-language models\n(VLMs), which enable AD through visual–text similarity matching in a unified embedding space.\nEarly methods such as WinCLIP [14] establish a training-free paradigm by exploiting CLIP [25]\nfeatures with handcrafted prompts under both ZSAD and FSAD settings. For ZSAD, subsequent\napproaches mainly improve anomaly-sensitive representation learning through prompt-based adaptation [7, 39, 38, 5, 11]. For example, APRIL-GAN [7] introduces additional learnable layers trained\nwith auxiliary anomaly data, while methods such as AnomalyCLIP [38], FAPrompt [39], and AdaCLIP [5] employ learnable prompts to better align visual features with anomaly-relevant semantics.\nFor FSAD, existing methods leverage normal reference samples through reference-based comparison [18, 40, 35]. PromptAD [18] learns class-specific normal patterns via one-class prompt learning,\nwhile InCTRL [40] and ResAD [35] model residual discrepancies between query samples and normal\nreferences for anomaly detection. However, these methods still rely on similarity-based decision\nmechanisms, limiting their effectiveness in scenarios requiring contextual or relational understanding.\nMLLM-based Anomaly Detection and Reasoning. Motivated by the strong reasoning capability\nof MLLMs, recent studies explore anomaly detection from a reasoning perspective. Approaches\nsuch as MMAD [15], AnomalyGPT [12], Anomaly-OV [32], and AnomalyR1 [6] mainly treat\nMLLMs as post-hoc reasoning modules for anomaly analysis through natural language descriptions\nor multi-step inference. Other methods, such as LogSAD [36], leverage MLLMs to model structural\nor logical constraints as prior knowledge for AD. However, existing methods still lack anomaly-aware\nreasoning guidance that explicitly integrates reasoning into the anomaly detection process itself,\noften requiring dataset-specific tuning and underperforming strong training-free VLM baselines.\nRecent agentic frameworks have demonstrated strong capabilities in planning, tool use, and multi-step\nreasoning across multimodal tasks [34, 28, 8]. However, directly applying generic agents to AD\nremains challenging due to the lack of anomaly-specific reasoning guidance and calibrated normality\npriors. In contrast, AnomalyAgent is a fully training-free agentic AD framework that explicitly\nintegrates MLLM reasoning into anomaly detection through an anomaly-centric reasoning toolset\nand a self-calibration-based memory mechanism.\n\n3\n\nMethodology\n\nProblem Statement. Existing ZSAD/FSAD methods [39, 38, 40] typically require auxiliary datasets\nto adapt VLMs to AD. Specifically, given auxiliary data Daux = {Xtrain , Ytrain }, where Xtrain =\nN\n{xi }N\ni=1 denotes the training images, Ytrain = {yi }i=1 denotes the corresponding binary labels, and\neach sample xi satisfies yi ∈ {0, 1} with 0 and 1 represent normal an anomalous samples respectively,\na pretrained VLM-based anomaly scoring function fVLM (xi , Prompt) is fine-tuned using Daux and\nthen directly applied to yield an anomaly score for samples from unseen test data Dtest . In contrast,\nour work operates in a fully training-free manner, requiring neither auxiliary data training nor\nparameter adaptation. In particular, our goal is to develop a generalizable MLLM-driven anomaly\nreasoning agent f MLLM (xi , Prompt, Tool, Memory) that can effectively generalize across different\n1\n2\nm\nunseen test datasets T = {Dtest\n, Dtest\n, · · · , Dtest\n} under both zero-shot and few-shot settings, where\ni\ni\ni\neach test dataset Dtest = {Xtest , Ytest } is drawn from a distinct application domain and f MLLM does not\nrequire any training. In the zero-shot setting, no target-domain reference samples are available during\ninference. In contrast, FSAD additionally provides a small set of normal reference samples from the\ntarget domain, denoted as P = {p1 , p2 , ..., pk }, where k is typically a small number (e.g., k ≪ N ).\nThe resulting model is expected to directly produce a hard-label prediction, ie, “anomalous” or\n“normal”, providing a global prediction of whether the query image contains any abnormal content.\nOverview of AnomalyAgent. As illustrated in Fig. 2, AnomalyAgent inputs the image and the class\nname into the template tools, deriving the general template analysis and class-specific counterfactual\n3\n\n\ftemplate analysis. Given the general template analysis and the raw image, the Planner selects and\ninvokes an appropriate visual tool to enhance anomaly-relevant evidence. Then, the augmented image,\nraw image, and template analysis are fed into the Reasoner for judgment. If the termination condition\nis not met, the aforementioned information, as well as the Reasoner’s thought, will be input into the\nReflector for a new loop of investigation. Below, we present these modules in detail.\n3.1\n\nAnomaly-Centric Toolset for AD-Oriented Agentic Planning–Reasoning–Reflecting\n\nTo enable anomaly detection\nin a fully training-free setting,\nwe present a zero-shot agentic framework that can adapt to\ndiverse inspection requirements\n…\nwithout accessing training samples or performing parameter updates. Unlike generic MLLM\nagents that mainly rely on open…\nended visual question answering, AnomalyAgent is specifi…\ncally designed for anomaly detection from two complementary\nFigure 2: Overview of AnomalyAgent.\naspects: an anomaly-centric\ntoolset that provides task-relevant visual and semantic evidence, and an AD-oriented agentic\npipeline that progressively plans, reasons, and reflects over such evidence before making a hard-label\nprediction.\nZero-Shot Anomaly Detection\n\nTest Image\n\nClass Name\n\nGeneral Template\nEvidence\n\nLangGraph Agentic Reasoning Loop\n\nFinal Anomaly\nDecision\n\nPlanner\n\nTemplate Tools\n\nCounterfactual\nAtomic Candidates\n\nNormal\n\nVisual Tools\n\nFew-Shot Anomaly Detection\n\nNormal Shots\n\nDenoise Deblur\n\nCandidate\nCalibration\n\nZoom\nSuperResolution\n\nReflector\n\nClass Name\n\nBrightness\n\nAnomalous\n\nScore+Explanation\n\nReasoner\n\nFew-shot Image\nMemory\n\nAnomaly-Centric Toolset. The tools in AnomalyAgent are organized into two categories. The first\ncategory consists of general visual tools, which enhance the query image or focus on local regions\nto provide clearer visual evidence for anomaly inspection. The second category consists of template\ntools, which exploit both textual priors and image-level descriptions to construct structured anomalyrelated cues. This design enables the agent to improve the visibility of suspicious observations while\ngrounding its reasoning in explicit AD-specific priors.\nGeneral Visual Tools. We include five general visual tools: image denoising, image deblurring,\nsuper-resolution, zooming, and brightness adjustment. These tools are invoked when the Planner or\nthe Reflector identifies insufficient or ambiguous visual evidence, such as low image quality, small\nsuspicious regions, blur, or poor illumination. The implementations are provided in the Appendix A.1.\nTemplate Tools. include a general template tool and a counterfactual atomic template tool. The\ngeneral template tool is inspired by the template ensembles in WinCLIP [14], i.e., normal ensembles\n(EN ) and anomaly ensembles (EA ). However, instead of restricting anomaly evidence to the matching\nbetween CLIP visual features and predefined textual templates, we leverage the fine-grained visual\ndescription capability of MLLMs. Specifically, an MLLM-based image captioning model is employed\nto generate detailed descriptions of the query image x from complementary visual perspectives:\nCaptions = {d1 , d2 , d3 } = MLLM(x; PromptIC ),\n\n(1)\n\nwhere each caption di focuses on a different visual aspect of the object and the PromptIC can be\nfound in the Appendix B.\nThese captions are then compared with class-conditioned normal and anomaly templates, yielding\na preliminary semantic evidence report that indicates whether the observed appearance is more\nconsistent with normality or abnormality:\nReportGR = MLLM(Emb(Captions) × EA , Emb(Captions) × EN ),\n\n(2)\n\nwhere Emb(·) stands for an text embedding model.\nThe counterfactual atomic template tool works in a similar way while being more adaptive and\nflexible. An LLM is utilized to generate class-conditioned anomalous and normal candidate sets:\nC\nC\nEA\n; EN\n= LLM(c; PromptCG ).\n\n(3)\n\nThe anomaly candidates describe concrete abnormal patterns such as surface damage, deformation,\nmissing parts, contamination, or structural defects, while the normal candidates describe intact and\n4\n\n\fregular appearances. For each caption dj , we compute its similarity to the normal and anomalous\nsemantic prototypes, yielding a soft anomaly score:\nsj = σ (sim(Emb(dj ), pA ) − sim(Emb(dj ), pN )) ,\nwhere pA and pN are the averaged embeddings of anomaly and normal textual prototypes. This\nproduces an interpretable preliminary evidence report, including caption-level anomaly scores,\nsimilarity margins, and agreement patterns across perspectives. In addition, we further construct a\ncounterfactual evidence report through atomic candidate matching. Specifically, each image caption\nis compared against the generated anomaly and normal candidate sets:\n\u0001\nC\nC\nTopKA (dj ), TopKN (dj ) = RetrieveTopK Emb(dj ), Emb(EA\n), Emb(EN\n) ,\n(4)\nwhere K is a hyperparameter. The retrieved candidates provide fine-grained evidence explaining\nwhether the visual description is closer to abnormal or normal semantic patterns. We compute the\ncandidate-level margin:\nmj = max sim(dj , ai ) − max sim(dj , ni ),\n(5)\nC\nai ∈EA\n\nC\nni ∈EN\n\nand summarize the top-matched anomaly and normal candidates as counterfactual evidence:\nReportCR = LLM(s1 , s2 , s3 , TopKA (dj ), TopKN (dj ), m1 , m2 , m3 ).\n(6)\nThis report is not directly used as a hard decision rule; instead, it provides structured semantic cues\nfor the agent to reason over.\nAD-Oriented Agentic Pipeline. After obtaining ReportGR and ReportCR , AnomalyAgent performs\nanomaly judgment through a planning–reasoning–reflecting pipeline. The Planner first receives the\nraw image, class name, and semantic evidence reports, and converts them into an inspection plan:\nPlan = MLLMP (x, c, ReportGR , ReportCR ; PromptP )\n(7)\n→ {Potential Anomalies, Heuristic Prompt, Tools to Use}.\nHere, the potential anomalies summarize suspicious visual regions or abnormal patterns suggested\nby the template reports, while the heuristic prompt provides class-specific inspection guidance for\nsubsequent reasoning. When the visual evidence is insufficient, the Planner invokes the corresponding\ngeneral visual tools to obtain enhanced observations x̃.\nThe Reasoner then integrates the raw image, enhanced observations, inspection plan, and semantic\nevidence reports to produce a structured anomaly judgment:\nResult = MLLMR x, x̃, c, Plan,\n\u0001\n(8)\nReportGR , ReportCR ; PromptR → {ŷ, Reason}.\nThe prediction ŷ is selected from {normal, anomalous, uncertain}, where Reason explains the supporting visual observations and their consistency with the semantic priors. If a confident normal or\nanomalous decision is obtained, the pipeline directly returns the result.\nWhen the Reasoner outputs uncertain, the Reflector revisits the previous plan and judgment, identifies\nmissing or ambiguous evidence, and refines the inspection instruction:\nReflect = MLLMRef (x, x̃, c, Plan, Result, ReportGR , ReportCR ; PromptRef )\n→ {Missing Evidence, Ambiguous Evidence, Refined Heuristic Prompt, Tools to Use}.\n(9)\nThe reflected instruction is then sent back to the Planner or Reasoner for targeted re-inspection. In\nthis way, AnomalyAgent avoids premature decisions from incomplete evidence while keeping the\nfinal prediction as a hard-label anomaly decision.\n3.2\n\nMemory-Augmented Self Calibration with Normal Reference Examples\n\nTo further reduce false alarms caused by class-specific normal variations, we introduce a memoryaugmented self-calibration mechanism that uses a small set of normal reference examples without\nupdating any model parameters. For each class c, let\nN K\nMN\n(10)\nc = {xi }i=1\ndenote the available normal reference images. We first run the same AnomalyAgent pipeline on each\nxN\ni and record its intermediate evidence:\nRi = {Captionsi , ReportiGR , ReportiCR , ŷi , Reasoni }.\n(11)\nN\nSince all xi are known to be normal, these records provide self-calibration signals for identifying\nnormal visual patterns that may be mistakenly treated as anomalies.\n5\n\n\fC\nC\nCounterfactual candidate calibration. For each atomic candidate e ∈ EA\n∪ EN\n, we assign a\nreliability weight we , initialized to 0.5. Given the captions of a normal reference image, an LLM\njudges the relation between the reference description and each candidate as {fit, conflict, unrelated}.\nWe compute the caption-candidate matching strength\n\u0001\nρi (e) = max sim Emb(dij ), Emb(e) .\n(12)\nj\n\nThe weight is then updated according to the normal-reference constraint:\nwe ← clip(we + ∆i (e), 0, 1),\n\n(13)\n\nwhere normal candidates are strengthened when they fit normal references, while anomaly candidates\nare weakened when they fit normal references. In practice, if the original counterfactual evidence\nincorrectly favors anomaly on a normal reference image, a larger update coefficient is used. The\ncalibrated weights are then injected into atomic candidate matching:\nsim(Emb(dj ), Emb(e))\n+ (we − 0.5),\n(14)\nτcand\nwhere we = 0.5 recovers the original unweighted matching. The calibrated counterfactual margin is\ncomputed as\nmcal\n(15)\nj = τcand max ℓ(dj , a) − τcand max ℓ(dj , n),\nℓ(dj , e) =\n\nC\na∈EA\n\nC\nn∈EN\n\nwhich produces a refined ReportCR for subsequent agent reasoning.\nNormal-reference memory. In addition to candidate calibration, we build a normal-reference\nmemory bank. Each reference image is stored with its CLIP image embedding, captions, template\nmargins, final judgment, and reasoning trace:\nK\nBc = {(ϕ(xN\ni ), Ri )}i=1 ,\n\n(16)\n\nwhere ϕ(·) denotes the image-level embedding. For normal references that are incorrectly judged as\nanomalous, the agent further reflects on the failure case and extracts class-level hard-normal cues, i.e.,\nsuspicious-looking but normal visual patterns. These cues are summarized into a class calibration\nnote Hc and enabled only when a validation pass on normal references improves correctness without\ndegrading previously correct cases.\nDuring inference, the query image x retrieves visually similar normal memories:\nN\nNγ (x) = {(xN\ni , Ri ) | cos(ϕ(x), ϕ(xi )) &gt; γ},\n\n(17)\n\nwhere γ is a similarity threshold. The retrieved entries are summarized into a memory report\nReportMEM , including similarity statistics, average template margins, and the reliability of previous\njudgments on retrieved normal references.\nFinally, the Reasoner receives both semantic reports and memory-based calibration cues:\nResult = MLLMR x, x̃, c, Plan, ReportGR , Reportcal\nCR ,\n\u0001\nReportMEM , Hc ; PromptR → {ŷ, Reason}.\n\n(18)\n\nThe memory report is used only as historical normal-shot calibration rather than a hard decision\nrule. Thus, the final prediction remains a hard-label anomaly judgment, while the agent is calibrated\nagainst class-specific normal variations and hard-negative normal appearances.\n\n4\n\nExperiments\n\nDatasets. To verify the effectiveness of AnomalyAgent, we conduct extensive experiments across\nfive real-world datasets from diverse application domains, including industrial defect dataset\n(MVTec [3]), medical image datasets (HeadCT [27] and LAG [17]), logistics defect dataset (Kaputt [13]), and logical anomaly dataset (MVTec LOCO [2]). These are test datasets, which are used\ndirectly to evaluate the detection performance in the zero-shot setting. In the few-shot setting, the\nfew-shot normal prompts for the target data are randomly sampled from the training set of target\ndatasets and remain the same for all detection models for fair comparison. We evaluate the performance with varying number of few-shot normal sample set: K = 1, 2, 4 (See Appendix for details\nabout the dataset settings).\n6\n\n\fTable 1: AUROC and F1-max results across five datasets under ZSAD settings. Best results among\ntraining-free methods are highlighted in red, while second-best results are underlined. Trainable\nmethods are shaded in gray for reference only since they require additional training.\nTraining-Free Methods\nDataset\n\nWinCLIP\n\nMRAD-TF\n\nReACT\n\nTrainable Methods\n\nAnomalyAgent\n\nCLIP\n\nAprilGAN\n\nAnomalyCLIP\n\nFAPrompt\n\nAUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max\nMVTec\nMVTec LOCO\nLAG\nHeadCT\nKaputt\n\n90.4\n59.1\n59.6\n86.7\n55.6\n\n92.7\n53.8\n65.4\n81.5\n36.6\n\n81.2\n58.2\n60.1\n74.7\n47.6\n\n89.3\n77.3\n81.3\n72.4\n48.3\n\n74.3\n60.0\n57.7\n91.0\n53.6\n\n86.3\n77.3\n81.3\n91.2\n45.0\n\n84.5\n62.8\n65.3\n91.0\n61.3\n\n90.7\n77.3\n81.3\n91.5\n48.9\n\n74.0\n53.6\n62.6\n61.2\n55.0\n\n74.7\n44.9\n66.7\n66.7\n41.3\n\n86.1\n58.6\n80.7\n89.7\n61.4\n\n83.5\n39.8\n77.9\n82.4\n42.4\n\n91.6\n61.9\n76.4\n93.4\n55.4\n\n89.6\n57.4\n77.9\n89.5\n48.8\n\n91.8\n59.5\n74.9\n94.4\n63.9\n\n89.7\n51.3\n80.2\n90.4\n50.6\n\nAverage\n\n70.3\n\n66.0\n\n64.4\n\n73.7\n\n67.3\n\n76.2\n\n73.0\n\n77.9\n\n61.3\n\n58.9\n\n75.3\n\n65.2\n\n75.7\n\n72.6\n\n76.9\n\n72.4\n\nBaseline Methods and Evaluation Metrics. We compare AnomalyAgent with several state-ofthe-art (SotA) anomaly detection methods under both zero-shot and few-shot settings. For ZSAD,\nthe competing methods include training-free baselines, ie, CLIP [25], WinCLIP [14], MRAD [31],\nand ReAct Agent [34]. We also include trainable ZSAD approaches, including APRIL-GAN [7],\nAnomalyCLIP [38], and FAPrompt [39], but they are not included for direct performance comparison;\ntheir results are only used to check the performance gap between training-free and trainable AD\nmethods. For FSAD, the training-free baselines include WinCLIP+ [14], PatchCore [26], and an\nagentic method Mem0 [8], while the trainable baselines include APRIL-GAN [7] and InCTRL [40].\nNote that ReAct is not included in the FSAD experiments as it cannot directly use the few-shot\nreferences; similarly, Mem0 that requires few-shot references is not used in the ZSAD experiments.\nFollowing previous AD approaches [5, 36, 10], we report the Area Under the Receiver Operating\nCharacteristic (AUROC) and the highest possible F1 score (F1-max) as our evaluation metrics.\nImplementation Details. We use GPT-5.1 [22] with the Response API as the default MLLM for\nall agentic methods (AnomalyAgent, ReACT, and Mem0) for image description, planning, reasoning,\nand reflection in the main experiments. To reduce inference cost, GPT-4.1-mini [21] is used for\nauxiliary reasoning and memory-related operations. For embedding-based evidence matching, we\nemploy a Qwen3-4B-based text embedding model [33] by default. For training-free methods, all\ndatasets are directly used for inference without any training or adaptation. For trainable methods, we\nfollow the official experimental protocols of the competing approaches, where models are trained on\ntheir corresponding auxiliary datasets and evaluated on the target test sets without further fine-tuning.\nImplementation details for AnomalyAgent and the competing methods are provided in Appendix.\n4.1\n\nMain Results\n\nZero-shot Anomaly Detection. Table 1 reports the ZSAD results across five datasets for both fully\ntraining-free and trainable methods. Overall, AnomalyAgent achieves the best average performance\namong all training-free methods, surpassing the strongest training-free baseline by up to 2.7%\nAUROC and 1.7% F1 -max. Compared with conventional VLM-based approaches relying on visual–\nlanguage similarity matching, AnomalyAgent shows particularly strong improvements on datasets\nrequiring contextual and relational understanding, such as MVTec LOCO and Kaputt, and even\nachieves competitive performance against several trainable methods. Although trainable approaches\nsuch as AnomalyCLIP and FAPrompt still obtain slightly better results on some datasets due to\nauxiliary-domain optimization, AnomalyAgent remains highly competitive without any training or\nparameter adaptation. These results demonstrate the effectiveness of the proposed agentic reasoning\nframework for handling contextual, structural, and task-dependent anomalies.\nAs for the generic MLLM agent ReAct, it achieves competitive performance compared with WinCLIP, demonstrating the potential of agentic reasoning for AD. However, a clear gap still exists\nbetween ReAct and AnomalyAgent, suggesting that generic MLLM agents lack AD-specific reasoning guidance and calibrated normality priors for reliable anomaly understanding. In contrast,\nAnomalyAgent explicitly organizes anomaly-centric tools within a structured reasoning workflow,\nenabling more reliable anomaly decisions across diverse AD scenarios. Moreover, the consistently\nstronger F1 -max results achieved by MLLM-based methods, particularly ReAct and AnomalyAgent,\nindicate that reasoning-based anomaly analysis produces more discriminative anomaly decisions with\nbetter normal/anomaly separation than conventional anomaly scoring-based methods.\nFew-shot Anomaly Detection. Table 2 reports the 1-, 2-, and 4-shot AD results. Among training-free\nbaselines, AnomalyAgent achieves the best performance in the majority of dataset–shot settings and\n7\n\n\fTable 2: AUROC and F1-max results across five datasets under FSAD settings. Best results among\ntraining-free methods are highlighted in red, while second-best results are underlined. Trainable\nmethods are shaded in gray for reference only since they require additional training.\nTraining-Free Methods\nShot\n\nDataset\n\nWinCLIP+\n\nPatchCore\n\nTrainable Methods\n\nMem0\n\nAnomalyAgent\n\nAprilGAN\n\nInCTRL\n\nAUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max AUROC F1-max\nMVTec\nMVTec LOCO\nLAG\n1-shot\nHeadCT\nKaputt\n\n94.1\n61.2\n55.1\n81.3\n55.9\n\n92.0\n56.0\n50.5\n82.0\n55.6\n\n83.8\n60.9\n40.8\n65.1\n51.0\n\n87.4\n54.0\n49.3\n85.6\n63.0\n\n83.0\n53.3\n60.5\n89.0\n55.6\n\n89.2\n77.3\n81.3\n89.8\n46.3\n\n85.0\n64.0\n66.1\n91.1\n61.9\n\n91.0\n78.6\n82.0\n91.2\n49.5\n\n92.2\n64.6\n77.3\n89.6\n57.4\n\n89.4\n50.0\n68.8\n83.4\n56.8\n\n93.0\n60.0\n47.0\n90.2\n58.0\n\n91.5\n57.3\n67.0\n91.6\n57.2\n\nAverage\n\n69.5\n\n67.2\n\n60.3\n\n67.9\n\n68.3\n\n76.8\n\n73.6\n\n78.5\n\n76.2\n\n69.7\n\n69.6\n\n72.9\n\nMVTec\nMVTec LOCO\nLAG\n2-shot\nHeadCT\nKaputt\n\n95.0\n63.3\n59.5\n81.2\n55.7\n\n92.5\n67.2\n58.5\n77.6\n55.9\n\n86.8\n61.7\n59.6\n70.0\n50.1\n\n88.4\n53.9\n68.1\n77.0\n52.1\n\n80.6\n52.6\n59.3\n89.5\n57.4\n\n89.0\n77.3\n81.3\n90.2\n48.3\n\n85.6\n66.3\n67.0\n91.5\n63.0\n\n91.2\n79.4\n82.3\n91.6\n51.5\n\n82.8\n65.2\n77.1\n89.6\n57.1\n\n88.6\n59.7\n73.0\n86.0\n56.5\n\n94.3\n61.6\n58.8\n91.5\n57.7\n\n92.9\n58.2\n76.9\n92.2\n56.9\n\nAverage\n\n70.9\n\n70.3\n\n65.6\n\n67.9\n\n67.9\n\n77.2\n\n74.7\n\n79.2\n\n74.4\n\n72.8\n\n72.8\n\n75.4\n\nMVTec\nMVTec LOCO\nLAG\n4-shot\nHeadCT\nKaputt\n\n94.9\n63.9\n65.0\n84.0\n55.6\n\n93.0\n66.8\n66.9\n79.5\n58.2\n\n89.7\n64.2\n67.9\n79.1\n50.2\n\n89.5\n54.6\n73.0\n92.3\n52.1\n\n82.4\n53.6\n60.1\n90.0\n56.8\n\n89.2\n77.3\n81.3\n90.7\n47.2\n\n86.4\n67.4\n68.8\n92.0\n62.7\n\n91.8\n79.9\n83.2\n91.4\n51.8\n\n82.7\n65.4\n77.2\n90.9\n57.4\n\n88.9\n53.9\n75.8\n92.1\n57.7\n\n95.3\n62.8\n72.4\n91.8\n57.3\n\n93.8\n62.2\n80.8\n92.3\n57.1\n\nAverage\n\n72.7\n\n72.9\n\n70.2\n\n72.3\n\n68.6\n\n77.1\n\n75.5\n\n79.6\n\n74.7\n\n73.7\n\n75.9\n\n77.2\n\nconsistently obtains the highest average AUROC and F1 -max across all shot numbers, surpassing the\nstrongest training-free baseline by up to 2.8% AUROC and 2.5% F1 -max. Similar trends to the zeroshot setting can also be observed for both VLM-based and MLLM-based methods. Compared with\nconventional VLM-based FSAD methods, AnomalyAgent shows particularly strong improvements\non datasets requiring contextual and relational understanding, while generic MLLM agents still\nexhibit clear limitations due to the lack of AD-specific reasoning guidance and calibrated normality\npriors. More importantly, AnomalyAgent exhibits stable cross-shot improvement, with performance\nconsistently increasing from 1-shot to 4-shot. In contrast, Mem0, which equips the zero-shot version\nof AnomalyAgent with a generic memory module, does not reliably benefit from additional shots.\nThis suggests that the advantage of AnomalyAgent comes not merely from memory augmentation, but\nfrom an AD-specific memory mechanism that transforms few-shot normal references into effective\nin-context normality priors for reasoning calibration. Although trainable methods such as InCTRL\nstill achieve slightly stronger performance through AD-specific optimization, AnomalyAgent remains\nhighly competitive without any training or parameter adaptation, further validating the effectiveness\nof memory-calibrated agentic reasoning for FSAD.\n4.2\n\nAnalysis of AnomalyAgent\n\nAblation Study.\nIn this section, we analyze the key design choices in AnomalyAgent under both zero-shot and few-shot settings.\nUnless otherwise specified, GPT-4.1mini is adopted as the default MLLM throughout this analysis for efficiency considerations.\nTable 3 presents the ablation results on MVTec\nTable 3: Ablation study on MVTec and MVTec\nand MVTec LOCO. Under the zero-shot setLOCO under zero-shot and few-shot settings. The\nting, the ‘Base’ model, which only contains\nbest and second-best results are highlighted in bold\nthe Planner and Reasoner, achieves limited\nand underline, respectively.\nperformance, especially on the challenging\ndataset MVTec LOCO, where structural conMVTec\nMVTec LOCO\nSetting\nModel\nsistency and category-level priors are more\nAUROC F1-max AUROC F1-max\ncritical. Introducing reflective reasoning (‘w.\nBase\n65.8\n81.7\n53.2\n49.1\nRef.’) only leads to marginal improvements,\nw. Ref.\n67.2\n84.3\n52.8\n50.3\nZero-shot\nw. Ref. &amp; V-Tools\n73.4\n86.6\n51.7\n48.6\nsuggesting that reasoning loops alone are inAnomalyAgent\n81.4\n89.4\n60.8\n75.7\nsufficient without additional AD-related eviw.\nHard-Normal\n79.3\n88.1\n58.4\n72.9\ndence or external guidance. Further incorpoFew-shot w. Calibration\n82.3\n89.6\n61.3\n75.5\nrating general visual tools (i.e., ‘w. Ref. &amp; VAnomalyAgent\n83.5\n90.4\n62.0\n77.1\nTools’) significantly improves the performance\n8\n\n\fon MVTec, demonstrating the importance of enhanced visual evidence for the detection of simple\nanomalies. However, the performance on MVTec LOCO slightly drops, indicating that general visual\nprocessing alone is insufficient for the detection of complex anomalies, e.g., logical anomalies in\nMVTec LOCO. In contrast, AnomalyAgent (the zero-shot version) consistently achieves the best\nperformance across both datasets under the zero-shot setting, suggesting that the proposed anomalycentric toolset provides valuable anomaly priors for effective detection of both simple and complex\nanomalies. This also indicate that such toolset should be explicitly integrated into the reasoning\nworkflow rather than treated as optional tools.\nFor the few-shot setting, all variants are built\nupon the zero-shot version of AnomalyAgent.\nThe variant ‘w. Hard-Normal’ injects hardnormal information extracted from the few-shot\nnormal references, while ‘w. Calibration’ uses\nfew-shot samples to calibrate the cross-modal\nprior tools toward the target-data normal patterns. It is clear that using hard-normal information alone leads to only limited improvements (‘w. Hard-Normal’ vs. the zero-shot\nAnomalyAgent), suggesting that simply providing additional normal descriptions is insufficient for effective few-shot anomaly reasoning.\nIn contrast, the calibration variant achieves consistently stronger performance, indicating that\nfew-shot samples are more effective when used\nFigure 3: Hyperparameter analysis.\nto adapt anomaly reasoning toward the targetdata normal distribution. Finally, integrating both hard-normal information and calibration into\nAnomalyAgent (i.e., the few-shot AnomalyAgent) yields the best overall performance, demonstrating\nthat explicit normality priors and memory-calibrated reasoning are complementary for few-shot\nanomaly detection.\nHyperparameter Sensitivity. AnomalyAgent contains two key hyperparameters: K, which controls\nthe number of selected atomic candidates in counterfactual template analysis, and N , which denotes\nthe number of consecutive ‘Normal’ judgments required for agent termination. Fig. 3 presents\nthe corresponding hyperparameter sensitivity analysis on MVTec and MVTec LOCO. As shown\nin Fig. 3(a), the performance first improves and then slightly drops as K increases. A small K\nmay provide insufficient anomaly-relevant evidence for reliable reasoning, while an overly large K\ncan introduce redundant or noisy candidates that weaken the discriminability of the counterfactual\nanalysis. Overall, AnomalyAgent achieves the best trade-off around K = 5. Fig. 3(b) analyzes\nthe effect of N . Increasing N from 1 to 3 consistently improves the performance, suggesting that\nrequiring multiple consecutive normal judgments helps suppress premature normal predictions and\nleads to more reliable anomaly decisions. However, further increasing N to 4 slightly degrades\nthe performance, possibly because excessive confirmation introduces over-conservative reasoning\nbehavior. Finally, Fig. 3(c) compares different MLLM backbones. Larger and stronger MLLMs\nconsistently lead to improved anomaly detection performance, verifying that the proposed reasoning\nframework can effectively benefit from stronger multimodal reasoning capability.\n\n5\n\nConclusion\n\nThis work introduces AnomalyAgent, offering a principled agentic framework that unleashes the\nsuperior reasoning abilities of MLLMs for training-free zero- and few-shot AD. This is not viable\nto the generic agentic models due to the lack of anomaly-centric priors and normality. To tackle\nthis challenge, two novel components, including a comprehensive anomaly-centric toolset and self\ncalibration-based memory mechanism, are introduced in AnomalyAgent. Our extensive experiments\nshow that, with the support of these two components, AnomalyAgent achieves promising zero- and\nfew-shot AD performance, significantly outperforming training-free VLM-based AD models and\ngeneric MLLM-based agents, with competitive performance to SotA trainable VLM-based methods.\n9\n\n\fReferences\n[1] Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han,\nFei Huang, et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023. 2\n[2] Paul Bergmann, Kilian Batzner, Michael Fauser, David Sattlegger, and Carsten Steger. Beyond dents and\nscratches: Logical constraints in unsupervised anomaly detection and localization. International Journal\nof Computer Vision, 130(4):947–969, 2022. 1, 2, 6\n[3] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad–a comprehensive\nreal-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE/CVF conference on\ncomputer vision and pattern recognition, pages 9592–9600, 2019. 1, 6\n[4] Yunkang Cao, Xiaohao Xu, Jiangning Zhang, Yuqi Cheng, Xiaonan Huang, Guansong Pang, and Weiming Shen. A survey on visual anomaly detection: Challenge, approach, and prospect. arXiv preprint\narXiv:2401.16402, 2024. 1\n[5] Yunkang Cao, Jiangning Zhang, Luca Frittoli, Yuqi Cheng, Weiming Shen, and Giacomo Boracchi.\nAdaclip: Adapting clip with hybrid learnable prompts for zero-shot anomaly detection. In European\nConference on Computer Vision, pages 55–72, 2024. 1, 2, 3, 7\n[6] Yuhao Chao, Jie Liu, Jie Tang, and Gangshan Wu. Anomalyr1: A grpo-based end-to-end mllm for\nindustrial anomaly detection. arXiv preprint arXiv:2504.11914, 2025. 2, 3\n[7] Xuhai Chen, Yue Han, and Jiangning Zhang. April-gan: A zero-/few-shot anomaly classification and\nsegmentation method for cvpr 2023 vand workshop challenge tracks 1&amp;2: 1st place on zero-shot ad and\n4th place on few-shot ad. arXiv preprint arXiv:2305.17382, 2023. 2, 3, 7\n[8] Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. Mem0: Building\nproduction-ready ai agents with scalable long-term memory. arXiv preprint arXiv:2504.19413, 2025. 3, 7\n[9] Qingqing Fang, Wenxi Lv, and Qinliang Su. Af-clip: Zero-shot anomaly detection via anomaly-focused clip\nadaptation. In Proceedings of the 33rd ACM International Conference on Multimedia, pages 4846–4855,\n2025. 1\n[10] Matic Fučka, Vitjan Zavrtanik, and Danijel Skočaj. Anomalyvfm–transforming vision foundation models\ninto zero-shot anomaly detectors. arXiv preprint arXiv:2601.20524, 2026. 7\n[11] Zhaopeng Gu, Bingke Zhu, Guibo Zhu, Yingying Chen, Hao Li, Ming Tang, and Jinqiao Wang. Filo:\nZero-shot anomaly detection by fine-grained description and high-quality localization. In Proceedings of\nthe 32nd ACM International Conference on Multimedia, pages 2041–2049, 2024. 3\n[12] Zhaopeng Gu, Bingke Zhu, Guibo Zhu, Yingying Chen, Ming Tang, and Jinqiao Wang. Anomalygpt:\nDetecting industrial anomalies using large vision-language models. Proceedings of the AAAI Conference\non Artificial Intelligence, 2024. 2, 3\n[13] Sebastian Höfer, Dorian F Henning, Artemij Amiranashvili, Douglas Morrison, Mariliza Tzes, Ingmar\nPosner, Marc Matvienko, Alessandro Rennola, and Anton Milan. Kaputt: A large-scale dataset for visual\ndefect detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages\n24224–24233, 2025. 1, 2, 6\n[14] Jongheon Jeong, Yang Zou, Taewan Kim, Dongqing Zhang, Avinash Ravichandran, and Onkar Dabeer.\nWinclip: Zero-/few-shot anomaly classification and segmentation. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition, pages 19606–19616, 2023. 1, 3, 4, 7\n[15] Xi Jiang, Jian Li, Hanqiu Deng, Yong Liu, Bin-Bin Gao, Yifeng Zhou, Jialin Li, Chengjie Wang, and Feng\nZheng. Mmad: A comprehensive benchmark for multimodal large language models in industrial anomaly\ndetection. In Proceedings of The International Conference on Learning Representations, 2025. 2, 3\n[16] Bo Li, Yuanhan Zhang, Dong Guo, Renrui Zhang, Feng Li, Hao Zhang, Kaichen Zhang, Peiyuan Zhang,\nYanwei Li, Ziwei Liu, et al. Llava-onevision: Easy visual task transfer. arXiv preprint arXiv:2408.03326,\n2024. 2\n[17] Liu Li, Mai Xu, Xiaofei Wang, Lai Jiang, and Hanruo Liu. Attention based glaucoma detection: A\nlarge-scale database and cnn model. In Proceedings of the IEEE/CVF Conference on Computer Vision and\nPattern Recognition, pages 10571–10580, 2019. 6\n[18] Xiaofan Li, Zhizhong Zhang, Xin Tan, Chengwei Chen, Yanyun Qu, Yuan Xie, and Lizhuang Ma.\nPromptad: Learning prompts with only normal samples for few-shot anomaly detection. Proceedings of\nthe IEEE/CVF conference on computer vision and pattern recognition, 2024. 3\n\n10\n\n\f[19] Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi\nDeng, Chenyu Zhang, Chong Ruan, et al. Deepseek-v3 technical report. arXiv preprint arXiv:2412.19437,\n2024. 2\n[20] Wenxin Ma, Xu Zhang, Qingsong Yao, Fenghe Tang, Chenxu Wu, Yingtai Li, Rui Yan, Zihang Jiang, and\nS Kevin Zhou. Aa-clip: Enhancing zero-shot anomaly detection via anomaly-aware clip. In Proceedings\nof the Computer Vision and Pattern Recognition Conference, pages 4744–4754, 2025. 1, 2\n[21] OpenAI. Gpt-4.1 mini. https://platform.openai.com/docs/models, 2025. 7\n[22] OpenAI. Gpt-5.1. https://platform.openai.com/docs/models, 2025. 7\n[23] Guansong Pang, Chunhua Shen, Longbing Cao, and Anton Van Den Hengel. Deep learning for anomaly\ndetection: A review. ACM Computing Surveys, 54(2):1–38, 2021. 1\n[24] Zhen Qu, Xian Tao, Xinyi Gong, ShiChen Qu, Xiaopei Zhang, Xingang Wang, Fei Shen, Zhengtao\nZhang, Mukesh Prasad, and Guiguang Ding. Dictas: A framework for class-generalizable few-shot\nanomaly segmentation via dictionary lookup. In Proceedings of the IEEE/CVF International Conference\non Computer Vision, pages 20519–20528, 2025. 1, 2\n[25] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish\nSastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from\nnatural language supervision. In International conference on machine learning, pages 8748–8763, 2021. 3,\n7, 13\n[26] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf, Thomas Brox, and Peter Gehler.\nTowards total recall in industrial anomaly detection. In Proceedings of the IEEE/CVF conference on\ncomputer vision and pattern recognition, pages 14318–14328, 2022. 2, 7\n[27] Mohammadreza Salehi, Niousha Sadjadi, Soroosh Baselizadeh, Mohammad H Rohban, and Hamid R\nRabiee. Multiresolution knowledge distillation for anomaly detection. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition, pages 14902–14912, 2021. 1, 6\n[28] Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion:\nLanguage agents with verbal reinforcement learning. Advances in neural information processing systems,\n36:8634–8652, 2023. 3\n[29] Xintao Wang, Liangbin Xie, Chao Dong, and Ying Shan. Real-esrgan: Training real-world blind superresolution with pure synthetic data. In Proceedings of the IEEE/CVF international conference on computer\nvision, pages 1905–1914, 2021. 13\n[30] Peng Wu, Chengyu Pan, Yuting Yan, Guansong Pang, Qingsen Yan, Peng Wang, and Yanning Zhang. Deep\nlearning for video anomaly detection: A review. IEEE Transactions on Neural Networks and Learning\nSystems, 2026. 1\n[31] Chaoran Xu, Chengkan Lv, Qiyu Chen, Feng Zhang, and Zhengtao Zhang. Mrad: Zero-shot anomaly\ndetection with memory-driven retrieval. In Proceedings of The International Conference on Learning\nRepresentations, 2026. 1, 2, 7\n[32] Jiacong Xu, Shao-Yuan Lo, Bardia Safaei, Vishal M Patel, and Isht Dwivedi. Towards zero-shot anomaly\ndetection and reasoning with multimodal large language models. In Proceedings of the Computer Vision\nand Pattern Recognition Conference, pages 20370–20382, 2025. 2, 3\n[33] An Yang et al. Qwen3 technical report. arXiv preprint arXiv:2505.xxxxx, 2025. 7\n[34] Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React:\nSynergizing reasoning and acting in language models. In Proceedings of The International Conference on\nLearning Representations, 2023. 3, 7\n[35] Xincheng Yao, Zixin Chen, Gao Chao, Guangtao Zhai, and Chongyang Zhang. Resad: A simple framework\nfor class generalizable anomaly detection. 2024. 3\n[36] Jinjin Zhang, Guodong Wang, Yizhou Jin, and Di Huang. Towards training-free anomaly detection with\nvision and language foundation models. In Proceedings of the IEEE/CVF Conference on Computer Vision\nand Pattern Recognition, pages 15204–15213, 2025. 1, 2, 3, 7\n[37] Yu Zheng, Ming Jin, Yixin Liu, Lianhua Chi, Khoa T Phan, and Yi-Ping Phoebe Chen. Generative and\ncontrastive self-supervised learning for graph anomaly detection. IEEE Transactions on Knowledge and\nData Engineering, 35(12):12220–12233, 2021. 1\n\n11\n\n\f[38] Qihang Zhou, Guansong Pang, Yu Tian, Shibo He, and Jiming Chen. Anomalyclip: Object-agnostic\nprompt learning for zero-shot anomaly detection. In Proceedings of The International Conference on\nLearning Representations, 2024. 1, 2, 3, 7\n[39] Jiawen Zhu, Yew-Soon Ong, Chunhua Shen, and Guansong Pang. Fine-grained abnormality prompt\nlearning for zero-shot anomaly detection. In Proceedings of the IEEE/CVF International Conference on\nComputer Vision, pages 22241–22251, 2025. 1, 2, 3, 7\n[40] Jiawen Zhu and Guansong Pang. Toward generalist anomaly detection via in-context residual learning with\nfew-shot sample prompts. In Proceedings of the IEEE/CVF conference on computer vision and pattern\nrecognition, pages 17826–17836, 2024. 2, 3, 7\n\n12\n\n\fA\n\nMore Implmentation Details\n\nA.1\n\nDetails of Visual Tool Use\n\nAnomalyAgent equips the MLLM agent with a set of lightweight visual tools to support anomalyoriented evidence gathering. These tools provide complementary observations under different visual\nconditions, and their outputs are not used as standalone anomaly predictions. Instead, the processed\nobservations are returned to the planner–reasoner–reflector loop, where they are considered together\nwith the original image, semantic priors, counterfactual evidence, and accumulated reasoning history.\nAll tools are invoked only at inference time and do not require target-dataset training or parameter\nadaptation.\nImage Denoising. The denoising tool is implemented with OpenCV’s fast non-local means filtering,\nwhich suppresses color and spatial noise while preserving local image structures. In AnomalyAgent,\nthis tool is useful when suspected defects may be confused with acquisition noise, compression\nartifacts, or low-light degradation, allowing the reasoner to verify whether the abnormal evidence\nremains visible after noise suppression.\nImage Deblurring. The deblurring tool is implemented with unsharp masking based on Gaussian\nblur subtraction. It enhances local edges and contours without introducing any learned adaptation.\nThis tool is used when anomaly hypotheses depend on boundary sharpness, object shape, or surface\ndiscontinuities, helping the agent distinguish true structural irregularities from blur-induced ambiguity.\nBrightness Enhancement. The brightness enhancement tool applies contrast-limited adaptive\nhistogram equalization (CLAHE) to the L-channel in the LAB color space. This operation improves\nlocal contrast while limiting over-amplification. In the reasoning loop, it is used to re-examine regions\naffected by under-exposure or over-exposure, where abnormal patterns may otherwise be hidden or\nvisually exaggerated.\nImage Super-Resolution. The super-resolution tool uses Real-ESRGAN [29] to enhance image\nresolution and recover fine-grained texture details. This provides additional visual evidence for\ncases where the anomaly decision relies on small defects, subtle texture changes, or local missing\ncomponents. The enhanced image is treated as an auxiliary observation for verification rather than as\na replacement for the original image.\nImage Retrieval. The retrieval tool uses CLIP-based visual-textual retrieval [25], where cosine\nsimilarity between CLIP embeddings is used to score relevance. This tool provides contextual\nreference evidence by retrieving previously observed examples related to the current query or\nsuspected abnormal pattern. The retrieved results are used to support comparison with normal or\nsuspicious visual patterns, but the final anomaly decision is still made by the reasoner through the\nagentic reasoning process.\n\nB\n\nPrompt Templates\n\n13\n\n\fPlanner Prompt for Anomaly Detection\nYour task is to analyze the provided image(s) and plan the anomaly-detection workflow. You have access to a general template\nanalysis from keyword heuristic decision (if available), which provides semantic evidence signals based on caption-prototype\ncomparison. Use this information to inform your planning, but do not rely solely on it.\nYou MUST:\n1. Examine the image for potential anomalies (color, texture, shape, patterns, structure).\n2. Decide whether additional image processing is needed.\n3. Either:\n- Call exactly ONE image-processing tool using the tool calling mechanism, OR\n- Skip tool calling if you have already identified obvious anomalies.\nIMPORTANT (CRITICAL PROTOCOL — MUST FOLLOW EXACTLY):\nYou MUST ALWAYS provide a JSON object in the assistant message content with the following structure:\n{\n\"decision\": \"call_tool\" or \"skip_tool\",\n\"potential_anomalies\": \"Describe suspected or observed anomalies, with locations and visual characteristics. If none, describe\nnormal appearance.\",\n\"heuristic_prompt\": \"Guidance for further analysis: regions to re-inspect, features to verify, or next-step strategy.\"\n}\nThis JSON is ALWAYS required, regardless of whether you call a tool or skip tool calling.\nTool calling rules:\n- If you choose \"decision\": \"call_tool\":\n- Use the tool calling mechanism to invoke the selected tool.\n- You MUST include the required JSON in the SAME assistant message content (even if it's very short, just the JSON).\n- The JSON can be in the same message that contains the tool_calls.\n- If you choose \"decision\": \"skip_tool\":\n- Do NOT call any tools.\n- Output ONLY the JSON object in your response content.\nAdditional rules:\n- Tool choice MUST be based on FUNCTION, NOT list order.\n- You may call tools WITHOUT providing image_base64; the image will be extracted automatically.\n- Do NOT mention tool names if you skip tool calling.\nAvailable tools (arbitrary order):\n- image_denoising: reduce noise or grain\n- image_deblurring: sharpen blurry or out-of-focus images\n- image_super_resolution: enhance fine-grained details\n- image_zooming: magnify specific regions\n- image_brightness_enhancement: enhance brightness for dimly lit or overexposed images using CLAHE\nDecision Guide:\n- If noisy → image_denoising\n- If blurry → image_deblurring\n- If low-resolution → image_super_resolution\n- If specific region needs close inspection → image_zooming\n- If dimly lit or overexposed → image_brightness_enhancement\n- If image looks already clear → use super-resolution or zoom for finer detail analysis\n\nFigure 4: Planner Prompt for Anomaly Detection.\n\n14\n\n\fReasoner Prompt for Anomaly Detection\nYour task is to make a FINAL judgment about whether the image contains anomalies.\nUse ALL available information, including:\n- General template analysis from keyword heuristic decision (semantic evidence signals based on caption-prototype comparison) available in first call\n- Counterfactual template analysis from atomic candidate matching (evidence report based on similarity matching) - available in\nlater calls (after reflection)\n- Potential anomalies identified in earlier stages\n- Heuristic prompts\n- Any processed/enhanced image results\n- Your own analysis based on the current image\nNote: In the first call, you will receive general template analysis. In later calls (after reflection), you will receive counterfactual\ntemplate analysis instead.\nRespond with a JSON object containing exactly two fields:\n{\n\"result\": \"One of: 'anomalous', 'normal', or 'uncertain'.\nUse 'anomalous' if you judge that anomalies exist.\nUse 'normal' if the image appears consistent with expected appearance.\nUse 'uncertain' if the evidence is mixed, ambiguous, or insufficient.\",\n\"reason\": \"A detailed explanation of your reasoning, including:\n(1) what specific issues were found or why the image seems normal,\n(2) how previous findings influenced your judgment,\n(3) your confidence level,\n(4) if uncertain, what information is still missing.\"\n}\nGuidelines:\n- Be specific about which visual or analytical factors led to your conclusion.\n- Integrate past findings with your current understanding.\n- Only output the JSON object, with no extra text.\n- &lt;&lt;IMAGE_SOURCE_INSTRUCTION&gt;&gt;\n- &lt;&lt;TOOL_FAILURE_INSTRUCTION&gt;&gt;\n\nFigure 5: Reasoner Prompt for Anomaly Detection.\n\n15\n\n\fReflector Prompt for Anomaly Detection\nYour task is to RE-ANALYZE the case to verify or refine the previous conclusion.\nUse ALL available information:\n- General template analysis from keyword heuristic decision (semantic evidence signals based on caption-prototype comparison)\n- Counterfactual template analysis from atomic candidate matching (evidence report based on similarity matching)\n- Previous potential anomalies\n- The heuristic prompt\n- Which tools were used previously\n- Any processed or enhanced visual results\nYou MUST:\n1. Decide whether new information is needed.\n2. Either:\n- Call exactly ONE image-processing tool (prefer a tool NOT used previously; if all tools were used, you may reuse one with a\ndifferent focus), OR\n- Skip tool calling if the existing evidence is sufficient.\n3. Provide refined potential anomalies and a refined heuristic prompt.\nIMPORTANT (CRITICAL PROTOCOL — MUST FOLLOW EXACTLY):\nYou MUST ALWAYS provide a JSON object in the assistant message content with the following structure:\n{\n\"decision\": \"call_tool\" or \"skip_tool\",\n\"image_target\": \"raw\" or \"augmented\",\n\"potential_anomalies\": \"Refined description of suspected or observed anomalies, with locations and visual characteristics.\",\n\"heuristic_prompt\": \"Refined guidance for further analysis: regions to re-inspect, features to verify, or next-step strategy.\"\n}\nThis JSON is ALWAYS required, regardless of whether you call a tool or skip tool calling.\nTool calling rules:\n- If you choose \"decision\": \"call_tool\":\n- Use the tool calling mechanism to invoke the selected tool.\n- You MUST include the required JSON in the SAME assistant message content (even if it's very short, just the JSON).\n- The JSON can be in the same message that contains the tool_calls.\n- If you choose \"decision\": \"skip_tool\":\n- Do NOT call any tools.\n- Do NOT mention any tool names.\n- Output ONLY the JSON object in your response content.\n&lt;&lt;TOOL_TARGET_INSTRUCTION&gt;&gt;\nAdditional rules:\n- Tool selection MUST be based on FUNCTION, NOT list order.\n- The goal is to gather NEW information from a DIFFERENT angle.\n- You may call tools WITHOUT providing image_base64; the image will be extracted automatically.\nAvailable tools:\n- image_denoising: reduce noise or grain\n- image_deblurring: sharpen blurry or out-of-focus images\n- image_super_resolution: enhance fine-grained details\n- image_zooming: magnify specific regions\n- image_brightness_enhancement: enhance brightness for dimly lit or overexposed images using CLAHE\nRe-analysis goals:\n- If previous result was \"normal\": verify that no subtle or overlooked anomalies exist.\n- If previous result was \"uncertain\": focus on resolving ambiguity.\n- If previous result contained potential anomalies: refine, validate, or challenge them.\n\nFigure 6: Reflector Prompt for Anomaly Detection.\n\n16\n\n\fDescription Prompt for Anomaly Detection\nYou are performing visual condition inspection for anomaly detection.\nYour task is to generate MULTIPLE concise descriptions of the object's visual condition from DIFFERENT PERSPECTIVES.\nCarefully examine the object in the image and produce EXACTLY THREE short captions, each focusing on a different aspect:\nPerspective 1 (Overall Condition):\n- Describe whether the object appears intact, normal, clean, or obviously damaged.\nPerspective 2 (Surface &amp; Texture):\n- Describe surface-level details such as scratches, cracks, dents, contamination,missing parts, deformation, or unusual texture.\nPerspective 3 (Anomaly-Oriented Judgment):\n- Describe whether there are any visual signs that could indicate defects, damage, or abnormality, even if subtle.\nGuidelines:\n- Each caption MUST be a single short English sentence.\n- Use objective visual observations only.\n- Do NOT explain reasoning.\n- Do NOT speculate beyond what is visible.\n- Do NOT repeat the same wording across captions.\nYour response MUST strictly follow this JSON format:\n{\n\n}\n\n\"captions\": [\n\"Caption from Perspective 1\",\n\"Caption from Perspective 2\",\n\"Caption from Perspective 3\"\n]\n\nReturn ONLY the JSON object, with no additional text.\n\nFigure 7: Description Prompt for Anomaly Detection.\n\n17\n\n\fCandidate Generation Prompt for Anomaly Detection\nYou are generating atomic candidate descriptions for anomaly detection.\nGiven a class name (e.g., \"bottle\"), generate two sets of atomic candidates in strict JSON format:\n1. anomaly_candidates: 10-12 short phrases or sentences describing anomalies such as:\n- Surface issues (scratches, cracks, dents, stains)\n- Deformations (bent, warped, misshapen)\n- Missing parts (broken, incomplete)\n- Contamination (dirty, discolored, foreign objects)\n- Label issues (misaligned, damaged labels)\n2. normal_candidates: The same quantity as anomaly_candidates, describing the object in complete and intact state.\nGuidelines:\n- Each candidate MUST be a short phrase or sentence (1-10 words).\n- Candidates should be specific and concrete.\n- Do NOT repeat similar descriptions.\n- anomaly_candidates should focus on defect/anomaly characteristics.\n- normal_candidates should focus on intact/complete characteristics.\nConstraints:\n- Return candidates grouped to cover: surface, shape, parts, contamination, label/printing (at least 2 each).\n- If a category is not applicable for this class (e.g., carpet/grid/tile may have no label/parts), replace it with other plausible defect\ntypes, but keep total count unchanged.\n- Do NOT use generic words like 'defective', 'damaged', 'abnormal' alone; always be specific (e.g., 'cracked surface', 'missing cap').\n- Do NOT treat synonyms as different candidates (e.g., 'scratch' vs 'scratched surface' are redundant); avoid pseudo-diversity.\nYour response MUST strictly follow this JSON format:\n{\n\n}\n\n\"anomaly_candidates\": [\n\"candidate 1\",\n\"candidate 2\",\n...\n],\n\"normal_candidates\": [\n\"candidate 1\",\n\"candidate 2\",\n...\n]\n\nReturn ONLY the JSON object, with no additional text.\n\nFigure 8: Candidate Generation Prompt for Anomaly Detection.\n\n18\n\n\fFew-Shot Entry Hard-Negative Reflection Prompt\nYou are reviewing a normal few-shot industrial inspection sample that the reasoner judged incorrectly.\nThe sample is known to be NORMAL. You will receive the image and the agent metadata below.\nYour task:\n1. Decide whether the image caption likely misled the reasoner into calling this normal sample anomalous.\n2. If the caption was misleading, write one concise hard-negative description: a visual cue that sounds suspicious in the caption but\nis actually normal for this class/sample.\n3. If the caption was not the cause of the mistake, do not invent a hard-negative description.\nReturn JSON only:\n{{\n\"caption_misled_reasoner\": true or false,\n\"hard_negative_description\": \"Concise description, or empty string if not applicable.\",\n\"misleading_caption_evidence\": \"What phrase or visual framing was misleading, or empty string.\",\n\"why_normal_for_this_class\": \"Why the cue should not be overcalled as anomalous.\",\n\"confidence\": 0.0\n}}\nSample metadata JSON:\n{sample_json}\n\nFigure 9: Few-Shot Entry Hard-Negative Reflection Prompt.\n\nFew-Shot Class Hard-Negative Summary Prompt\nYou are building a class-level hard-negative calibration note for industrial anomaly detection.\nYou will receive hard-negative descriptions mined from NORMAL few-shot samples of one class. These descriptions refer to\nvisual cues that can look anomalous or suspicious but were observed in normal samples.\nYour task:\n- Produce one compact class hard-negative description.\n- Emphasize what looks abnormal but is often normal for this class.\n- Keep it specific and useful for a reasoner.\n- Do not claim that all such cues are always normal; phrase it as a caution against overcalling.\nReturn JSON only:\n{{\n\"class_hard_negative_description\": \"One concise paragraph.\"\n}}\nClass hard-negative input JSON:\n{class_json}\n\nFigure 10: Few-Shot Class Hard-Negative Summary Prompt.\n\n19\n\n\f</code></pre></article>\n        \n</main>\n\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js\"></script>\n<script>\n\nfunction initTheme() {\n  const saved = localStorage.getItem('kb-theme') || 'light';\n  document.documentElement.setAttribute('data-theme', saved);\n  updateThemeIcon(saved);\n}\nfunction toggleTheme() {\n  const cur = document.documentElement.getAttribute('data-theme') || 'light';\n  const next = cur === 'light' ? 'dark' : 'light';\n  document.documentElement.setAttribute('data-theme', next);\n  localStorage.setItem('kb-theme', next);\n  updateThemeIcon(next);\n}\nfunction updateThemeIcon(t) {\n  const btn = document.getElementById('theme-toggle-btn');\n  if (btn) btn.innerHTML = t === 'dark' ? '☀️' : '🌙';\n}\ndocument.addEventListener('DOMContentLoaded', initTheme);\n\nfunction setViewMode(m) {\n  const grid = document.getElementById('bento-grid-view');\n  const list = document.getElementById('list-table-view');\n  const bGrid = document.getElementById('view-grid-btn');\n  const bList = document.getElementById('view-list-btn');\n  if (m === 'list') {\n    if (grid) grid.style.display = 'none';\n    if (list) list.style.display = 'flex';\n    if (bGrid) bGrid.classList.remove('active');\n    if (bList) bList.classList.add('active');\n  } else {\n    if (grid) grid.style.display = 'grid';\n    if (list) list.style.display = 'none';\n    if (bGrid) bGrid.classList.add('active');\n    if (bList) bList.classList.remove('active');\n  }\n  localStorage.setItem('kb-view', m);\n}\ndocument.addEventListener('DOMContentLoaded', () => {\n  const s = localStorage.getItem('kb-view') || 'grid';\n  setViewMode(s);\n});\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  document.querySelectorAll('pre').forEach(pre => {\n    const b = document.createElement('button');\n    b.className = 'copy-code-btn';\n    b.innerText = 'Copy';\n    b.onclick = () => {\n      const c = pre.querySelector('code') ? pre.querySelector('code').innerText : pre.innerText;\n      navigator.clipboard.writeText(c).then(() => {\n        b.innerText = 'Copied!';\n        setTimeout(() => { b.innerText = 'Copy'; }, 2000);\n      });\n    };\n    pre.appendChild(b);\n  });\n});\n\nwindow.addEventListener('keydown', (e) => {\n  if ((e.key === '/' || (e.metaKey && e.key === 'k')) && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n    const q = document.getElementById('global-search-input');\n    if (q) q.focus();\n  }\n});\n\n// Scrollspy for TOC\nwindow.addEventListener('scroll', () => {\n  const headers = document.querySelectorAll('.article-body h1, .article-body h2, .article-body h3');\n  const scrollPos = window.scrollY + 100;\n  headers.forEach(h => {\n    if (h.offsetTop <= scrollPos) {\n      const id = h.getAttribute('id');\n      if (id) {\n        document.querySelectorAll('.reading-sidebar a').forEach(a => {\n          a.classList.toggle('active', a.getAttribute('href') === '#' + id);\n        });\n      }\n    }\n  });\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  if (window.renderMathInElement) {\n    renderMathInElement(document.body, {\n      delimiters: [\n        {left: '$$', right: '$$', display: true},\n        {left: '$', right: '$', display: false},\n      ],\n      throwOnError : false\n    });\n  }\n});\n</script>\n\n</body>\n</html>\n"