Skip to main content

A powerful framework for managing long-running AI Agent tasks

Project description

LRA - Long-Running Agent Tool

一个强大的长时 AI Agent 任务管理框架

基于 Anthropic 论文 Effective Harnesses for Long-Running Agents 的最佳实践实现。

PyPI version License: MIT Python

English | 中文


中文

安装

pip install long-run-agent

安装完成后,运行初始化向导

lra init

这会:

  • 🌐 让你选择语言(中文/英文)
  • 🔧 自动配置 PATH 环境变量
  • 🤖 显示 AI Agent 引导提示词

🤖 给 AI Agent 使用(30秒上手)

第一步:初始化项目

cd /path/to/your/project
lra project create --name "我的项目"

第二步:告诉 AI Agent

每次开始工作,先读取 .long-run-agent/feature_list.json 了解项目进度和待开发功能。完成后更新对应 Feature 的状态。

就这样!AI Agent 会自动拥有跨会话的项目记忆。


快速命令

lra version                           # 查看版本
lra project create --name "我的项目"   # 初始化项目
lra feature create "登录功能" -p P0    # 创建功能
lra feature list                      # 功能列表
lra feature status <id> --set completed  # 标记完成
lra stats                             # 项目统计

解决的问题

挑战 LRA 如何解决
上下文窗口限制 状态持久化,AI 随时可读
过早完成 状态流转强制验证
一次性做太多 Feature 粒度拆分
状态追踪困难 lra feature list 一目了然
需求文档混乱 标准模板 + 自动校验

核心功能

  • 🔄 自动升级 - 版本检测 + 数据迁移
  • 📋 7 状态管理 - pending → completed 完整流转
  • 📝 需求文档 - 标准模板 + 完整性校验
  • 📊 代码变更记录 - 按 Feature 分文件存储
  • 📜 操作审计 - 完整操作日志追溯
  • 🔀 Git 集成 - Commit/Branch 自动关联

CLI 命令速查

# 初始化
lra init                    # 安装向导
lra version                 # 版本信息

# 项目
lra project create --name <name>
lra project list

# Feature
lra feature create <title> [--priority P0|P1|P2]
lra feature list
lra feature status <id> [--set <status>]

# 需求文档
lra spec create <feature_id>
lra spec validate <feature_id>
lra spec list

# 记录
lra records --feature <id>
lra records --file <path>

# 其他
lra stats / logs / code check / git / statuses

与 AI Agent 协作示例

# 告诉 AI Agent:

请读取 .long-run-agent/feature_list.json,告诉我:
1. 当前有哪些 pending 状态的功能
2. 哪些是 P0 优先级
3. 继续开发哪个功能

完成后更新状态:lra feature status <id> --set completed

环境要求

依赖 版本
Python ≥ 3.8
Git ≥ 2.0(可选)

链接


English

Installation

pip install long-run-agent

After installation, run the setup wizard:

lra init

This will:

  • 🌐 Let you choose language (Chinese/English)
  • 🔧 Auto-configure PATH environment variable
  • 🤖 Display AI Agent guidance prompt

🤖 For AI Agents (30 seconds)

Step 1: Initialize Project

cd /path/to/your/project
lra project create --name "My Project"

Step 2: Tell Your AI Agent

At the start of each session, read .long-run-agent/feature_list.json to understand current progress and pending features. Update Feature status when done.

That's it! Your AI Agent now has cross-session project memory.


Quick Commands

lra version                            # Show version
lra project create --name "My Project" # Initialize project
lra feature create "Login" -p P0       # Create feature
lra feature list                       # List features
lra feature status <id> --set completed
lra stats                              # Project statistics

Core Features

  • 🔄 Auto-upgrade - Version detection + data migration
  • 📋 7-state management - pending → completed workflow
  • 📝 Requirements docs - Templates + validation
  • 📊 Code change records - Per-feature storage
  • 📜 Operation audit - Complete logs
  • 🔀 Git integration - Commit/Branch tracking

CLI Reference

# Init
lra init / version

# Project
lra project create --name <name>
lra project list

# Feature
lra feature create <title> [--priority P0|P1|P2]
lra feature list / status <id>

# Spec
lra spec create / validate / list

# Records
lra records --feature <id> / --file <path>

# Utils
lra stats / logs / code check / git / statuses

Requirements

Dependency Version
Python ≥ 3.8
Git ≥ 2.0 (optional)

Links


Made with ❤️ for AI Agent Developers

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

long_run_agent-2.0.1.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

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

long_run_agent-2.0.1-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file long_run_agent-2.0.1.tar.gz.

File metadata

  • Download URL: long_run_agent-2.0.1.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for long_run_agent-2.0.1.tar.gz
Algorithm Hash digest
SHA256 59e61a5a782b58410cacc289712d18bc839b7eede97426ca33741e4104ef861c
MD5 ee0ede5ee24d27ade623e9693c30b346
BLAKE2b-256 3f69f27e8b9a2bcaf323d4484f894ac304f03d2b16de5c32318c6c263adf0950

See more details on using hashes here.

Provenance

The following attestation bundles were made for long_run_agent-2.0.1.tar.gz:

Publisher: publish.yml on hotjp/long-run-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file long_run_agent-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: long_run_agent-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 59.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for long_run_agent-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2fafc07eaf6e732fd5759e80f3c13f430f6967f94740a3c855ba4a7116c704
MD5 a5b972883b2164cdc291cc52129f882f
BLAKE2b-256 71ae0782164d12e970e84ae2becb669cf2731ab70ecf82dc482fab091dab3cf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for long_run_agent-2.0.1-py3-none-any.whl:

Publisher: publish.yml on hotjp/long-run-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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