Skip to main content

Overview

Managed Agents is Bailian's managed agent runtime for session state, sandbox environments, and tool execution.

Use Cases

Agents autonomously execute commands, read and write files, install dependencies, and process data within isolated sandboxes. Event history is persisted on the server.Sandboxes are reclaimed after the session becomes idle by default. To retain working files and environment changes across runs, enable sandbox persistence when creating a session.

Long-running tasks and stateful sessions

Tasks involving multi-step tool calls can last minutes to hours, with context and filesystem state maintained across multiple interaction rounds.

Code execution and file processing

Run scripts, install dependencies, and debug programs inside the sandbox. Read, write, search, and edit files within the sandbox.

Rapid development and low operational overhead

Focus on agent logic instead of building and maintaining infrastructure like agent loops, sandbox orchestration, or tool execution systems from scratch.

Difference from Agent Applications

DimensionAgent ApplicationsManaged Agents
Execution ModeStateless invocation; context maintained on the application sideSession state maintained on the server side; supports interruption and resumption
Execution EnvironmentShared runtimeIsolated sandbox — cloud-based container
Event ModelResponse-level streaming outputSession-level SSE event stream; event history persisted
Typical Use CasesQ&A, chat, lightweight tasksLong-running tasks such as multi-step tool calls, code execution, and file processing

Core Concepts

ConceptDescription
AgentA configuration combining model, system prompt, tools, MCP services, and Skills. Once created, it is referenced by ID and can be reused across multiple sessions.
EnvironmentSandbox configuration for session execution — a cloud-based container hosted by Bailian.
SessionA single execution instance of an agent within a specified environment, performing tasks and generating outputs.
EventMessages exchanged between the application and the agent, including user messages, tool call results, and state changes.
Memory StoreA persistent mounted resource that the agent reads and writes with file tools; its content persists across sessions.
Scheduled taskA resource that binds an agent to a trigger configuration — scheduled or manual — with each trigger producing a run record.

Supported Tools

Agents interact with the execution environment via the following tools:
  • Command Execution: Run shell commands inside the sandbox
  • File Operations: Upload files to mount into the sandbox or download from URLs; supports reading, writing, editing, finding, and searching
  • Memory: Mount memory stores and read/write working notes across sessions
  • MCP Services: Integrate external tooling services
  • Skills: Mount preconfigured tool combinations that encapsulate end-to-end task workflows

Workflow

  1. Create an Agent: Configure model, system prompt, tools, and MCP services. After creation, reference it by ID.
  2. Configure the Execution Environment: Create a cloud-based container sandbox and optionally configure pre-installed packages.
  3. Initiate a Session: Create a session instance referencing both the agent and environment configuration.
  4. Send Events and Receive Responses: Send user messages; the agent autonomously executes tool calls and pushes results via an SSE event stream. Event history is persisted on the server.
  5. Intervene or Interrupt: Send new events during execution to guide direction, or interrupt the current task.

Configuration and API reference