Workspace-isolated Python framework for building tool-using LLM agents.
Project description
AgentKit
一个基于 LLM 的通用 Agent 框架,支持 workspace 隔离、统一 LLM 抽象、工具调用循环、CLI 与 Python SDK。
当前能力
- workspace 强隔离:所有读写通过
WorkspaceFS - 统一 LLM 抽象:
ConversationItem/ConversationState/UnifiedLLMRequest/UnifiedLLMResponse - Provider 支持(同步、非流式、文本)
- OpenAI (
responses/chat_completions) - Anthropic (
messages) - Gemini (
generateContent) - Qwen(OpenAI-compatible
chat_completions) - vLLM(OpenAI-compatible
chat_completions)
- OpenAI (
- 工具系统:注册式工具机制,工具模块放在
src/agentkit/tools/library/ - Agent loop:模型推理与工具执行闭环,受 step/time budget 约束
- runlog:每次任务写入
workspace/logs/run_<run_id>.jsonl
状态
- 当前仓库包含针对 Agent loop、CLI、工具系统、runlog 以及 OpenAI / Anthropic / Gemini / Qwen / vLLM provider 适配层的单元测试
- 尚未提供针对真实上游 API 的集成 smoke test,因此正式发布前仍建议用目标模型做一次端到端验证
文档
详细使用说明和完整文档见 docs/agentkit/。
从源码安装
uv sync
uv run agentkit --help
从 PyPI 安装
pip install base-agentkit
agentkit --help
安装后的导入路径和 CLI 名称保持不变:
from agentkit import create_agent
配置示例
vLLM
workspace:
root: "./vllm_workspace"
provider:
kind: "vllm"
model: "glm-5"
openai_api_variant: "chat_completions"
conversation_mode: "auto"
base_url: "http://localhost:8000/v1"
api_key: "empty"
temperature: 0.8
timeout_s: 600
retries: 2
enable_thinking: true
agent:
system_prompt: "You are a helpful agent. Use tools when needed."
budget:
max_steps: 200
time_budget_s: 1800
max_input_chars: 180000
tools:
allowed:
- "view"
- "create_file"
- "str_replace"
- "word_count"
runlog:
enabled: true
redact: true
max_text_chars: 20000
CLI 运行
export OPENAI_API_KEY="your-key"
uv run agentkit --config path/to/config.yaml run --task "列出当前 workspace 的文件"
Python SDK
from agentkit import create_agent
agent = create_agent("path/to/config.yaml")
report = agent.run("在 workspace 里新建 notes/todo.txt 并写入今天计划")
print(report.final_output)
项目结构
核心实现位于 src/agentkit/:
config/: 配置结构与加载workspace/: 强隔离文件系统和目录布局llm/: 统一抽象、provider base/factory 与四平台 adaptertools/: 工具抽象、注册表与自动加载agent/: budget、report、runtime、Agent looprunlog/: 结构化事件、event sink 与 JSONL runlogcli/: 命令行入口
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 base_agentkit-0.1.0.tar.gz.
File metadata
- Download URL: base_agentkit-0.1.0.tar.gz
- Upload date:
- Size: 51.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1ef7587c0c5e6b3f91e9eada6a14d6ec21c56ec75fa19df87d7da54fcc017e9
|
|
| MD5 |
7e5fc6a9b2c9cace63b0719e6ecd519d
|
|
| BLAKE2b-256 |
4e89781808eef25419664f3de56c2ea12c6cff45bee02ead6e67d128576caf80
|
Provenance
The following attestation bundles were made for base_agentkit-0.1.0.tar.gz:
Publisher:
publish.yml on Inkjourney/agentkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
base_agentkit-0.1.0.tar.gz -
Subject digest:
f1ef7587c0c5e6b3f91e9eada6a14d6ec21c56ec75fa19df87d7da54fcc017e9 - Sigstore transparency entry: 1075912250
- Sigstore integration time:
-
Permalink:
Inkjourney/agentkit@1a0b2ca947c42fecd74abc543b714664e3d7a721 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Inkjourney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1a0b2ca947c42fecd74abc543b714664e3d7a721 -
Trigger Event:
push
-
Statement type:
File details
Details for the file base_agentkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: base_agentkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 74.6 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 |
6298091e60aa6a88345062644e57e82b22fc656909bc7ad339d163d8dee215f7
|
|
| MD5 |
06ac8dbfacad845656b39bba3e53a44e
|
|
| BLAKE2b-256 |
fd9f258044bcb0c2115cd91ce0a3731ffecb5ad4f676f3fd9f793ae45ad9c0cf
|
Provenance
The following attestation bundles were made for base_agentkit-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Inkjourney/agentkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
base_agentkit-0.1.0-py3-none-any.whl -
Subject digest:
6298091e60aa6a88345062644e57e82b22fc656909bc7ad339d163d8dee215f7 - Sigstore transparency entry: 1075912260
- Sigstore integration time:
-
Permalink:
Inkjourney/agentkit@1a0b2ca947c42fecd74abc543b714664e3d7a721 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Inkjourney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1a0b2ca947c42fecd74abc543b714664e3d7a721 -
Trigger Event:
push
-
Statement type: