文件最后提交记录最后更新时间
feat(cache): add LangGraph node-level Replay Guard for framework regression testing Replay mode previously only mocked LLM calls but let KernelVerifier run real compilation. When the environment differed from recording time (e.g. missing AVX512/OpenMP), the verifier would fail and route to conductor, which had no cached LLM response — causing a silent retry loop until max_step was exhausted. Introduce ReplaySnapshotStore that records each node's key output fields during cache_mode=record and verifies them during cache_mode=replay. On mismatch (e.g. verifier_result expected=True but actual=False due to env issues), a ReplayGuardError is raised immediately, preventing the workflow from entering un-cached error-handling branches. Key changes: - New replay_guard.py: ReplaySnapshotStore with per-node field snapshots using sha256 fingerprints for large text fields - Extend track_node decorator to call record/verify after each node - Add _replay_guard field to BaseState so LangGraph preserves it - Inject ReplaySnapshotStore into state in LangGraphTask when cache_mode is record or replay - Add _node_snapshots to existing cache sample JSON files - 14 new unit tests for replay guard logic The guard is completely inactive (zero overhead) when cache_mode is off, which is the default for all normal workflows. Made-with: Cursor 1 个月前
add review skill with cross-tool skill discovery Add akg-review skill for pre-submit code review (rebase conflicts, ruff/bandit, SPEC.md compliance). Includes bug fixes over initial version: - Fix status logic in check_spec_compliance.py - Add ruff/bandit format normalization in generate_report.py - Use mktemp for intermediate files, add disable-model-invocation - Fix worktree --detach, extend CODE-013, add arch validation Add scripts/sync_skills.sh and individual symlinks in .claude/skills/ and .cursor/skills/ so skills defined in .opencode/skills/ are discoverable by Claude Code and Cursor. Run ./scripts/sync_skills.sh after adding new skills. Made-with: Cursor 1 个月前
add review skill with cross-tool skill discovery Add akg-review skill for pre-submit code review (rebase conflicts, ruff/bandit, SPEC.md compliance). Includes bug fixes over initial version: - Fix status logic in check_spec_compliance.py - Add ruff/bandit format normalization in generate_report.py - Use mktemp for intermediate files, add disable-model-invocation - Fix worktree --detach, extend CODE-013, add arch validation Add scripts/sync_skills.sh and individual symlinks in .claude/skills/ and .cursor/skills/ so skills defined in .opencode/skills/ are discoverable by Claude Code and Cursor. Run ./scripts/sync_skills.sh after adding new skills. Made-with: Cursor 1 个月前
update opencode integration 1 个月前
support qwen skill 1 个月前
update docs for br_agents update akg_agents docs mv old docs add v2 docs 3 个月前
clean code 1 个月前
Update database files and its test report 2 个月前
update README 1 个月前
update logs path 1 个月前
!1957 merge br_agents into br_agents [AKG-AGENT] feat(code_checker): implement YAML-based policy loading for static analysis Created-by: xchang1121 Commit-by: xchang1121 Merged-by: yiyanzhi_akane1 Description: > /kind feature **What does this PR do / why do we need it**: One change that make the autoresearch loop debuggable and the code checker maintainable. ** Extract code-checker policy to YAML.** All hard/soft op blacklists, Triton decorator names, scanned prefixes, kernel class/method names, autotune kwargs, and stray-text unicode ranges moved from code_checker.py into code_checker.yaml. The Python module has zero defaults — missing keys hard-error at import. Bundled policy change: pool / norm / interpolate / cumsum moved HARD → SOFT, unblocking hybrid Triton+torch seeds on Ascend (where the strided phase can't fit a 256-B-aligned schedule). Perf metric still rejects hybrids that don't beat the pure-torch ref. **Which issue(s) this PR fixes**: Fixes [#366](https://gitcode.com/mindspore/akg/issues/366) **Special notes for your reviewers**: N/A See merge request: mindspore/akg!19571 个月前
update logs path 1 个月前
feat(autoresearch): build out the kernel-optimization agent workflow Since c72a9735 the autoresearch module has been a minimal ReAct skeleton (loop / turn / feedback / evaluator / runner + a handful of prompts). This commit turns it into the full kernel-optimization agent documented in docs/v2/AutoResearch.md. Agent architecture - Structured plan state: FeedbackBuilder owns plan.md, enforces rationale validation + min_items_per_plan + diversity checks, renders plan + optimization history + skill state across versions. - Three-layer skill model: Layer 0 fundamentals embedded in the system prompt from task_dir/skills/; Layer 1 SKILL.md mirrored per task, read on demand, elided at settle; Layer 2 compact skill index in the initial message. - System-owned skill binding: agent submits keywords per plan item, the framework matches them against SkillPool and assigns backing_skill; agent-emitted bindings are stripped at the TurnExecutor trust boundary. SkillBuilder tier() ranks bindings applied (0) / fresh (1) / previously-unbound (2). No terminal state — a later KEEP promotes an unbound skill back to tier 0. - New acknowledge_skill tool gates the first patch_file / write_file on any bound item (valuable_aspects / kernel_application / apply|unbind), doubling as the audit trail. - SkillPool auto-widens on keyword-miss; search_skills tool exposes the widen path to the agent. - Diagnose subagent post-eval; require_replan tags one item abandoned and enters replace-mode on next update_plan. Context management - ConversationBuffer owns skill injection (synthetic user message, not raw tool_result) and settle-time unload of both synthetic markers and voluntary read_file tool_results, with tracking maps rebuilt after compact. - Multi-step auto_compact pipeline: two concurrent LLM calls (op_summary + 5-section plan_analysis.md), force_rebuild fallback with char-capped degraded bodies. Runtime / tooling - run_autoresearch.py accepts --worker-url (host:port[,...]) to forward eval to a remote Worker Service, mutually exclusive with --device-id. - AST-aware patch_file + Markdown helpers + forbidden-pattern validator (edit_guardrails.yaml); better patch_file diagnostics with anchor_line. - Hardware family registry + hardware_aliases.yaml for arch normalisation across Huawei product lines. - Unified Python logger; SkillBuilder state transitions and diagnose decisions surface in agent.log. - Session resume gates on HEAD sha + dirty state; pool rehydration from plan_items; v4→v5 skill-state migration. Docs - Clean-room rewrite of docs/v2/AutoResearch.md + docs/v2/CN/ AutoResearch.md to describe the post-supervisor architecture; CLI usage as the single production entry point, debug entry points consolidated. Tests - End-to-end autoresearch suite stays green; new unit coverage: SkillBuilder transitions, SkillPool refill / match, keyword pipeline, acknowledge_skill schema + wiring, fundamentals layout, ConversationBuffer injection lifecycle, session resume, scaffold round-trip, compact pipeline, patch_file diagnostics, patch_validator, edit tool, git_repo, operator_skill_catalog, run_counters. 1 个月前
!1957 merge br_agents into br_agents [AKG-AGENT] feat(code_checker): implement YAML-based policy loading for static analysis Created-by: xchang1121 Commit-by: xchang1121 Merged-by: yiyanzhi_akane1 Description: > /kind feature **What does this PR do / why do we need it**: One change that make the autoresearch loop debuggable and the code checker maintainable. ** Extract code-checker policy to YAML.** All hard/soft op blacklists, Triton decorator names, scanned prefixes, kernel class/method names, autotune kwargs, and stray-text unicode ranges moved from code_checker.py into code_checker.yaml. The Python module has zero defaults — missing keys hard-error at import. Bundled policy change: pool / norm / interpolate / cumsum moved HARD → SOFT, unblocking hybrid Triton+torch seeds on Ascend (where the strided phase can't fit a 256-B-aligned schedule). Perf metric still rejects hybrids that don't beat the pure-torch ref. **Which issue(s) this PR fixes**: Fixes [#366](https://gitcode.com/mindspore/akg/issues/366) **Special notes for your reviewers**: N/A See merge request: mindspore/akg!19571 个月前
refactor: unify benchmark downloads and remove submodules 1 个月前
Enhance AnthropicProvider with SSL verification support - Added verify_ssl parameter to AnthropicProvider for SSL certificate validation, defaulting to False for enterprise proxy environments. - Created a custom HTTP client using httpx.AsyncClient to accommodate the new SSL verification configuration. - Updated initialization logging to include the SSL verification status. This change improves security and flexibility for users operating in environments with specific SSL requirements. 1 个月前
update logs path 1 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
add cache pt for triton-cuda-to-ascend bugfix: cuda cache bugfix: baseline profiler get proper device id update .gitignore support batch triton-cuda-to-ascend search bugfix: print ms to us update scripts 1 个月前
update README 1 个月前
init: split build & use mode for akg_agents 2 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
update README 1 个月前
update README 1 个月前
refactor: 抽取 ReActAgent 基类并重构 KernelAgent 架构 从 KernelAgent 中抽取通用的 ReAct 循环逻辑到 core_v2/agents/react_agent.py, 将业务特定的 KernelAgent 移动到 op/agents/,实现核心框架与业务逻辑的分离。 主要变更: - 新增 ReActAgent 基类 (core_v2/agents/react_agent.py) - 实现通用的 ReAct 主循环 (run, _get_next_action, _execute_tool) - Trace 系统集成 - 用户交互处理 (_handle_ask_user, _handle_user_response) - 定义抽象方法供子类实现 - 重构 KernelAgent (op/agents/kernel_agent.py) - 继承 ReActAgent - 实现算子特定的抽象方法 - 保留 DSL/backend/framework/arch 配置 - 保留 workflow 资源管理逻辑 - 移动 prompt 模板 - 从 core_v2/agents/prompts/kernel_agent_system.j2 - 到 op/resources/prompts/kernel_agent/system.j2 - 新增 SimpleReActAgent 示例 (examples/build_a_simple_react_agent/) - 演示如何继承 ReActAgent 创建自定义 Agent - 包含 4 个简单工具:计算、时间、天气、知识搜索 - 无 plan 功能,适合简单对话场景 - 更新所有相关导入路径和文档 架构优势: - core_v2 只包含通用框架代码,符合分层设计原则 - 可通过继承 ReActAgent 快速创建新的 Agent 类型 - 保持向后兼容,不影响现有功能 3 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
integrate solar roofline without source tree dependency 1 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
fix: code style fixes for strict-config branch - Run autopep8 --max-line-length=119 to fix E501/W291/W293 issues - Fix E722 bare except, F841 unused variables - Reorder imports in orchestrator.py (E402) - Add Apache 2.0 license header to job_manager.py - Ignore C901 (function complexity) in pyproject.toml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> 1 个月前
test(cache): complete test specification rectification, directory migration and code normalization - Remove obsolete cache test directory in core_v2 and clean up redundant files - Migrate test files as per SPEC: UT to tests/ut/cache_tests, ST to tests/op/st - Add Apache 2.0 license headers and fix file ending newlines for all test files - Clean hardcoded paths and optimize robust project root path locating - Remove unused project_cache_dir fixture and eliminate invalid code - Add level2 marker in pytest.ini to resolve test warnings - Define strict replay miss behavior: raise RuntimeError without live LLM fallback - Pass all cache unit tests and system tests successfully - Run autopep8 to format code and comply with PEP8 standards - Delete redundant test_bench_cpp_cpu_cache_real_samples.py file - Verify file compliance with SPEC requirements - style(cache): format code per specification and pass all validations and tests 1 个月前
feat(autoresearch): build out the kernel-optimization agent workflow Since c72a9735 the autoresearch module has been a minimal ReAct skeleton (loop / turn / feedback / evaluator / runner + a handful of prompts). This commit turns it into the full kernel-optimization agent documented in docs/v2/AutoResearch.md. Agent architecture - Structured plan state: FeedbackBuilder owns plan.md, enforces rationale validation + min_items_per_plan + diversity checks, renders plan + optimization history + skill state across versions. - Three-layer skill model: Layer 0 fundamentals embedded in the system prompt from task_dir/skills/; Layer 1 SKILL.md mirrored per task, read on demand, elided at settle; Layer 2 compact skill index in the initial message. - System-owned skill binding: agent submits keywords per plan item, the framework matches them against SkillPool and assigns backing_skill; agent-emitted bindings are stripped at the TurnExecutor trust boundary. SkillBuilder tier() ranks bindings applied (0) / fresh (1) / previously-unbound (2). No terminal state — a later KEEP promotes an unbound skill back to tier 0. - New acknowledge_skill tool gates the first patch_file / write_file on any bound item (valuable_aspects / kernel_application / apply|unbind), doubling as the audit trail. - SkillPool auto-widens on keyword-miss; search_skills tool exposes the widen path to the agent. - Diagnose subagent post-eval; require_replan tags one item abandoned and enters replace-mode on next update_plan. Context management - ConversationBuffer owns skill injection (synthetic user message, not raw tool_result) and settle-time unload of both synthetic markers and voluntary read_file tool_results, with tracking maps rebuilt after compact. - Multi-step auto_compact pipeline: two concurrent LLM calls (op_summary + 5-section plan_analysis.md), force_rebuild fallback with char-capped degraded bodies. Runtime / tooling - run_autoresearch.py accepts --worker-url (host:port[,...]) to forward eval to a remote Worker Service, mutually exclusive with --device-id. - AST-aware patch_file + Markdown helpers + forbidden-pattern validator (edit_guardrails.yaml); better patch_file diagnostics with anchor_line. - Hardware family registry + hardware_aliases.yaml for arch normalisation across Huawei product lines. - Unified Python logger; SkillBuilder state transitions and diagnose decisions surface in agent.log. - Session resume gates on HEAD sha + dirty state; pool rehydration from plan_items; v4→v5 skill-state migration. Docs - Clean-room rewrite of docs/v2/AutoResearch.md + docs/v2/CN/ AutoResearch.md to describe the post-supervisor architecture; CLI usage as the single production entry point, debug entry points consolidated. Tests - End-to-end autoresearch suite stays green; new unit coverage: SkillBuilder transitions, SkillPool refill / match, keyword pipeline, acknowledge_skill schema + wiring, fundamentals layout, ConversationBuffer injection lifecycle, session resume, scaffold round-trip, compact pipeline, patch_file diagnostics, patch_validator, edit tool, git_repo, operator_skill_catalog, run_counters. 1 个月前
LLM 输出去 JSON 化改造 + stream 模式支持 - KernelGen/Coder: 移除 JSON parser 依赖,改用代码提取 + py_compile 语法校验 - 删除 robust_parse 节点和相关 parser 配置 - 新增 stream 模式支持 - 新增 KernelGen 基准测试工具 (bench_kernel_gen.py) - 更新依赖文件 requirements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> 2 个月前
cache缓存第八次提交-llm目录下依赖添加 2 个月前
Enhance support for new architecture in configuration and verification modules 1 个月前
update docs for br_agents update akg_agents docs mv old docs add v2 docs 3 个月前
refactor: rename project from aikg to akg_agents Complete project renaming: - Renamed main directory: aikg/ -> akg_agents/ - Renamed Python package: ai_kernel_generator -> akg_agents - Renamed benchmark: aikgbench -> akg_kernels_bench - Updated client API: AIKGClient -> AKGAgentsClient - Updated all import paths and module references - Updated environment variables: AIKG_* -> AKG_AGENTS_* - Updated output directories and log paths - Updated all documentation and configuration files - Fixed Git submodules paths Breaking changes: - All Python imports need to update to 'from akg_agents' - Environment variable names changed: AIKG_* -> AKG_AGENTS_* - Package name changed from ai_kernel_generator to akg_agents - Client class renamed: AIKGClient -> AKGAgentsClient Co-authored-by: Cursor <cursoragent@cursor.com> 3 个月前
feat: add akg-cli wrapper and publish scripts 3 个月前
README.md

中文版

AKG Agents

📋 Table of Contents

📘 1. Project Overview

AKG Agents is an LLM-powered multi-agent collaboration framework for AI Infra and high-performance computing, aimed at boosting the development and optimization efficiency of high-performance code through intelligent agent collaboration.

The framework provides a complete agent infrastructure: ReAct Agent base classes, extensible Skill / Tools / SubAgent mechanisms, LangGraph workflow orchestration, tree-based Trace system, and a unified configuration and registry. Developers can rapidly build, compose, and deploy intelligent agents tailored to diverse tasks.

The current production scenario is AI kernel code generation: leveraging LLM planning and multi-agent collaboration to automate multi-backend, multi-DSL high-performance kernel generation and optimization. Future extensions will cover kernel migration, performance tuning, code refactoring, and more AI Infra related scenarios.

🗓️ 2. Changelog

  • 2026-04-28: CLI module (akg_cli) deprecated and will no longer receive updates.
  • 2026-03-31: Added AutoResearch workflow — agent-driven iterative deep optimization with KernelVerifier eval, supporting all DSLs.
  • 2026-03-11:Streamline the operator optimization process by integrating AKG Agents and OpenCode (akg-op Agent).
  • 2026-02-26: Supported PyPTO backend code generation.
  • 2026-02-15: Documentation reorganized. Legacy docs archived to docs/v1/, new docs consolidated under docs/v2/.
  • 2026-02-10: Core framework refactored (v2). Decoupled general-purpose Agent capabilities from kernel-specific logic to build a reusable multi-agent collaboration framework. See Architecture, Agent System, Skill System, Workflow, Trace System, Configuration.
  • 2025-12-01: Introduced LangGraph for task orchestration. New LangGraphTask replaces original Task Orchestration scheme. See Workflow Documentation.
  • 2025-11-25: Supported service architecture, including client-server-worker separation architecture. See Service Architecture Documentation.
  • 2025-10-14: Supported TileLang_CUDA backend code generation. See Benchmark Results.
  • 2025-09-26: Supported CUDA C and CPP backend code generation. See Benchmark Results.
  • 2025-09-14: Updated KernelBench Level1 kernel generation success rate. See Benchmark Results.
  • 2025-08-12: Supported "Doc-Driven Integration" (now replaced by Skill System).
  • 2025-06-27: Initial AIKG release with code generation support for Triton and SWFT backends.

🛠️ 3. Quick Start

Installation

# 1. Environment setup (optional, recommended Python 3.10/3.11/3.12)
conda create -n akg_agents python=3.11
conda activate akg_agents

# 2. Clone the repository
git clone https://gitcode.com/mindspore/akg.git -b br_agents
cd akg

# 3. Install dependencies
pip install -r akg_agents/requirements.txt

# 4. Install AKG Agents
pip install -e ./akg_agents --no-build-isolation

# 5. Download third-party benchmarks as needed
bash akg_agents/download.sh --with_all_benchmarks

Configure LLM

Copy the example config to ~/.akg/settings.json and fill in your API Key and model info:

mkdir -p ~/.akg
cp akg_agents/examples/settings.example.json ~/.akg/settings.json

A minimal configuration only requires one model (auto-applies to all levels):

{
  "models": {
    "standard": {
      "base_url": "https://api.deepseek.com/beta/",
      "api_key": "YOUR_API_KEY",
      "model_name": "deepseek-chat"
    }
  },
  "default_model": "standard"
}

Advanced Configuration:

Backend Dependencies

The br_agents branch currently supports the following three DSLs. Other backends are pending adaptation:

Platform Backend (DSL) Reference Link
Huawei Atlas A2 Training Series Triton https://gitee.com/ascend/triton-ascend
NVIDIA GPU Triton https://github.com/triton-lang/triton
CPU (x86_64) C++ GCC / Clang

Launch & Usage

AKG Agents provides kernel generation, optimization, and migration capabilities through scripts in three locations:

Directory Content
examples/kernel_related/ Generation, optimization, migration examples (primary)
python/akg_agents/op/tools/ Adaptive search, evolve runner scripts (single/batch)
scripts/ AutoResearch
Feature Example Scripts
Generation *_single.py — direct generation and verification
Optimization *_adaptive_search*.py (UCB), *_evolve*.py (evolution)
Migration run_cuda_to_ascend_conversion.py, run_cuda_to_ascend_evolve.py

Usage examples:

# Kernel generation
python examples/kernel_related/run_torch_npu_triton_single.py

# Optimization (adaptive search)
python python/akg_agents/op/tools/run_single_adaptive_search.py

# Optimization (evolution)
python python/akg_agents/op/tools/run_single_evolve.py

# Migration (CUDA → Ascend)
python examples/kernel_related/run_cuda_to_ascend_conversion.py

# AutoResearch
python scripts/run_autoresearch.py

▶️ 4. Tutorial Examples

examples/ directory
Example Category Description
NPU
kernel_related/run_torch_npu_triton_single.py Kernel Single kernel generation (Torch + Triton Ascend)
kernel_related/run_torch_adaptive_search_triton_ascend.py Kernel UCB adaptive search (Torch + Triton Ascend)
kernel_related/run_torch_evolve_triton_ascend.py Kernel Evolutionary kernel optimization (Torch + Triton Ascend)
kernel_related/run_cuda_to_ascend_conversion.py Kernel CUDA to Ascend kernel conversion
kernel_related/run_cuda_to_ascend_evolve.py Kernel CUDA to Ascend evolutionary optimization
GPU
kernel_related/gpu/run_triton_to_torch_single.py Kernel Single kernel generation (Torch + Triton CUDA)
kernel_related/gpu/run_torch_evolve_triton.py Kernel Evolutionary kernel optimization (Torch + Triton CUDA)
kernel_related/gpu/run_cudac_to_torch_single.py Kernel Single kernel generation (Torch + CUDA C)
CPU
kernel_related/cpu/run_torch_cpu_cpp_single.py Kernel Single kernel generation (Torch + CPP)
kernel_related/cpu/run_torch_evolve_cpu_cpp.py Kernel Evolutionary kernel optimization (Torch + CPP)
kernel_related/cpu/run_torch_adaptive_search_cpu_cpp.py Kernel UCB adaptive search (Torch + CPP)
AutoResearch
scripts/run_autoresearch.py Kernel AutoResearch iterative optimization (all backends, --desc / --ref / --kernel)
Utilities
kernel_related/run_kernel_profile.py Kernel Kernel performance profiling
run_skill/ Skill Skill loading, registry, hierarchy, versioning, installation, LLM selection examples
build_a_simple_react_agent/ Framework Build a custom ReAct Agent using the framework
build_a_simple_workflow/ Framework Build a custom LangGraph-based Workflow
settings.example.json Config Basic settings.json configuration template
settings.example.more.json Config Multi-provider examples (OpenAI, DeepSeek, Claude, Qwen, Kimi, Doubao, etc.)

🧭 Usage Mode vs Development Mode

akg_agents/
├── workspace/          ← Usage: open a Code Agent here to use operator optimization
│   ├── .opencode/        skills / agents definitions, auto-loaded
│   └── AGENTS.md
└── ...                 ← Development: open here to develop the framework itself
    ├── AGENTS.md
    └── python/akg_agents/
  • Usage mode (workspace/): For operator optimization users. Open OpenCode / Claude Code / Cursor and the built-in Agents and Skills handle env setup, kernel generation, fusion analysis, etc.
  • Development mode (akg_agents/): For framework developers. Develop the akg_agents codebase guided by AGENTS.md and per-directory SPEC.md files.

📐 5. Design Documentation

Start with Architecture for an overview, then read Workflow and Skill System to understand the core mechanisms.

Core Framework

  • Architecture - Overall architecture and module overview
  • Agent System - Agent base classes, ReAct Agent, registry
  • Skill System - Skill management and dynamic knowledge injection
  • Tools - Tool execution framework, built-in tools, domain tools
  • Workflow - LangGraph-based workflow orchestration
  • Trace System - Tree-based inference tracing (multi-fork, checkpoint resume)
  • Configuration - Unified configuration management (settings.json / env vars)
  • LLM - LLM provider, client, embedding

Scenarios

  • Generation — Direct kernel code generation and correctness verification
  • Optimization — Adaptive Search (UCB), Evolve (evolutionary algorithm), AutoResearch (agent-driven iteration)
  • Migration — CUDA → Ascend kernel conversion

OpenCode Integration

  • akg-op User Guide - End-to-end operator optimization Agent: env setup → fusion analysis (optional) → task extraction → operator generation → code integration, supporting single-operator optimization and model fusion analysis

Contributing

Additional Modules (v1 Documentation)