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

# Spaces

> Supervisor agents that coordinate multiple specialised agents in one conversation

## What is a Space?

A **Space** is a supervisor agent that coordinates a fleet of specialised agents within a single conversation. Instead of asking users to figure out which agent to talk to, a Space acts as the orchestrator: it reasons about the task, decides which supervised agent (or combination of agents) is best placed to handle it, delegates the work, and synthesises a coherent response back to the user.

<Card title="Think of it as:" icon="diagram-project">
  A team lead for your agents — one conversation that knows when to bring in the weather expert, the bookings expert, or the support expert, and stitches their answers together.
</Card>

<Note>
  Spaces solve **agent sprawl** — the common situation where an organisation builds many capable, specialised agents but has no single, coherent way for users to reach them. A Space gives users one entry point and handles the routing behind the scenes.
</Note>

## Why use a Space?

<CardGroup cols={2}>
  <Card title="One conversation" icon="comments">
    Users talk to a single assistant instead of hopping between separate agents.
  </Card>

  <Card title="Smart delegation" icon="route">
    The Space picks the right specialist — or several in parallel — for each request.
  </Card>

  <Card title="Coherent answers" icon="layer-group">
    Responses from multiple agents are synthesised into one clear reply.
  </Card>

  <Card title="Full visibility" icon="eye">
    See which agents were consulted, in what order, and how long each step took.
  </Card>
</CardGroup>

## How a Space works

```
User Message
    ↓
Space (supervisor agent)
    ↓  reasons about the task
Delegates to one or more supervised agents
    ↓
Weather-agent   news-agent   Travel Bookings
    ↓
Space synthesises a single coherent response
    ↓
Response to User
```

When a user asks, *"I want to travel to London next week, can you give me an indication of the weather and who I can fly with?"*, the Space consults the **Weather-agent** for the forecast and the **Travel Bookings** agent for flights, then combines the results into one answer. Each delegation is shown inline (e.g. *"Consulting Weather-agent…"*) so the decision chain is transparent.

<Frame>
  <img src="https://mintcdn.com/luaglobal/mQ4OFMSS7QGypa2Z/images/spaces/space-delegation.png?fit=max&auto=format&n=mQ4OFMSS7QGypa2Z&q=85&s=6b12bc475b92cff68f81741a5b31396f" alt="A Space delegating a travel request to its Weather-agent" width="3020" height="1570" data-path="images/spaces/space-delegation.png" />
</Frame>

## Where to find Spaces

Spaces live in the **left-hand navigation of the admin dashboard**. Select **Spaces** to see an overview of every Space in your organisation, the agents each one coordinates, and a **Create Space** button.

<Frame>
  <img src="https://mintcdn.com/luaglobal/mQ4OFMSS7QGypa2Z/images/spaces/spaces-overview.png?fit=max&auto=format&n=mQ4OFMSS7QGypa2Z&q=85&s=4f9fd8fa777b3b687947c9aa93ffa369" alt="Spaces overview in the admin dashboard" width="3022" height="1544" data-path="images/spaces/spaces-overview.png" />
</Frame>

## Creating a Space

<Steps>
  <Step title="Open Spaces and click Create Space">
    From the admin dashboard, select **Spaces** in the left-hand navigation, then click **Create Space** in the top right.

    <Frame>
      <img src="https://mintcdn.com/luaglobal/mQ4OFMSS7QGypa2Z/images/spaces/create-space-modal.png?fit=max&auto=format&n=mQ4OFMSS7QGypa2Z&q=85&s=2499e433a9f54561fcca67905d4e45f8" alt="The Create a Space dialog" width="3024" height="1560" data-path="images/spaces/create-space-modal.png" />
    </Frame>
  </Step>

  <Step title="Name your Space">
    Give the Space a clear display name, e.g. *My Business Assistant* or *Travel space*. This is what appears in the sidebar and at the top of the chat.
  </Step>

  <Step title="Describe the persona">
    Describe how the Space should behave and coordinate its agents. For example:

    > You are a supervisor that coordinates a shopping agent and a support agent. Delegate shopping queries to the Shopify agent and support queries to the support agent.

    The platform uses this persona, together with each agent's capabilities, to generate orchestration instructions automatically.
  </Step>

  <Step title="Select the agents to supervise">
    Choose which agents this Space can delegate to. Search for agents and tick the ones you want to include. This step is optional — you can add or remove supervised agents later.

    <Note>
      As you add agents, the Space **automatically enriches its own persona** based on each agent's capabilities. It becomes aware of the new abilities it has gained — and knows when to delegate to them — without you having to describe each agent by hand. Add or remove a supervised agent later and the Space's understanding of what it can do updates to match.
    </Note>
  </Step>

  <Step title="Create the Space">
    Click **Create Space**. The Space is created and ready to chat with immediately.
  </Step>
