Skip to main content

Crate marbots_sdk

Crate marbots_sdk 

Source
Expand description

Typed Rust SDK for Marbots, the multi-agent collaboration platform. Synchronous (no async runtime required); from async code, call it inside spawn_blocking. Kernel packs, permission profiles, task states, event types and model settings are enums/helpers, so typos are compile errors.

Built by Gravicode Studios, led by Kang Fadhil.

use marbots_sdk::{BotSpec, Client, EventType, KernelPack, ModelRef, PermissionProfile};

let mb = Client::new("http://localhost:5170");
// Every bot can run on its own model; ModelRef::DEFAULT follows the workspace default.
let sari = mb.bots().create(
    BotSpec::new("Sari")
        .role("UX designer")
        .kernel_functions([KernelPack::Files, KernelPack::Web])
        .permission_profile(PermissionProfile::WorkspaceWrite)
        .model(ModelRef::of("azure", "gpt-5.6-luna")),
)?;
mb.bots().set_model("atlas", ModelRef::DEFAULT)?;

let thread = mb.threads().create(&sari.id, None)?;
let result = mb.threads().send(&thread.id, "Sketch a wireframe", true)?;
println!("{:?}: {}", result.task.model, result.text());

for event in mb.events().stream(Some(&thread.id))? {
    let event = event?;
    if event.event_type == EventType::ToolCallStarted { println!("tool: {:?}", event.message); }
    if event.is_task_finished() { break; }
}

Structs§

AgentEvent
One item on the live event stream.
ApprovalRequest
A risky action waiting for (or resolved by) a human.
Approvals
Human-in-the-loop approvals.
Bot
A durable AI teammate.
BotModelInfo
A bot’s model setting and the model it actually runs on.
BotSpec
Options for creating or updating a bot.
BotTemplate
A ready-made bot role from the template gallery.
Bots
Bot management.
ChatMessage
One chat message.
ChatThread
A conversation with one bot.
Client
A synchronous client for a Marbots server. Cheap to clone; safe to share between threads.
EventStream
Iterator over live events.
Events
Live events (Server-Sent Events).
HostInfo
A machine that runs bots.
Mcp
MCP servers.
McpServer
An MCP server from the gallery.
Memory
Long-term memory.
MemoryRecord
A long-term memory.
ModelCatalog
The workspace default model, the choices and the profiles.
ModelProfileInfo
A named model profile.
ModelRef
Builds a bot’s model setting.
Models
Workspace default model and model choices.
ScheduleJob
A saved schedule.
ScheduleSpec
A recurring (cron) or one-off (run_at, ISO-8601) job.
Schedules
Cron and one-off jobs.
SendResult
Returned by threads().send(...); reply is set when the call waited for the bot.
SkillInfo
An installed SKILL.md package.
Skills
SKILL.md packages.
SystemInfo
Server information.
TaskRecord
A durable unit of work.
Tasks
Tasks.
Templates
Template gallery.
Threads
Conversations.
ToolCall
A tool invocation requested by a model.
WorkspaceFile
A file in a thread’s project workspace.

Enums§

ApprovalScope
How far an approval reaches.
ApprovalState
State of an approval request.
AutoLearnMode
Optional learning after tasks.
BotStatus
A bot’s lifecycle state.
Error
Errors returned by the SDK.
EventType
Types of events on the live stream. Types newer than this SDK deserialize as EventType::Unknown.
KernelPack
Built-in tool packs a bot can enable.
MemoryKind
Kind of long-term memory.
PermissionProfile
What a bot may do without asking.
TaskState
A task’s lifecycle state.

Constants§

BOSS_MAN
Id of the protected manager bot.

Type Aliases§

Result
SDK result type.