Skip to main content

An Agent Trajectory Recording and Replay tool. Provides a standardized declarative Trajectory DSL alongside atac cli, atac mcp, and atac skills. Currently supports MCP, Bash, and some Agent built-in tools, recording dynamic Agent tool call trajectories into reusable static ATaC resources.

Project description

ATaC (Agentic Trajectory as Code)

English | 中文


中文

ATaC (Agentic Trajectory as Code) 是一个专为 AI Agent 设计的轨迹录制与回放工具。它提供了一套标准化的声明式智能体轨迹 DSL,并提供了 atac cliatac mcpatac skills。目前的轨迹 DSL 已经支持了 MCP、Bash 和部分 Agent 的内置工具,将动态的 Agent 工具调用轨迹录制为可复用的 ATaC 静态资源。

🛠 核心能力

  • 声明式控制流: 在 YAML 中实现循环 (for) 和条件 (if-else) 逻辑。
  • 多协议支持: 统一驱动 mcp:// (Model Context Protocol), bash:// (Shell) 及 kimi:// (Kimi 内置工具)。
  • Agent 编程接口: 提供 CLI 指令,使 LLM 能够通过命令行自主构建、修改和执行复杂工作流。
  • 可视化调试图谱: 内置 Web UI (atac ui) 提供工作流运行时的可视化追踪调试功能。

ATaC Web UI

📋 执行器兼容性

执行器 协议 状态 说明
MCP mcp:// ✅ 已支持 原生支持所有标准 MCP 服务
Bash bash:// ✅ 已支持 支持本地终端命令及脚本执行
Kimi / Moonshot kimi:// ✅ 已支持 支持 Kimi-CLI 所有的内置工具
Claude Code - 🚧 规划中 待集成内置工具集

🤖 自动化构建示例 (CLI)

Agent 可以通过以下指令序列自主生成 lookup.yaml 轨迹文件:

# 1. 初始化并定义输入变量
atac init lookup.yaml --name "GeoSearch"
atac add-input lookup.yaml --name provinces --type list

# 2. 注入逻辑结构 (For 循环)
atac add-for lookup.yaml --in '${inputs.provinces}' --item province

# 3. 在指定位置插入动作 (支持路径寻址)
atac add-action lookup.yaml --at 0 --id geo --action "mcp://amap/maps_geo" --args '{"address": "${variables.province}"}'

# 4. 预览生成的结构
atac show lookup.yaml

🚀 快速开始

  1. 安装
uv tool install atac  # 推荐
# 或 pip install atac
  1. 嵌套轨迹调用 (Sub-Workflows) ATaC 原生支持通过 bash://run 调用其它 ATaC 文件,从而实现模块化与依赖复用:
# 在 parent.yaml 中
steps:
  - id: call_sub
    type: action
    action: bash://run
    args:
      command: atac run child.yaml --input city="Beijing"
  1. 配置 MCP 环境
export ATAC_MCP_SERVER_CONFIGS="path/to/mcp_config.json"
  1. 执行轨迹
atac run example/multi_province_center.yaml
  1. 作为 MCP Server 启动 任何支持 MCP 的客户端 (如 Claude Desktop 或 Cursor) 均可将 ATaC 作为工具集连接:
{
  "mcpServers": {
    "atac": {
      "command": "atac",
      "args": ["mcp"],
      "env": {
        "ATAC_MCP_SERVER_CONFIGS": "path/to/mcp_config.json"
      }
    }
  }
}

如果尚未在全局安装,也可以使用 uvx 直接运行(推荐):

{
  "mcpServers": {
    "atac": {
      "command": "uvx",
      "args": ["atac", "mcp"],
      "env": {
        "ATAC_MCP_SERVER_CONFIGS": "path/to/mcp_config.json"
      }
    }
  }
}

English

ATaC (Agentic Trajectory as Code) is an Agent Trajectory Recording and Replay tool. It provides a standardized declarative Trajectory DSL alongside atac cli, atac mcp, and atac skills. The trajectory DSL currently supports MCP, Bash, and some Agent built-in tools, recording dynamic Agent tool call trajectories into reusable static ATaC resources.

🛠 Key Features

  • Declarative Control Flow: Native for and if-else support within YAML.
  • Multi-protocol Support: Unified execution for mcp://, bash://, and kimi://.
  • Agentic Authoring: CLI-first design allowing LLMs to programmatically build, refine, and execute their own workflows.
  • Visual Graph Debugging: Built-in Web UI (atac ui) for runtime workflow visualization and minimal-design editing.

ATaC Web UI

📋 Executor Support

Executor Scheme Status Note
MCP mcp:// ✅ Supported Native support for all MCP servers
Bash bash:// ✅ Supported Local shell commands and scripts
Kimi / Moonshot kimi:// ✅ Supported Full Kimi-CLI toolset support
Claude Code - 🚧 Roadmap Built-in tool integration pending

🤖 Authoring Flow (CLI)

Agents can generate a lookup.yaml trajectory via direct CLI commands:

atac init lookup.yaml --name "GeoSearch"
atac add-input lookup.yaml --name provinces --type list
atac add-for lookup.yaml --in '${inputs.provinces}' --item province
atac add-action lookup.yaml --at 0 --id geo --action "mcp://amap/maps_geo" --args '{"address": "${variables.province}"}'

🚀 Quick Start

  1. Installation
uv tool install atac
  1. Nested Trajectories (Sub-Workflows) ATaC supports executing other ATaC files natively via the bash://run executor, allowing you to build modular, reusable sub-workflows:
# Inside parent.yaml
steps:
  - id: call_sub
    type: action
    action: bash://run
    args:
      command: atac run child.yaml --input city="Beijing"
  1. MCP Configuration
export ATAC_MCP_SERVER_CONFIGS="path/to/mcp_config.json"
  1. Run
atac run example/multi_province_center.yaml
  1. Run as MCP Server Any MCP-compatible client (like Claude Desktop or Cursor) can connect to ATaC to author and run trajectories:
{
  "mcpServers": {
    "atac": {
      "command": "atac",
      "args": ["mcp"],
      "env": {
        "ATAC_MCP_SERVER_CONFIGS": "path/to/mcp_config.json"
      }
    }
  }
}

If not installed globally, you can also use uvx directly (Recommended):

{
  "mcpServers": {
    "atac": {
      "command": "uvx",
      "args": ["atac", "mcp"],
      "env": {
        "ATAC_MCP_SERVER_CONFIGS": "path/to/mcp_config.json"
      }
    }
  }
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atac-0.1.3.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atac-0.1.3-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file atac-0.1.3.tar.gz.

File metadata

  • Download URL: atac-0.1.3.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for atac-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8a27b455662d478a8716473ee9d981ec1bb85882aebb44e41e6d079c0da26b49
MD5 69dd44f5fd363af95bb66e381eaee20b
BLAKE2b-256 c3f071218f7371ed7b5b0c838c2c8a2ce8dee7a4e1f747ee9c506608e6ec6d4c

See more details on using hashes here.

File details

Details for the file atac-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: atac-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for atac-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ddff66e4177fd83a9611e80064ada6452332e2dab0a4b1e4846a60e4df817667
MD5 1a75d59f4b6bfcfe093adfdda295d1ce
BLAKE2b-256 e39ed74adb93a8f17302e33988b224fa329b98caa3080993638c3520ffc1832d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page