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

# Registry and serving

> Public registry and serving signatures and configuration in @agentium/core 4.0.0.

Import these **5 exports** from `@agentium/core`. Read the [registry and serving guide](/transport/overview) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## classifyServables

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/serve.ts)

```typescript theme={null}
/**
 * Classify an array of mixed Agent/Team/Workflow instances into
 * separate maps keyed by each instance's `.name` property.
 */
export declare function classifyServables(items: Servable[]): ClassifiedServables;
```

Related: [`Servable`](/api-reference/core/serve#servable), [`ServableAgent`](/api-reference/core/serve#servableagent), [`Team`](/api-reference/core/team#team), [`Workflow`](/api-reference/core/workflow#workflow).

## registry

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/serve.ts)

```typescript theme={null}
export declare const registry: Registry;
```

Related: [`Registry`](/api-reference/core/serve#registry).

## Registry

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/serve.ts)

````typescript theme={null}
/**
 * Live registry for Agents, Teams, and Workflows.
 *
 * Instances auto-register on construction (unless `register: false`).
 * Transport layers (Express, Socket.IO) read from the registry dynamically —
 * agents created after the gateway starts are immediately available.
 *
 * Names are labels, not unique keys: registering an item with an existing
 * name replaces the previous entry (last-write-wins). This allows the same
 * agent definition to be constructed repeatedly (loops, factories,
 * concurrent requests) without conflicts.
 *
 * @example
 * ```ts
 * createAgentGateway({ io, security: { mode: "local" } });
 *
 * new Agent({ name: "bot", model: openai("gpt-4o") });
 * // "bot" is immediately reachable via the gateway
 * ```
 */
export declare class Registry {
    readonly agents: Map<string, ServableAgent>;
    readonly teams: Map<string, Team>;
    readonly workflows: Map<string, Workflow<any>>;
    add(item: Servable): void;
    remove(item: Servable): boolean;
    getAgent(name: string): ServableAgent | undefined;
    getTeam(name: string): Team | undefined;
    getWorkflow(name: string): Workflow<any> | undefined;
    clear(): void;
    list(): {
        agents: string[];
        teams: string[];
        workflows: string[];
    };
    describeAgents(): Array<{
        name: string;
        model: string;
        provider: string;
        tools: string[];
        hasStructuredOutput: boolean;
        description?: string;
        capabilities: string[];
        version?: string;
    }>;
    getAgentCard(name: string): object | null;
    getAllAgentCards(): object[];
    describeTeams(): Array<{
        name: string;
    }>;
    describeWorkflows(): Array<{
        name: string;
    }>;
}
````

Related: [`Servable`](/api-reference/core/serve#servable), [`ServableAgent`](/api-reference/core/serve#servableagent), [`Team`](/api-reference/core/team#team), [`Workflow`](/api-reference/core/workflow#workflow).

## Servable

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/serve.ts)

```typescript theme={null}
export type Servable = Agent | ServableAgent | Team | Workflow<any>;
```

Related: [`Agent`](/api-reference/core/agent#agent), [`ServableAgent`](/api-reference/core/serve#servableagent), [`Team`](/api-reference/core/team#team), [`Workflow`](/api-reference/core/workflow#workflow).

## ServableAgent

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/serve.ts)

```typescript theme={null}
/**
 * The minimal contract an agent must satisfy to be served by Agentium's
 * runtime (registry, Express/Socket.IO gateways, queue workers, observability).
 *
 * The first-party `Agent` class satisfies this structurally, but so can any
 * external implementation — a LangGraph graph, a Claude Agent SDK agent, or
 * plain custom code. Use `defineExternalAgent()` for a convenient way to wrap
 * custom run logic into this shape.
 *
 * Optional metadata fields light up extra runtime features when present
 * (provider-specific API key routing, swagger docs, approval endpoints,
 * checkpoint endpoints, correction capture).
 */
export interface ServableAgent {
    readonly kind: "agent";
    readonly name: string;
    run(input: MessageContent, opts?: RunOpts): Promise<RunOutput>;
    stream(input: MessageContent, opts?: RunOpts): AsyncIterable<StreamChunk>;
    /** Event bus for observability (tracing, metrics, approval streams). */
    readonly eventBus?: EventBus;
    readonly modelId?: string;
    readonly providerId?: string;
    readonly tools?: ReadonlyArray<{
        name: string;
        description?: string;
    }>;
    readonly instructions?: unknown;
    readonly hasStructuredOutput?: boolean;
    readonly structuredOutputSchema?: unknown;
    /** MemoryManager (or compatible) — enables the corrections endpoint. */
    readonly memory?: unknown;
    /** HITL approval manager — enables the approval endpoints. */
    readonly approvalManager?: unknown;
    /** Checkpoint manager — enables the checkpoint endpoints. */
    readonly checkpointManager?: unknown;
}
```

Related: [`EventBus`](/api-reference/core/events#eventbus), [`MessageContent`](/api-reference/core/models#messagecontent), [`RunOpts`](/api-reference/core/agent#runopts), [`RunOutput`](/api-reference/core/agent#runoutput), [`StreamChunk`](/api-reference/core/models#streamchunk).

## Supporting types

These local shapes appear in public signatures but are not named exports of this entrypoint.

### ClassifiedServables

```typescript theme={null}
export interface ClassifiedServables {
    agents: Record<string, ServableAgent>;
    teams: Record<string, Team>;
    workflows: Record<string, Workflow<any>>;
}
```


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