Rust 原生 · 终端优先 · 可嵌入
Mink 是一个 Rust 实现的 AI agent runtime:面向终端,也面向系统。既适合在终端中直接
工作(REPL / Full TUI / Inline TUI),也适合嵌入到服务端、桌面端或内部工具中 —— Rust
嵌入通过 mink::runtime in-process 运行;Python SDK 通过 wheel 内置的
mink-core --agent-jsonl 子进程复用同一运行时内核与语义。
[TOC]
快速开始
终端使用
# 前置:Rust 1.99+,设置 DEEPSEEK_API_KEY 或通过配置指定 OpenAI-compatible 端点
# 编译
cargo build --release # 或 make build
# REPL 交互模式
./target/release/mink -m flash -i
# Full TUI 全屏模式
./target/release/mink -m flash --tui
# Inline TUI 原生 scrollback 模式
./target/release/mink -m flash --tui=inline
# 单次查询 / 恢复最近会话
./target/release/mink -m flash "explain this project"
./target/release/mink -m flash --continue -i
# 使用自定义系统提示词
./target/release/mink --mission ./my-task.mission.md -i
Python SDK
pip install mink-agent
from mink_agent import AgentSession, SandboxConfig
session = AgentSession(SandboxConfig(
api_key="sk-...", # 或设置 DEEPSEEK_API_KEY 环境变量
read_dirs=["src"],
signal_policy="full", # off/evidence/state_ops/restart/full
))
result = session.run("scan this repo and summarize")
print(result["text"])
session.close()
Rust 嵌入
[dependencies]
mink = { package = "mink-core", version = "0.9.1", default-features = false, features = ["runtime"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
anyhow = "1"
use mink::prelude::{AgentOptions, AgentRuntime};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let rt = AgentRuntime::start(
AgentOptions::new("/tmp/mink-home", ".")
.with_api_key(std::env::var("DEEPSEEK_API_KEY")?)
.with_model("flash"),
).await?;
let outcome = rt.run_turn("hello").await?;
println!("{}", outcome.text);
rt.shutdown().await?;
Ok(())
}
核心特点
- 可嵌入的运行时内核 —
AgentRuntime::start() → run_turn() / stream_turn() → shutdown()完整生命周期。CLI、REPL、TUI 和 Rust 嵌入共享 in-process 运行时;Python SDK 通过内置mink-core二进制复用同一 Rust 内核,不需要维护多套 agent 内核。 - 长上下文与长任务可控 — 显式压缩参数 + LLM 摘要非破坏式投影 + 持久化 session 共同工作,上下文不无限膨胀,长任务可持续推进;
enabled_tools统一工具边界。 - 编辑与状态管理更可靠 — Hashline / Replace 双模式编辑(
Readsnapshot + 行锚定,或 exact/fuzzy 内容匹配)、artifact 超长输出回读、Plan journal 与 Todo revision 原子提交和 session 恢复机制,不把正确性交给运气。
Workspace Packages
| 路径 | 职责 |
|---|---|
| crates/mink-core | Rust 发布包 mink-core,库 crate 名 mink,包含可嵌入 runtime、工具核心、session、sandbox 和 SDK 协议 |
| crates/mink-cli | workspace 内部二进制包,生成 mink 终端二进制和 mink-core SDK 精简二进制,持有 REPL/TUI 实现 |
| mink_agent | Python SDK,wheel 内置无 TUI 的 mink-core 二进制 |
| crates/mink-server | Web 工作区服务器:REST + SSE + 嵌入前端,build.rs 自动构建并嵌入 web 产物 |
参考项目
| 项目 | 说明 |
|---|---|
| oh-my-pi | 开源 CLI agent(Bun/TypeScript),Edit 工具的行号锚定与快照协议参考实现 |
| bash-agent | 终端 Agent(Bash 优先),交互与工具执行参考 |
文档入口
从文档总览选择阅读路径:快速开始、Rust 集成、Python 集成或架构。配置、工具、协议与统计的完整定义统一在参考文档。
维护者的运行时/TUI 测量方法及按日期存档的结果见性能与验证。
许可
Metadata
Release files for mink-agent 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mink_agent-0.9.1-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details for mink_agent-0.9.1-py3-none-musllinux_1_2_x86_64.whl |
| mink_agent-0.9.1-py3-none-manylinux_2_35_x86_64.whl | Python 3 | none | Linux glibc 2.35+ x86-64 | Details for mink_agent-0.9.1-py3-none-manylinux_2_35_x86_64.whl |
| mink_agent-0.9.1-py3-none-macosx_26_0_arm64.whl | Python 3 | none | macOS 26.0+ ARM64 | Details for mink_agent-0.9.1-py3-none-macosx_26_0_arm64.whl |
Total release size: 11.7 MB
Release files / mink_agent-0.9.1-py3-none-musllinux_1_2_x86_64.whl
| Download URL | mink_agent-0.9.1-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
7ed798ccd3c907bf6ed17c7c22a876b9b76175b2befe2ab39b478e651df3b37a
|
|
BLAKE2b-256 checksum How to use checksums |
77e938f66b5b189b7240a085fc8c3664ce77fccec9c3e960375de15838684395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / mink_agent-0.9.1-py3-none-manylinux_2_35_x86_64.whl
| Download URL | mink_agent-0.9.1-py3-none-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Linux glibc 2.35+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
2099c9fdfd68e3e3931a0182a0da413c026e2d9458f8d76f157bc7b672811131
|
|
BLAKE2b-256 checksum How to use checksums |
bca3ed94f554347b9d5d7779d773a8af98fbcdbfae5a777e53445617d56b7e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / mink_agent-0.9.1-py3-none-macosx_26_0_arm64.whl
| Download URL | mink_agent-0.9.1-py3-none-macosx_26_0_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Python 3 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
397cc619676f86aa35ffd4a2224f63f8d2bcea3ca24ad752cf27c88dbb23ed8c
|
|
BLAKE2b-256 checksum How to use checksums |
f3cc34a27e1ea22e685794b5caa955159ded870c0ed27c30fb26f80c34125243
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for mink-agent 0.9.1
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.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for mink_agent-0.9.1-py3-none-musllinux_1_2_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA 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.