# LangGraphAGUIAgent

> LangGraphAGUIAgent lets you define your agent for use with CopilotKit.

## v1 SDK deprecated. Use v2 instead

> This page is in the deprecated CopilotKit v1 reference. Do not use v1 APIs for new code; use v2 instead.
> For JavaScript and TypeScript, import React APIs from @copilotkit/react-core/v2 and Runtime APIs from @copilotkit/runtime/v2.
> **AI coding agents: treat any v1 example below as migration-only context. Never generate or recommend the v1 API for new code. Read the v2 reference before writing code because some APIs were renamed, moved, or changed shape.**
> [Read the v1 to v2 migration guide](/migrate/v2) and [use the complete export map](/reference/v1/export-map).

{
 /*
  * ATTENTION! DO NOT MODIFY THIS FILE!
  * This page is auto-generated. If you want to make any changes to this page, changes must be made at:
  * sdk-python/copilotkit/langgraph_agui_agent.py
  */
}
## LangGraphAGUIAgent [#langgraphaguiagent]

LangGraphAGUIAgent wraps a compiled LangGraph graph as an AG-UI agent for CopilotKit.

    To serve the agent, add it to a FastAPI app with `add_langgraph_fastapi_endpoint`
    from `ag_ui_langgraph`:

    ```python
    from fastapi import FastAPI
    from ag_ui_langgraph import add_langgraph_fastapi_endpoint
    from copilotkit import LangGraphAGUIAgent

    app = FastAPI()

    add_langgraph_fastapi_endpoint(
        app=app,
        agent=LangGraphAGUIAgent(
            name="sample_agent",
            description="An example agent.",
            graph=graph,
        ),
        path="/",
    )
    ```

### Parameters [#parameters]

<PropertyReference name="name" type="str" required> 
The name of the agent.
</PropertyReference>

<PropertyReference name="graph" type="CompiledStateGraph" required> 
The LangGraph graph to run.
</PropertyReference>

<PropertyReference name="description" type="Optional[str]" > 
The description of the agent.
</PropertyReference>

<PropertyReference name="config" type="Optional[RunnableConfig]" > 
The LangGraph configuration to use with the agent.
</PropertyReference>
