Skip to main content
An assistant is a configured instance of a LangGraph graph. While graphs define the agent logic, assistants let you create multiple configurations of the same graph with different names, metadata, and settings.

Default assistants

When the server starts, Aegra automatically creates a default assistant for each graph defined in aegra.json. Aegra accepts the graph ID directly in run and cron APIs and resolves it to that default assistant for you, so you can use graph IDs without creating assistants manually.
This automatically creates a default assistant for the agent graph that run and cron APIs can target immediately by passing assistant_id="agent".

Creating assistants

Create custom assistants with specific configurations:

Idempotent creation

Use if_exists to avoid errors when the assistant already exists:
An assistant has two uniqueness keys: its assistant_id, which is unique across every user, and its graph_id plus config pair, which is unique per owner. Either match counts as “already exists”, so a second create with the same graph and config returns the first assistant rather than a duplicate. Creation is atomic, so callers racing on the same assistant_id — retries, replays, several replicas booting at once — all converge on one stored assistant instead of one of them failing. With the default if_exists="error", a duplicate answers 409. An assistant_id already taken by another user also answers 409: it is never returned to you, even with if_exists="do_nothing".
The snippets below assume you are inside an async def function with an initialized client — see the example above.

Listing and searching

Updating assistants

Versioning

Assistants are versioned. Each update creates a new version while preserving the history:

Graph schemas

Retrieve the input, output, state, and config schemas for an assistant’s graph:

Graph visualization

Get the graph structure for visualization:
The response includes nodes and edges that can be rendered by LangGraph Studio or custom visualizers.

Subgraphs

If your graph uses subgraphs, you can inspect them:

Deleting assistants

When authentication is enabled, you can restrict deletion to admin users using authorization handlers. See the authentication guide.