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

# Service Mode

> Receive Channel jobs through an outbound SDK connection.

Service mode lets an external Agent process requests from GroundForge Channels. The Agent opens an outbound authenticated connection, so your application does not need a public inbound endpoint.

```python theme={null}
init_groundforge(
    agent=agent,
    endpoint="https://platform.groundforge.ai",
    api_key=os.environ["GROUNDFORGE_API_KEY"],
    agent_id=os.environ["GROUNDFORGE_AGENT_ID"],
    tenant_id=os.environ["GROUNDFORGE_TENANT_ID"],
    workspace_id=os.environ["GROUNDFORGE_WORKSPACE_ID"],
    params={"channelInputMode": "auto"},
    serve=True,
)
```

The process then:

1. authenticates as the external Agent;
2. registers the Agent and its current tools;
3. opens the job connection;
4. receives requests for attached Channels;
5. converts the Channel message into Agent input;
6. invokes the Agent;
7. returns the result for Channel delivery;
8. sends Trace spans and completion status.

Keep the process running while Channels are active. The SDK reconnects after recoverable connection failures.

Verify that the Agent appears in the correct Workspace, discovery lists the expected tools, a Channel request is claimed, one Trace is created, and the response is delivered.

See [Inputs](/sdk/inputs) when the Agent expects a custom input shape.

## Example

Run [LangChain Agent Example](/examples/langchain-agent) with `serve=True`, attach a Channel, and keep the Python process running while you send the test request.


## Related topics

- [Python SDK](/sdk/overview.md)
- [Configuration](/sdk/configuration.md)
- [Supported Features](/features.md)
- [Connect a LangChain Agent](/sdk/langchain.md)
