360 Secure SkillHub
360 安全技能中心

Agent Archive

为 AI 智能体提供对话持久化导出与回放能力,包含 compact、full、rag、replay、jsonl 五种导出模式,输出会话元数据、工具调用记录、TOC 与分块索引,并将归档写入本地目录;长会话按轮次生成目录或分块。

laohu-aiskills
laohu-aiskills
热度 16.02
最近更新 2026-05-23 22:16:57
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 工作流 / 摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agent-archive
Metadata
name
agent-archive
description
Persistent conversation export and replay for AI agents system for Claude Code, Caveman, OpenClaw, Hermes, MCP agents, and multi-agent workflows. Use when user asks to export, save, archive, persist, snapshot, serialize, or backup conversations/chat sessions.
allowed-tools
["Write","Read","Bash","Glob"]

Agent Archive

Persistent conversation export and replay for AI agents.

Supports:

  • Markdown export
  • JSONL export
  • RAG-ready chunking
  • Tool call persistence
  • Session metadata
  • TOC generation
  • Long conversation optimization
  • Replay-friendly structure
  • Auto-summary
  • Multi-format export

Export Modes

Mode Purpose
compact Human readable
full Full forensic session export
rag Vector DB / RAG ingestion
replay Agent replay & observability
jsonl AI training datasets

Default Save Paths

.claude/agent-archives/
.claude/agent-archives/jsonl/
.claude/agent-archives/replay/

Export Metadata

Always include:

session_id:
conversation_id:
exported_at:
model:
agent:
cwd:
message_count:
tool_calls:
export_mode:

Long Conversation Rules

If conversation > 30 turns:

  • generate TOC
  • add anchors
  • collapse large tool outputs
  • summarize repetitive sections

If conversation > 100 turns:

  • split into chunks
  • generate session summary
  • create chunk index

Tool Call Rules

Preserve:

  • tool name
  • arguments
  • tool result
  • timing
  • errors
  • retry count

Example:

{
  "tool": "Write",
  "success": true,
  "latency_ms": 230
}

RAG Export Rules

When using rag mode:

  • insert chunk markers
  • preserve semantic boundaries
  • preserve code fences
  • keep markdown headings stable

Chunk format:

<!-- chunk:start id=12 -->
...
<!-- chunk:end -->

Replay Mode

Replay mode should preserve chronological execution:

  1. user input
  2. assistant reasoning summary
  3. tool call
  4. tool result
  5. assistant response

This mode is designed for:

  • debugging
  • benchmarking
  • observability
  • workflow replay