[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112791":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":37,"discoverSource":38},112791,"borg","joydle\u002Fborg","joydle","Supervised agent runtime for Rust: compose LLM calls into pipelines that cancel, isolate panics, retry, budget and resume.","https:\u002F\u002Fjoydle.github.io\u002Fborg\u002F",null,"Rust",109,6,57,2,0,5,30,48.04,"Apache License 2.0",false,"main",true,[25,26,27,28,29,30,31,32],"agent-runtime","ai-agents","llm","mcp","rust","supervisor","tokio","tracing","2026-11-17 21:25:56","2026-11-22 09:48:27","\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fjoydle.github.io\u002Fborg\u002F\">\n    \u003Cpicture>\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Flogo-dark.svg\">\n      \u003Cimg src=\"media\u002Flogo-light.svg\" alt=\"borg\" width=\"360\">\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjoydle\u002Fborg\u002Factions\u002Fworkflows\u002Fci.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fjoydle\u002Fborg\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg\" alt=\"CI\">\u003C\u002Fa>\n  \u003Ca href=\"#license\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT%20OR%20Apache--2.0-black.svg\" alt=\"License: MIT OR Apache-2.0\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-1.88+-black.svg\" alt=\"MSRV 1.88\">\n\u003C\u002Fp>\n\n**borg is a supervised agent runtime for Rust.** Compose LLM calls into\npipelines that cancel cleanly, isolate panics, retry what's retryable,\nstay inside a budget and resume after a crash.\n\n```toml\n[dependencies]\n# Not on crates.io (the `borg` name there is an unrelated crate).\nborg = { git = \"https:\u002F\u002Fgithub.com\u002Fjoydle\u002Fborg.git\", tag = \"v1.0.0\" }\nasync-trait = \"0.1\"  # the derive macros expand to #[async_trait]\n```\n\nRust 1.88+, Tokio.\n\n## One agent\n\n```rust\nuse borg::prelude::*;\n\n#[derive(BorgAgentDerive)]\n#[borg(id = \"reviewer\", model = \"anthropic\u002Fclaude-haiku-5-5\",\n       max_tokens = 800, system = \"Review code quality.\")]\nstruct Reviewer;\n\nimpl Reviewer {\n    fn user_prompt(&self, ctx: &AgentContext) -> Option\u003CString> {\n        ctx.handoff.get_as(\"code\")\n    }\n}\n\nlet suggestions: Vec\u003CSuggestion> =\n    run_one_typed(\"review\", Reviewer, ctx, handoff).await?;\n```\n\nborg ships no provider client: implement `AgentLlmClient` once for the\nAPI you use. The examples run on the built-in `FakeLlmClient`, so they\nneed no API key.\n\n## A pipeline\n\n```rust\nuse borg::prelude::*;\n\nlet pipeline = seq([\n    step(Planner),\n    par([step(Coder), step(TestWriter), step(DocWriter)]),\n    repeat(8, |v: &Verdict| v.token == \"PASS\", || seq([\n        step(Builder),\n        step(BuildFixer),\n    ])),\n    step(Reviewer),\n]);\n```\n\nPlan, fan out three workers, loop build→fix until `PASS` (at most 8\nrounds), review. Cancelling stops every nested agent and in-flight LLM\ncall; a panicking child doesn't take its siblings down.\n\n## What you get\n\n- **Composition primitives**: `Single`, `Sequential`, `Parallel`,\n  `Branch`, `Fallback`, `LoopUntil`, `Agent`, `FallbackLadder`,\n  `Heartbeat`, `Deferred`, written with the `dsl` builders or the\n  `pipeline!` macro.\n- **Supervision**: per-child cancel, panic isolation, restart with\n  backoff and jitter, restart-storm meltdown, sliding-window circuit\n  breaker, fallback ladders across models.\n- **Guardrails**: behavioral rules at every agent-loop boundary (loops,\n  repeated tool calls, text-only turns) with `Warn` \u002F `Throttle` \u002F\n  `Halt` verdicts.\n- **Budgets**: admission before every dispatch, sub-budgets,\n  cache-aware pricing.\n- **Tools and MCP**: object-safe `Tool` trait, derive macros, opt-in\n  parallel tool calls; any stdio MCP server becomes tools.\n- **Vision**: an agent can pass images on the same request as its\n  tools.\n- **Long-lived sessions** (`borg-loop`): a streaming actor is the\n  session's main loop. Each turn streams live, `run_session_loop` keeps\n  it going until it parks, and the session checkpoints and resumes\n  across restarts. Drop a turn mid-stream and the actor parks with its\n  snapshot. See the `streaming_session` example.\n- **Pause and resume**: an agent asks for a human decision, the run\n  suspends and persists, and it resumes later with the `Decision`\n  (approve, reject or edit). See the `human_in_the_loop` example.\n- **Checkpoints**: `execute_resumable` snapshots a run (each loop\n  iteration by default, or every step) to a `CheckpointStore`. After a\n  crash the same call skips finished work, and refuses a snapshot taken\n  from a differently shaped pipeline. Back the three-method store with\n  any database.\n- **Lifecycle**: streaming compositions, background work with\n  heartbeats.\n- **Observability**: a full `tracing` span tree (session → composition\n  → step → turn → tool) and JSONL event recording.\n- **Testing**: `FakeLlmClient`, `ScriptedAgent` and an eval harness\n  (feature `testing`).\n\n## Crates\n\n| Crate | |\n|---|---|\n| [`borg`](crates\u002Fborg) | Core runtime: compositions, supervisor, tools, checkpoints, streaming |\n| [`borg-macros`](crates\u002Fborg-macros) | Agent and tool derives, `#[borg_instrument]` (re-exported by `borg`) |\n| [`borg-loop`](crates\u002Fborg-loop) | Long-lived, resumable actor sessions |\n| [`borg-tracing`](crates\u002Fborg-tracing) | `tracing` span hierarchy for every borg event |\n| [`borg-mcp`](crates\u002Fborg-mcp) | MCP servers as borg tools |\n| [`borg-sandbox`](crates\u002Fborg-sandbox) | Subprocess tool behind a pluggable `SandboxBackend` |\n| [`borg-tools`](crates\u002Fborg-tools) | File-op tools and an approval helper |\n\n## Learn more\n\n- [Website](https:\u002F\u002Fjoydle.github.io\u002Fborg\u002F)\n- Examples, all runnable without an API key:\n  [`borg`](crates\u002Fborg\u002Fexamples) (`cargo run -p borg --example dogfood --features testing`)\n  and [`borg-loop`](crates\u002Fborg-loop\u002Fexamples) (`cargo run -p borg-loop --example streaming_session`)\n- API docs: `cargo doc --open -p borg`\n\nborg is installed from GitHub, not crates.io, where the `borg` name\nbelongs to an unrelated crate. Pin a release tag rather than tracking\n`main`.\n\n## Contributing\n\n```bash\ncargo fmt --all\ncargo clippy --workspace --all-targets --all-features -- -D warnings\ncargo test --workspace --all-features\n```\n\nMSRV is Rust 1.88. Open an issue before changing public API. Use\nconventional-commit PR titles (`feat:`, `fix:`, `feat!:`); release notes\nare generated from them. A release is a `vX.Y.Z` tag matching the\nworkspace version in `Cargo.toml`.\n\n## Security\n\nborg makes it easy to give a model subprocess and file access, so\nsandboxing is on you; see [SECURITY.md](SECURITY.md). Report\nvulnerabilities privately, not as issues.\n\n## License\n\nLicensed under either of [Apache-2.0](LICENSE-APACHE) or\n[MIT](LICENSE-MIT) at your option. Contributions are dual-licensed the\nsame way.\n","borg 是一个面向 Rust 的受监督智能体运行时，用于构建健壮、可组合的 LLM 驱动工作流。它提供管道式编排能力，支持取消传播、panic 隔离、带退避的自动重试、资源预算控制（如 token\u002F耗时）及崩溃后状态恢复；内置对 MCP 工具协议的支持，并通过 trait 抽象解耦 LLM 客户端实现。适用于需高可靠性与可观测性的生产级 AI Agent 场景，如自动化代码审查、多步骤内容生成、工具增强型对话系统等。","2026-11-24 04:44:08","CREATED_QUERY"]