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)
中文
ATaC (Agentic Trajectory as Code) 是一个专为 AI Agent 设计的轨迹录制与回放工具。它提供了一套标准化的声明式智能体轨迹 DSL,并提供了 atac cli、atac mcp 和 atac 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) 提供工作流运行时的可视化追踪调试功能。
📋 执行器兼容性
| 执行器 | 协议 | 状态 | 说明 |
|---|---|---|---|
| MCP | mcp:// |
✅ 已支持 | 原生支持所有标准 MCP 服务 |
| Bash | bash:// |
✅ 已支持 | 支持本地终端命令及脚本执行 |
| Kimi / Moonshot | kimi:// |
✅ 已支持 | 支持 Kimi-CLI 所有的内置工具 |
| Claude Code | - | 🚧 规划中 | 待集成内置工具集 |
🤖 自主构建与流转示例
1. 自动化构建 (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
2. 嵌套轨迹调用 (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"
🚀 快速开始
- 安装
uv tool install atac # 推荐
# 或 pip install atac
- 配置 MCP 环境
export ATAC_MCP_SERVER_CONFIGS="path/to/mcp_config.json"
- 执行轨迹
atac run example/multi_province_center.yaml
- 作为 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
forandif-elsesupport within YAML. - Multi-protocol Support: Unified execution for
mcp://,bash://, andkimi://. - 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.
📋 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 & Workflow Examples
1. 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}"}'
2. 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"
🚀 Quick Start
- Installation
uv tool install atac
- MCP Configuration
export ATAC_MCP_SERVER_CONFIGS="path/to/mcp_config.json"
- Run
atac run example/multi_province_center.yaml
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atac-0.1.4.tar.gz.
File metadata
- Download URL: atac-0.1.4.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59cd6865a47afe7be7266b6781b513aa33d475da8d0cb47b9244c322c0075d00
|
|
| MD5 |
4fee47cfe10672d73b0cfd27f9297bc8
|
|
| BLAKE2b-256 |
d261c3fd6ca25afa8bf01830fb2d23efa344bb7190d3017c759d389a5b451963
|
Provenance
The following attestation bundles were made for atac-0.1.4.tar.gz:
Publisher:
cd.yml on ATaC-team/ATaC
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atac-0.1.4.tar.gz -
Subject digest:
59cd6865a47afe7be7266b6781b513aa33d475da8d0cb47b9244c322c0075d00 - Sigstore transparency entry: 981157339
- Sigstore integration time:
-
Permalink:
ATaC-team/ATaC@1b0fb0b29deb88a2a79226901779f418b3487ad9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ATaC-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@1b0fb0b29deb88a2a79226901779f418b3487ad9 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file atac-0.1.4-py3-none-any.whl.
File metadata
- Download URL: atac-0.1.4-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1756561292f3864245627f20f57af5ddcf3c267504955b926490e7386062be1
|
|
| MD5 |
2dd2b671bd9e5ce46d1ccd70f8bee3c1
|
|
| BLAKE2b-256 |
7159a944d647b6694ab271a623db15ceb4f86561264d07849fd85964668e64af
|
Provenance
The following attestation bundles were made for atac-0.1.4-py3-none-any.whl:
Publisher:
cd.yml on ATaC-team/ATaC
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atac-0.1.4-py3-none-any.whl -
Subject digest:
b1756561292f3864245627f20f57af5ddcf3c267504955b926490e7386062be1 - Sigstore transparency entry: 981157384
- Sigstore integration time:
-
Permalink:
ATaC-team/ATaC@1b0fb0b29deb88a2a79226901779f418b3487ad9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ATaC-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@1b0fb0b29deb88a2a79226901779f418b3487ad9 -
Trigger Event:
workflow_run
-
Statement type: