Skip to main content

reglow-agent

Reglow 企业级 Agent 底座的核心发行包(Python L4):

  • Agent Runtime:定义与版本、持久运行、事件溯源、租约、DAG 工作流、审批(含双人复核)、补偿 Saga、回放/差异/重跑
  • 记忆与知识:会话/消息、五层记忆、共享黑板、RAG 检索与引用溯源(复用客服知识库)
  • 评测与反馈:suite/case/run、指标聚合、发布门禁、模型切换回归、满意度/抽检/失败聚类
  • AI-Native 生成能力:Schema DSL、多语言后端生成引擎、前端生成器、评测集

本包不是 reglow 基础库的一部分;基础库只提供四语言同构的基础模块,Agent 能力由本包显式挂载。

当前版本:0.7.0(2026-11-24),依赖 reglow>=0.18.0。

安装

pip install "reglow-agent==0.7.0"

本地开发:

cd reglow-library/reglow-python/reglow-agent
pip install -e ".[dev]"
pytest

0.7.0 需要基础库 reglow>=0.18.0(提供 V0014–V0024 迁移与客服 RAG 公共 API)。 若基础库尚未升级,请先发布/升级 reglow,否则运行时会因缺少迁移或 API 失败。

两种使用方式

1. 嵌入式(Python 宿主单机)

import reglow_agent
from reglow.server import app

reglow_agent.register(app)        # 挂载 /admin/api/v1/agent/* 等路由
reglow_agent.register_models()    # 建表前注册 sys_agent_* 模型

2. 独立服务(推荐)

使用 reglow-agent-service(API + Worker + 迁移),四语言业务通过 reglow-agent-client 调用:

pip install reglow-agent-client
from reglow_agent_client import AgentClient

client = AgentClient("http://reglow-agent:8000", tenant_id=1, token=token)
run = client.workflows.run(workflow_id, input={"intent": "写周报"})

运行时能力

组 能力
定义/版本 AgentSpec / WorkflowSpec 发布不可变版本(spec_hash)
运行 幂等创建、租约、状态机、预算累计/超限中止、取消、过期恢复
工作流 DAG 节点(agent/tool/condition/approval/subworkflow/human_task/delay)、条件白名单、重试、补偿、死信
审批 confirm/high_risk 挂起、通过/驳回/修改、SLA 超时、双人复核
审计 sys_agent_audit 哈希链(prev_hash → hash)与校验接口
记忆/知识 会话摘要与裁剪、五层记忆、黑板乐观锁、RAG 引用落 sys_agent_knowledge_ref
评测/反馈 suite/case/run、指标、AGENT_EVAL_GATE、回归报告、满意度/抽检/聚类

数据表统一前缀 sys_agent_*(tenant_id NOT NULL DEFAULT 0);迁移 V0019–V0024 随基础库提供。

环境变量

变量 说明
AGENT_EVAL_GATE off / warn(默认)/ enforce:发布前评测门禁
AGENT_EGRESS_ALLOWLIST 工具出网白名单(逗号分隔),默认禁网
AGENT_WORKSPACE 工具沙箱根目录(路径穿越防护)
AGENT_SECRET_* 默认 secret:// 解析器使用的密钥来源
REGLOW_AGENT_EXPECTED_VERSION 服务启动时校验本包版本(可选)

测试

pytest                       # 单元/集成测试
pytest -m contract           # 契约门禁(基础库仓库内)

发布

rm -rf dist/ build/ *.egg-info
python -m build
python -m twine check dist/*
python -m twine upload dist/*        # 凭证见 ~/.pypirc 或 TWINE_* 环境变量

发布顺序:先发 reglow 基础库(含 V0014–V0024),再发 reglow-agent;四语言 SDK 与运行时契约版本保持同步。

License

MIT

Metadata

Release files for reglow-agent 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reglow-agent 0.7.0
File Size Uploaded Provenance Actions
reglow_agent-0.7.0.tar.gz 194.4 kB Without provenance Details for reglow_agent-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reglow-agent 0.7.0
File Interpreter ABI Platform Actions
reglow_agent-0.7.0-py3-none-any.whl Python 3 none any Details for reglow_agent-0.7.0-py3-none-any.whl

Total release size: 382.8 kB

Release files / reglow_agent-0.7.0.tar.gz

Download URL reglow_agent-0.7.0.tar.gz
Size 194.4 kB
Tags Source
SHA-256 checksum
How to use checksums
59a70f681bfe3eebacf57ced30d9cf843b7ff1aeb6dd74ff83656d800ade63ec
BLAKE2b-256 checksum
How to use checksums
021c4e45a175ca14ad36dc8422b26227e1a6120a4a867ae543ee0d0bd251bf5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / reglow_agent-0.7.0-py3-none-any.whl

Download URL reglow_agent-0.7.0-py3-none-any.whl
Size 188.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5019cfdb3822d2a66b70ad7b63a6987181679a27d678ca56e83d3ec83ad3ae2a
BLAKE2b-256 checksum
How to use checksums
6fd1cdffca19bc5acec4ef2c347568bac00f92f532f637ffdbec5c6da497f2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for reglow-agent 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page