</Steps>

## Managing a Space

Open a Space to chat with it and manage its configuration. The Space view is organised into tabs:

<Frame>
  <img src="https://mintcdn.com/luaglobal/mQ4OFMSS7QGypa2Z/images/spaces/space-chat-overview.png?fit=max&auto=format&n=mQ4OFMSS7QGypa2Z&q=85&s=e7b64ef7d85aa88ddf3d4fe07a550e1f" alt="Chatting with a Space and viewing its overview" width="3024" height="1568" data-path="images/spaces/space-chat-overview.png" />
</Frame>

<CardGroup cols={2}>
  <Card title="Overview" icon="circle-info">
    Edit the Space name and persona, and see the supervised agents at a glance.
  </Card>

  <Card title="Agents" icon="users">
    Manage which agents the Space coordinates and delegates to.
  </Card>

  <Card title="Personality" icon="masks-theater">
    Refine how the Space behaves and orchestrates its agents.
  </Card>

  <Card title="Connections" icon="plug">
    Connect the Space to channels and embed it where your users are.
  </Card>

  <Card title="Logs" icon="list-check">
    Review conversations, track delegations, and inspect the full decision chain.
  </Card>
</CardGroup>

## Deploying a Space

A Space is deployed like any other agent. From the **Connections** tab you can:

* Embed the Space on your website with the chat widget
* Connect it to messaging channels such as WhatsApp or Slack
* Integrate via the HTTP API
* Offer it as a voice experience

Because the Space is the single front door to your specialists, your users get one consistent assistant across every channel — voice, text, or embedded web.

## A Space is an agent

At its core, a Space **is an agent**. Anywhere the platform accepts an `agentId`, you can pass a **Space ID** instead and it behaves like any other agent — with delegation handled for you behind the scenes.

### Finding your Space ID

Open the Space's detail page. The Space ID is the last segment of the URL, after `/spaces/`:

```
https://admin.heylua.ai/admin/spaces/<your-space-id>
```

For example, if the URL is `.../admin/spaces/space_1234567890123_ab1cd2e`, then your Space ID is `space_1234567890123_ab1cd2e`.

### Use it anywhere an agentId is accepted

<CardGroup cols={2}>
  <Card title="HTTP API" icon="code">
    Pass the Space ID as the `agentId` parameter on any endpoint that takes one — including the streaming chat request.
  </Card>

  <Card title="Lua Pop" icon="window-restore">
    Use the Space identifier as the `agentId` to embed your Space.
  </Card>

  <Card title="Chat widget & channels" icon="comments">
    Connect and embed the Space exactly as you would a single agent.
  </Card>

  <Card title="Agent chat page" icon="flask">
    Quickly test your Space by passing its ID as the `agentId`.
  </Card>
</CardGroup>

### Test it on the agent chat page

The fastest way to try a Space is the agent chat page — just use the Space ID as the `agentId`:

```
https://heylua.ai/agent?agentId=<your-space-id>
```

<Note>
  Spaces are **coming soon to the `lua` CLI**. For now, create and manage Spaces in the [admin dashboard](https://admin.heylua.ai/admin/spaces), and use the Space ID wherever an `agentId` is accepted.
</Note>

## Use cases

<CardGroup cols={2}>
  <Card title="Travel" icon="plane">
    Weather, advisories, and bookings coordinated in one conversation.
  </Card>

  <Card title="E-commerce" icon="cart-shopping">
    Order tracking, returns, and product recommendations together.
  </Card>

  <Card title="Financial services" icon="chart-line">
    Market data, news, portfolio analysis, and compliance screening.
  </Card>

  <Card title="Healthcare" icon="stethoscope">
    Appointments, symptom triage, insurance, and follow-up coordination.
  </Card>
</CardGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Agent Concept" icon="robot" href="/overview/agent">
    Learn how to build the specialised agents a Space coordinates.
  </Card>

  <Card title="Persona Concept" icon="masks-theater" href="/overview/persona">
    Write effective personas for your Space and its agents.
  </Card>

  <Card title="Channels" icon="tower-broadcast" href="/overview/channels">
    Connect your Space to where your users already are.
  </Card>

  <Card title="Read the announcement" icon="newspaper" href="https://blog.heylua.ai/introducing-spaces-one-conversation-many-experts/">
    Introducing Spaces — one conversation, many experts.
  </Card>
</CardGroup>
