竹子AI代理 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
竹子AI代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
竹子AI代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:cargo install(推荐) cargo install bamboo-agent # 方式二:从源码编译 git clone https://github.com/bigduu/Bamboo-agent cd Bamboo-agent cargo build --release # 二进制在 ./target/release/bamboo-agent
# 查看帮助 bamboo-agent --help # 基本运行 bamboo-agent [options] <input> # 详细使用说明请查阅文档 # https://github.com/bigduu/Bamboo-agent
# bamboo-agent 配置说明 # 查看配置选项 bamboo-agent --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export BAMBOO_AGENT_CONFIG="/path/to/config.yml"
| Capability | What it does |
|---|---|
| 🧠 **Memory system** | Session notes, Jiandu-owned derived Dream snapshots, and cross-session durable memory, with auto-dream and background gardener |
| 🗜️ **Context compression** | Hybrid compression with rolling summary + recent-window retention, automatic trimming of oversized tool output, executed against the model's context-window budget |
| 🛠️ **Built-in tools** | 22 built-in tools: files, search, Shell, Web, plan mode, tasks, permission requests, and more |
| 🎯 **Skills** | Optional/discoverable skills with lightweight selection based on request hints, including built-in docx / pdf / pptx / xlsx / skill-creator |
| 🔌 **MCP** | Model Context Protocol client that hooks into external tool servers |
| ⏰ **Workflows & schedules** | Declarative workflow loading + a cron-style schedule trigger engine |
| 🌐 **HTTP / WebSocket / SSE** | Actix server, REST API, shared /v2/stream WebSocket, legacy SSE feeds, and OpenAI / Anthropic / Gemini-compatible endpoints |
| 🏗️ **Multi-provider** | anthropic (default), openai, gemini, copilot, bodhi routing |
---
Configure a provider + API key without hand-editing JSON:
```bash
bamboo doctor
cargo run --bin bamboo -- serve
cargo install --path . bamboo serve ```
Arguments supported by bamboo serve (all override the config file): --port, --bind, --data-dir, --static-dir, --workers (plus --parent-pid, a sidecar orphan-guard: the process exits when that PID goes away).
Normal Bamboo builds require the staged frontend package owned by crates/app/bamboo-server/frontend_package. The build validates the sidecar manifest, the matching manifest inside the zip, portable archive paths and payload integrity, the index.html entry, and the manifest hash shape. Missing or invalid assets stop the build with an actionable staging instruction instead of silently producing an API-only server. Refresh the committed package explicitly with:
node scripts/frontend-package.cjs stage
Cargo never runs that staging command implicitly. This removes the previous ignored child-process status: explicit local and GitHub Actions callers receive the stager's nonzero exit status before build.rs validates the resulting crate-owned bytes.
An intentionally frontend-free binary remains available for infrastructure that supplies only Bamboo APIs. Select it at build time (never as an implicit fallback):
BAMBOO_FRONTEND_BUILD_MODE=api-only cargo build --bin bamboo
PowerShell:
$env:BAMBOO_FRONTEND_BUILD_MODE = "api-only"
cargo build --bin bamboo
That setting disables only the compiled-in package. Existing runtime frontend discovery remains unchanged: --static-dir, BAMBOO_FRONTEND_PACKAGE, or a legacy package candidate beside the working directory/executable can still provide a frontend.
Other subcommands (bamboo --help / bamboo <cmd> --help for the full list):
| Command | What it does |
|---|---|
bamboo serve | Start the HTTP/WebSocket/SSE server (above). |
bamboo tui | Full-screen terminal client (chat, sessions, MCP, schedules, skills, config) over a running server; offers to auto-start a local one when unreachable (--auto-serve/--no-auto-serve). |
bamboo init | First-run setup: write config.json with a provider + API key (interactive, or --non-interactive for CI). |
bamboo doctor | Diagnose the install (config present, provider keyed, server reachable); exits non-zero on a blocking problem. |
bamboo config [--path] [--show-secrets] | Inspect the resolved configuration. |
bamboo config set <key> <value> | Set one value by dotted key. Secret-aware keys (providers.<p>.api_key, provider_instances.<id>.api_key, notifications.ntfy.token, notifications.bark.device_key) are stored encrypted at rest; every other key is a generic validated dot-path (e.g. server.port 9563, tools.disabled '["Bash"]') — JSON values are parsed as JSON, unknown keys / type mismatches are rejected before writing. --dry-run previews the diff. |
bamboo -p "<prompt>" | One-shot **headless** agent run (boots the full runtime incl. sub-agents, prints the result, exits). Use -p - to read the prompt from stdin. Optional -s <session> to continue, -m provider:model **or** a bare -m <model> (bound to --provider, else the configured default provider) to pin the model, --provider <name> to select a provider, --reasoning-effort <low\|medium\|high\|xhigh>, --skill-mode <mode>, --workspace, --data-dir, --stream-json (NDJSON on stdout), --echo (keyless transport smoke). |
bamboo completions <shell> | Print a shell completion script (bash/zsh/fish/powershell/elvish), e.g. bamboo completions zsh > ~/.zfunc/_bamboo. |
bamboo actor run\|serve\|list\|call | Drive the sub-agent actor fabric from the terminal (spawn + stream, run as a service, discover, or send a task). |
bamboo broker serve | Run the standalone sub-agent message broker (WebSocket bus over durable mailboxes). |
bamboo broker-agent serve | Run a broker-connected agent (local / Docker / remote) that answers Ask/Task for its mailbox. |
bamboo health | Probe a running server's /health (exit non-zero if unreachable/unhealthy — usable as a readiness check). |
bamboo status | One-screen overview of a running server: address, health, session counts. |
bamboo sessions | List sessions on a running server (stop one with bamboo stop <id>). |
bamboo stop <session_id> | Stop a running session's agent loop. |
bamboo history <session_id> | Print a session's message transcript from a running server (review a headless -p run's log); reports the true message total and notes when cold history is capped. |
bamboo respond <session_id> [<answer>\|--pending] | Answer a session's pending question / permission gate out-of-band — the run resumes server-side (e.g. unblock a headless or scheduled run). --pending [--json] prints the waiting question and its options instead. |
bamboo session show\|delete <id> | Per-session lifecycle: show [--json] prints one session's detail (model, status, pending question, placement…); delete removes it (confirms unless --yes; running descendants are cancelled first). |
bamboo schedules list\|show\|create\|delete\|run\|runs | Manage schedules (timed tasks) on a running server: list/inspect, create (--cron/--every/--daily + --prompt, or a raw --json <file\|-> payload), delete (confirms unless --yes), trigger now, and view run history. |
bamboo skills list | List the skills the agent would load from <data_dir>/skills (offline; no server needed). |
bamboo mcp list | List the MCP servers configured in config.json (offline; no server needed). |
bamboo mcp status\|connect\|disconnect\|refresh\|tools\|add\|remove | Manage MCP servers on a running instance over /api/v1/mcp: live connection state + tool counts (status [--json]), enable/connect + disable/disconnect a server, re-list tools (refresh [<id>]), inspect tools (tools [<id>] [--json]), add from a raw JSON payload (add --json <file\|->), and delete (remove <id>, confirms unless --yes; a removed server can be re-added with add). |
TUI bindings are context-aware and configurable with --keymap; see TUI keybindings for the JSON schema, safety rules, and terminal fallbacks.
The admin commands (health / status / sessions / stop / history / respond / session / schedules) are thin HTTP clients over a running bamboo serve; point them at a non-default server with --server-url / --port / --data-dir. The read commands (skills list / mcp list) work offline against --data-dir (default ~/.bamboo); the other mcp verbs are server-backed and take the same connection flags. (bamboo subagent-worker also exists but is an internal worker process spawned by the server — not for interactive use.)
A global --log-level <error|warn|info|debug|trace> sets the default log level for any command when RUST_LOG is unset (RUST_LOG still wins when present). bamboo serve defaults to info in every build profile. Embedded debug builds keep debug on stdout while date-rotated files default to info; at startup, strictly matching historical files are retained by both count and a 128 MiB total byte budget. Daily rotation continues during long-running processes, and startup limits are enforced again on the next process start. Use --log-level debug, -v, or RUST_LOG to opt into more detail; target-specific directives such as RUST_LOG=h2=debug override the dependency-noise defaults while leaving each sink's root default unchanged.
Defaults (verified against code):
http://127.0.0.1:9562/api/v1 (port defaults to 9562, bind defaults to 127.0.0.1)GET /api/v1/healthBAMBOO_DATA_DIR or ${HOME}/.bambooanthropicSearch-index upgrade: Before upgrading session_search.db from schema 3 to 4, stop all older Bamboo servers, workers, and embedded writers that share the data directory. Startup migrates this derived search cache in one atomic transaction; a failed migration preserves the previous schema and cache contents. Running old and new writers together during a rolling upgrade is unsupported because older writers can reset the schema version and do not preserve the new search row identities. Canonical session data is unchanged; do not delete it to perform or recover this upgrade.
cd docker && docker compose up -d --build
curl http://localhost:9562/api/v1/health
docker-compose.yml publishes to the host loopback only (127.0.0.1:9562:9562), runs as a non-root user, drops all capabilities, and uses an isolated named volume. Do not widen the publish to expose the agent directly on a network: a fresh instance is unauthenticated, and the server treats every private-LAN (RFC1918) peer as trusted-local and skips the password check by design — so LAN exposure is unauthenticated even after you set a password. To reach it from other machines, keep the loopback publish and front it with an authenticating reverse proxy on a trusted network. It also sets BAMBOO_DATA_DIR=/data, BAMBOO_PORT=9562, BAMBOO_BIND=0.0.0.0 (in-container bind; exposure is controlled at the publish layer).
Building Bamboo from source requires Rust 1.95 or newer.
curl -N "http://127.0.0.1:9562/api/v1/events/$SID" ```
On POST /api/v1/chat, message and model are the only required fields; useful optionals are session_id (continue a conversation), system_prompt, selected_skill_ids, workspace_path, provider, images. Note that chat only persists the turn — you must then POST /api/v1/execute/{session_id} to actually run the loop. Besides the per-session GET /api/v1/events/{session_id} feed, there is an account-wide, resumable change feed GET /api/v1/stream (SSE, resumable via ?since=<seq> or the Last-Event-ID header) that streams events across all sessions — handy for multi-session sync.
POST /api/v1/chat and POST /api/v1/execute/{session_id} accept an optional Idempotency-Key header. Bamboo keeps up to 1,024 completed responses in memory for 10 minutes: an equivalent retry replays the first response without duplicating the message or run, while the same key with a different payload returns 409. Keys are scoped independently to chat and execute, and a server restart clears these short-lived receipts. POST /api/v1/sessions has a separate durable recovery contract documented in docs/session-create-idempotency.md.
The easiest way to create this is bamboo init (see First-run setup), which writes it for you and encrypts the key. The equivalent file at ${HOME}/.bamboo/config.json:
{
"provider": "anthropic",
"server": {
"port": 9562,
"bind": "127.0.0.1"
},
"providers": {
"anthropic": {
"api_key": "sk-ant-...",
"model": "claude-sonnet-4-6"
}
}
}
Config precedence: file < environment variables < CLI arguments. Environment variables includeBAMBOO_DATA_DIR,BAMBOO_PORT,BAMBOO_BIND,BAMBOO_PROVIDER,BAMBOO_WORKERS,BAMBOO_CORS_ALLOW_ORIGINS, and per-provider keysBAMBOO_OPENAI_API_KEY/BAMBOO_ANTHROPIC_API_KEY/BAMBOO_GEMINI_API_KEY(supplied at runtime, never persisted to disk — for Docker/CI/secret-manager deploys without a plaintext key inconfig.json). This is a minimal example. For every key (multi-provider instances, MCP servers, memory/auto-dream/gardener, sub-agents + theclaude_codeexecutor, the IMconnectbridge,plugin_trust, notifications, keyword masking, and the full env var list), seedocs/config-reference.md.
EXECUTE_KEY=$(uuidgen) curl -s -X POST "http://127.0.0.1:9562/api/v1/execute/$SID" \ -H 'Content-Type: application/json' \ -H "Idempotency-Key: $EXECUTE_KEY" \ -d '{}'
bamboo init
CHAT_KEY=$(uuidgen) SID=$(curl -s http://127.0.0.1:9562/api/v1/chat \ -H 'Content-Type: application/json' \ -H "Idempotency-Key: $CHAT_KEY" \ -d '{"message":"List the files here and tell me what this project does.","model":"claude-sonnet-4-6"}' \ | jq -r .session_id)
No server needed — the same agent loop runs in-process. The bamboo_sdk crate is an ergonomic facade over the engine: you supply a model and an instruction, .with_defaults_for_data_dir wires the eight runtime dependencies (storage, persistence, attachment reader, skills, metrics, config, provider, default tools) from ~/.bamboo, and then agent.run(&mut session, input) drives one turn (draining events internally) while agent.run_stream(session, input) streams AgentEvents back over an mpsc channel. To interrupt a streaming run, use run_stream_cancellable(...) which also returns a CancellationToken (call .cancel() to stop the loop); run_with_cancel / run_session_with_cancel accept a caller-owned token for the non-streaming path. Select the provider ergonomically with .provider_name("openai") on the builder (a following .api_key(...) applies to it). Every call funnels into the engine's single canonical execution path — the facade never forks the loop. The ergonomic types live in bamboo_sdk::agent (Agent, AgentBuilder, ExecuteRequestBuilder, CancellationToken, plus re-exported AgentEvent, Session, …).
use bamboo_sdk::agent::{Agent, Session};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let home = dirs::home_dir().unwrap().join(".bamboo");
// Build the agent. One call assembles storage, persistence, skills,
// metrics, the provider (from ~/.bamboo/config.json), and the default
// built-in tool set — no manual dependency wiring.
let agent = Agent::builder()
.model("claude-sonnet-4-6")
.instruction("You are a helpful coding agent.")
.with_defaults_for_data_dir(home)
.await
.expect("wire runtime deps")
.build()
.expect("agent fully configured");
// Stream one turn: `run_stream` appends the user message, runs the loop on
// a background task, and hands back a receiver of AgentEvents.
let session = Session::new("demo-session", "claude-sonnet-4-6");
let mut rx = agent.run_stream(
session,
"List the files here and tell me what this project does.",
);
while let Some(event) = rx.recv().await {
println!("{event:?}"); // assistant text, tool calls, tool results, token usage, completion
}
Ok(())
}
Precondition:with_defaults_for_data_dirreads~/.bamboo/config.json(the same configbamboo serveuses) and needs the active provider configured with a non-emptyapi_key— otherwise provider creation returns an error (here surfaced by.expect). A fresh data dir with noconfig.jsondefaults toanthropicwith no key and will fail;copilotis the only provider that authenticates keyless (cached OAuth). Fix it withbamboo init(orbamboo config set providers.<p>.api_key …), or pass.api_key("sk-…")on the builder beforewith_defaults_for_data_dir.
Don't need the event stream?agent.run(&mut session, input).await?drives the turn to completion and leaves the answer as the last message onsession. For full control over per-request overrides (split fast/background/summarization models, skill selection, provider handles, …) build anExecuteRequestwithExecuteRequestBuilder(both re-exported frombamboo_sdk::agent) and callagent.execute(&mut session, req)— the same canonical engine pathrun/run_streamfunnel into.
Approval / clarification + resume. A run can pause mid-loop waiting for input — a conclusion_with_options clarification, or a gated tool call under a configured PermissionChecker — surfaced as AgentEvent::NeedClarification / ToolApprovalRequested. Resolve it with agent.answer(session_id, "Approve").await? (the in-process equivalent of the HTTP POST /sessions/{id}/respond endpoint — same use-case function under the hood, so behavior matches exactly), then continue with agent.resume_stream(outcome.session) / agent.resume(&mut session) — or do both in one call with agent.answer_and_resume_stream(session_id, "Approve").await?. AnswerOutcome also carries any plan-mode transition and the permission grants an approval implied (auto-applied to the builder's .permission_checker(...), if one was configured). When the approved question was a gated tool call, resuming also re-executes that tool for real — against the agent's own tool executor — and writes the genuine output back over the synthetic placeholder before the loop continues, matching the HTTP server's behavior exactly (no extra call needed). > > A separate mechanism, AgentEvent::ChildApprovalRequested, covers an out-of-process CHILD sub-agent's gated tool (only reachable if you've also wired the engine's actor/broker transport — with_defaults_for_data_dir does not). Answer those with agent.answer_child_approval(child_session_id, request_id, approved) instead of agent.answer.
Permission and tool policy. .permission_mode(PermissionMode::Plan | AcceptEdits | DontAsk | Default | BypassPermissions | Auto) installs Bamboo's standard permission stack. Auto emits no approval prompts while retaining explicit policy and platform denials; the typed BypassPermissions mode still honors forced confirmations. .permission_checker(custom) supplies a custom implementation. In contrast, the SDK-specific .bypass_permissions() shortcut explicitly selects its historical no-checker, fully ungated behavior; it is not equivalent to .permission_mode(PermissionMode::BypassPermissions). These three setters are last-call-wins even across with_defaults_for_data_dir(...).await?. Leaving .tools(...) unset exposes the assembled built-in (+ MCP) surface, while .tools([]) or .no_tools() intentionally creates a zero-tool agent; any explicit tool selection has final precedence over assembled or injected default executors. A fully injected .default_tools(...) executor owns its own permission behavior and is not wrapped by the SDK policy setters.
Session ergonomics. agent.new_session(id) creates a session from the explicit builder model or effective provider-config model, while agent.load_session(id), agent.list_sessions() (most-recently-updated first), agent.session_history(id), and agent.delete_session(id) cover the common persistence operations. agent.get_session(id) remains a compatibility alias for load_session. list_sessions needs the concrete session-index handle with_defaults_for_data_dir assembles.
MCP. .mcp_server(config) / .mcp_servers([...]) on the builder connect MCP servers (in with_defaults_for_data_dir) and merge their tools into the built-in tool surface via CompositeToolExecutor — each server's initialize instructions are folded into the tool guidance automatically.
Dependency override order. Explicit .provider(...), .config(...), and .default_tools(...) injections override defaults whether called before or after with_defaults_for_data_dir; an injected provider present before defaults also skips redundant config-driven provider creation. Explicit .tools(...) / .no_tools() remains the final tool-executor policy.
Typed errors. with_defaults_for_data_dir / build / answer / the session-ergonomics methods all return Result<_, SdkError> — a thiserror enum (ProviderInit, UnsupportedApiKeyProvider, ModelNotConfigured, StoreInit, SkillInit, McpServerStart, SessionNotFound, NoPendingQuestion, InvalidResponse, …) instead of a bare String, so callers can match on the failure kind. UnsupportedApiKeyProvider makes .api_key(...) on copilot/unknown providers fail explicitly instead of warning and continuing; ModelNotConfigured prevents new_session from fabricating an empty model. SdkError also wraps AgentError (#[from]) so it composes with run/run_stream's existing typed error in a function returning Result<_, SdkError>.
Add the facade crate as a dependency (path or git):
[dependencies]
bamboo-sdk = { git = "https://github.com/bigduu/Bamboo-agent" }
tokio = { version = "1", features = ["full"] }
dirs = "5"
anyhow = "1"
Prefer not to manage these dependencies yourself? Runbamboo serveand use the server APIs above — they drive the exact same loop. The full SDK type reference is the rustdoc at docs.rs/bamboo-agent (the published crate re-exports the facade asbamboo_agent::agent);docs/guides/API.mdcovers the HTTP/WebSocket/SSE surface.
REST prefix /api/v1: chat, execute/{session_id}, stream, sessions, skills, tools, tools/execute, models, commands, workflows, metrics/*, mcp, servers, stop/{session_id}, health. The shared live transport is WebSocket /v2/stream; /api/v1/stream and /api/v1/events/{session_id} remain the legacy SSE feeds. There are also provider-compatible endpoints: /openai/v1, /anthropic/v1, /gemini/v1beta, /v1/{chat/completions,responses,messages}.
bamboo-tools, 22 built-in, registered in executor.rs::register_builtin_tools): Bash, BashOutput, KillShell, Read, Write, Edit, NotebookEdit, Glob, Grep, GetFileInfo, Workspace, WebFetch, WebSearch, JsRepl, Task, Sleep, EnterPlanMode, ExitPlanMode, RequestPermissions, SessionNote, ConclusionWithOptions, and more. Tools come with usage guides injected at runtime, a permission/policy-aware execution path, and parallel execution support (parallel.rs).bamboo-server/src/workflow/loader.rs), exposed via /bamboo/workflows.bamboo-server/src/schedules/: manager, trigger_engine, session_factory, store).crates/infra/bamboo-mcp/: manager, protocol, transports, tool_index), managing external tool servers via the /mcp, /servers routes.---
高质量的AI工作流框架,值得关注
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,竹子AI代理 在Agent工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | Bamboo-agent |
| 原始描述 | 开源AI工作流:🚀 A Complete, Self-Contained AI Agent Backend Framework Built with Rust 🦀。⭐8 · Rust |
| Topics | AIRust工作流 |
| GitHub | https://github.com/bigduu/Bamboo-agent |
| License | MIT |
| 语言 | Rust |
收录时间:2026-06-05 · 更新时间:2026-06-05 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端