Shared data models for knowlyr agent toolchain
Project description
KnowlyrCore
Agent 环境协议与共享数据模型 - Gym 风格环境注册表与领域配置 Gym-style agent environment protocol, registry, and domain profiles
快速开始 · 环境协议 · 注册表 · 领域配置 · Knowlyr 生态
GitHub Topics: gym, agent-environment, registry, domain-profile, pydantic, mcp
为 knowlyr-agent 生态提供统一的 Gym 风格环境协议、环境注册表和领域配置,是其余 5 个子包的共享基础。
核心能力 / Core Capabilities
AgentEnv 协议 → TimeStep 返回 → Registry 注册/查找 → DomainProfile 领域配置
设计特点 / Design Highlights
| 特点 | 说明 |
|---|---|
| Gym 协议 | 借鉴 Gymnasium / BrowserGym,统一 reset/step/close 接口 |
| 类型安全 | Pydantic 数据模型,完整类型标注 |
| 可组合包装器 | EnvWrapper 基类,MaxSteps/Timeout/Reward/Recorder 自由叠加 |
| 多领域 | 7 个内置 DomainProfile:coding, browser, conversation, engineering, advisory, discussion, generic |
| 注册表 | register/make/list_envs,与 Gymnasium 一致的环境管理方式 |
安装 / Installation
pip install knowlyr-core
开发模式:
pip install knowlyr-core[dev]
快速开始 / Quick Start
环境协议 / Environment Protocol
from knowlyrcore import AgentEnv, TimeStep, make, register
# 注册自定义环境
class MyEnv(AgentEnv):
domain = "coding"
def reset(self, *, task=None, seed=None) -> TimeStep:
return TimeStep(observation="ready")
def step(self, action: dict) -> TimeStep:
return TimeStep(observation="done", terminated=True)
def close(self): ...
@property
def available_tools(self) -> list[str]:
return ["bash", "submit"]
register("my/env", MyEnv, domain="coding")
env = make("my/env")
ts = env.reset()
领域配置 / Domain Profiles
from knowlyrcore import get_domain_profile, list_domain_profiles
# 查看所有领域
print(list_domain_profiles())
# ['coding', 'browser', 'conversation', 'engineering', 'advisory', 'discussion', 'generic']
# 获取领域工具列表
profile = get_domain_profile("coding")
for tool in profile.tools:
print(f"{tool.name}: {tool.description}")
包装器组合 / Composable Wrappers
from knowlyrcore.wrappers import MaxStepsWrapper, TimeoutWrapper
env = make("my/env")
env = MaxStepsWrapper(env, max_steps=30)
env = TimeoutWrapper(env, timeout=300)
API 概览
| 模块 | 核心导出 | 说明 |
|---|---|---|
env |
AgentEnv, EnvWrapper |
环境协议与包装器基类 |
timestep |
TimeStep |
统一返回类型 (observation/reward/terminated/truncated/info) |
registry |
register, make, list_envs, spec |
环境注册表 |
domain |
DomainProfile, ToolSpec, get_domain_profile |
领域配置 |
models |
TaskInfo, ToolResult |
共享数据模型 |
wrappers |
MaxStepsWrapper, TimeoutWrapper, RewardWrapper, RecorderWrapper |
内置包装器 |
License
AI Data Pipeline 生态
10 个工具覆盖 AI 数据工程全流程,均支持 CLI + MCP,可独立使用也可组合成流水线。
| 层 | 项目 | 说明 | 仓库 |
|---|---|---|---|
| 情报 | AI Dataset Radar | 数据集竞争情报、趋势分析 | GitHub |
| 分析 | DataRecipe | 逆向分析、Schema 提取、成本估算 | GitHub |
| 生产 | DataSynth | LLM 批量合成、种子数据扩充 | GitHub |
| 生产 | DataLabel | 轻量标注工具、多标注员合并 | GitHub |
| 质检 | DataCheck | 规则验证、重复检测、分布分析 | GitHub |
| 质检 | ModelAudit | 蒸馏检测、模型指纹、身份验证 | GitHub |
| Agent | KnowlyrCore | Gym 协议、注册表、领域配置 | You are here |
| Agent | AgentSandbox | Docker 执行沙箱、轨迹重放 | GitHub |
| Agent | AgentRecorder | 标准化轨迹录制、多框架适配 | GitHub |
| Agent | AgentReward | 过程级 Reward、Rubric 多维评估 | GitHub |
graph LR
A[Radar] --> B[Recipe] --> C[Synth] --> E[Check] --> F[Audit] --> G[Hub]
B --> D[Label] --> E
G --> H[Sandbox] --> I[Recorder] --> J[Reward]
style H fill:#e1f5fe
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 knowlyr_core-0.1.2.tar.gz.
File metadata
- Download URL: knowlyr_core-0.1.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
182a35cc71905d5a70e915b1fd5684a410beaa03f0ec89378ce4b23888c3456e
|
|
| MD5 |
22ad8c93907f9b19c4a629b0d13aa97e
|
|
| BLAKE2b-256 |
8952fb50a97153c8169e8be9c92f009b9aa707e76f37972eed5253e3a3392763
|
File details
Details for the file knowlyr_core-0.1.2-py3-none-any.whl.
File metadata
- Download URL: knowlyr_core-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
609e7f87d522f9eeb465eefdec8022339e046a5db3026920affcc57d230c9d13
|
|
| MD5 |
1d4d043b748408e1087dc688fc247024
|
|
| BLAKE2b-256 |
f65b50498cd2f75785312ba9ed4c24785dd5d739fab8878c9258169032604a20
|