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

# Create Session • Rust AI Agent SDK

> create_session: Create a new session.

# create\_session

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**GatewayProtocol**](../classes/GatewayProtocol) class in the [**gateway**](../modules/gateway) module.

Create a new session.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def create_session(
        &mut self,
        agent_id: &str,
        client_id: Option<String>,
        session_id: Option<String>,
    ) -> Result<Box<dyn GatewaySessionProtocol>>
```

## Parameters

<ParamField query="agent_id" type="&str" required={true}>
  No description available.
</ParamField>

<ParamField query="client_id" type="Option<String>" required={true}>
  No description available.
</ParamField>

<ParamField query="session_id" type="Option<String>" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Result<Box<dyn GatewaySessionProtocol>>">
  The result of the operation.
</ResponseField>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Sessions" icon="clock" href="/docs/rust/sessions" />

  <Card title="Rust Memory" icon="database" href="/docs/rust/memory" />
</CardGroup>
