> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goguava.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Runner

> Serve multiple agents in a single process

`guava.Runner` lets you serve multiple agents in a single process. Each agent can be attached to any number of channels — phone, WebRTC, SIP, or outbound campaigns. Call `run()` to start everything and block until all channels exit.

<Tabs>
  <Tab title="Python">
    ```python run.py theme={null}
    import os
    from guava import Agent, Runner

    agent_a = Agent(name="Grace", purpose="You are a helpful voice agent.")
    agent_b = Agent(name="Jordan", purpose="You are a helpful voice agent.")

    runner = Runner()
    runner.listen_phone(agent_a, os.environ["GUAVA_AGENT_NUMBER"])
    runner.listen_webrtc(agent_b)
    runner.run()
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript run.ts theme={null}
    import * as guava from "@guava-ai/guava-sdk";

    const agentA = new guava.Agent({ name: "Grace", purpose: "You are a helpful voice agent." });
    const agentB = new guava.Agent({ name: "Jordan", purpose: "You are a helpful voice agent." });

    const runner = new guava.Runner();
    runner.listenPhone(agentA, process.env.GUAVA_AGENT_NUMBER!);
    runner.listenWebrtc(agentB);
    await runner.run();
    ```
  </Tab>
</Tabs>

## Methods

<Tabs>
  <Tab title="Python">
    | Method | Returns | Description |
    | - | - | - |
    | `listen_phone(agent, agent_number)` | `Runner` | Register an agent to receive inbound calls on the given phone number. Returns self for chaining. |
    | `listen_webrtc(agent, webrtc_code?)` | `Runner` | Register an agent to accept WebRTC connections. A new code is generated if the code is omitted. Returns self for chaining. |
    | `listen_sip(agent, sip_code)` | `Runner` | Register an agent to receive inbound SIP calls on the given SIP code. Returns self for chaining. |
    | `attach_campaign(agent, campaign)` | `Runner` | Attach an outbound campaign to an agent. Returns self for chaining. |
    | `run()` | `None` | Start all registered channels and block until they all exit. |
  </Tab>

  <Tab title="TypeScript">
    | Method | Returns | Description |
    | - | - | - |
    | `listenPhone(agent, agentNumber)` | `Runner` | Register an agent to receive inbound calls on the given phone number. Returns self for chaining. |
    | `listenWebrtc(agent, webrtcCode?)` | `Runner` | Register an agent to accept WebRTC connections. A new code is generated if the code is omitted. Returns self for chaining. |
    | `listenSip(agent, sipCode)` | `Runner` | Register an agent to receive inbound SIP calls on the given SIP code. Returns self for chaining. |
    | `attachCampaign(agent, campaignCode)` | `Runner` | Attach an outbound campaign to an agent. Returns self for chaining. |
    | `run()` | `Promise<void>` | Start all registered channels and block until they all exit. |
  </Tab>
</Tabs>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.