Skip to main content

Mink

Crates.io MIT licensed Rust 1.99+ Python SDK

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.6.7", 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 双模式编辑(Read snapshot + 行锚定,或 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 集成或架构。配置、工具、协议与统计的完整定义统一在参考文档。

版本记录见 CHANGELOG,开发约束见 AGENTS。

维护者的运行时/TUI 测量方法及按日期存档的结果见性能与验证。

许可

MIT License

Metadata

Release files for mink-agent 0.6.7

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

Built distributions (wheels)

Table of built distributions (wheels) for mink-agent 0.6.7
File Interpreter ABI Platform Actions
mink_agent-0.6.7-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for mink_agent-0.6.7-py3-none-musllinux_1_2_x86_64.whl
mink_agent-0.6.7-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for mink_agent-0.6.7-py3-none-manylinux_2_35_x86_64.whl
mink_agent-0.6.7-py3-none-macosx_26_0_arm64.whl Python 3 none macOS 26.0+ ARM64 Details for mink_agent-0.6.7-py3-none-macosx_26_0_arm64.whl

Total release size: 11.5 MB

Release files / mink_agent-0.6.7-py3-none-musllinux_1_2_x86_64.whl

Download URL mink_agent-0.6.7-py3-none-musllinux_1_2_x86_64.whl
Size 4.0 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
db90bf7c8753f932c9500a3507f4786a77b2bf0a28b698fd44132edcf15decce
BLAKE2b-256 checksum
How to use checksums
9d17e1f55239a9d755b4d8f276e025e5e61a824650a8e200851163942af20b3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release files / mink_agent-0.6.7-py3-none-manylinux_2_35_x86_64.whl

Download URL mink_agent-0.6.7-py3-none-manylinux_2_35_x86_64.whl
Size 4.0 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
db8c7e57e6c7c45361a54e277d723284a211900fe4fb5cc702b8c4c80188265f
BLAKE2b-256 checksum
How to use checksums
4febba52e7b9041ed57a38398ba0614d8154b6c4e76a53530c2abb02cde171b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release files / mink_agent-0.6.7-py3-none-macosx_26_0_arm64.whl

Download URL mink_agent-0.6.7-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
628bc2755770887bce2ad376715d9eca5504e4ae4f216deca59491a73917d0d2
BLAKE2b-256 checksum
How to use checksums
8ebd7578c761fffbfc5c889497f5878dfd67ce7d1d009cb1b607565918608939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Security for mink-agent 0.6.7

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.

Select from 3 files

Attestation for mink_agent-0.6.7-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 Oct 6, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.6.7 This release

3 release files Full provenance

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