Skip to content

connect

relationalai.client
connect(
*,
config: "Config | None" = None,
connection_name: str | None = None,
token: str | None = None
) -> Client

Async-first entrypoint returning a Client.

Use this from async code (you can await it). The returned Client:

  • exposes async lifecycle (await client.aclose() / async with ...)
  • exposes async service clients (e.g. client.reasoners -> ReasonersClient)

Transport creation is lazy: no network calls are made by connect(...) itself. Transports are created on first use (SQL/HTTP/services).

If you are in synchronous code, prefer connect_sync() which returns ClientSync.

  • config

    (‘Config | None’, default: None) - Optional config to use. When omitted, a default config is loaded.
  • connection_name

    (str | None, default: None) - Optional named connection to use from the config.
  • token

    (str | None, default: None) - Optional RAI token override.
  • Client - An async-first root client. Use async with await connect(...) as client: or client = await connect(...); await client.aclose().