# Function signatures:
def merge_state(
    *,
    state: dict,
    messages: List[BaseMessage],
    actions: List[Any],
    agent_name: str
):
    # ...implementation...

def convert_messages(messages: List[Message]):
    # ...implementation...
```

### [Parameters](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent\#parameters-1)

merge\_stateCallablerequired

This function lets you customize how CopilotKit merges the agent state.

convert\_messagesCallablerequired

Use this function to customize how CopilotKit converts its messages to LangChain messages.\`

[Previous\\
\\
Remote Endpoints](https://docs.copilotkit.ai/reference/sdk/python/RemoteEndpoints) [Next\\
\\
LangGraph SDK](https://docs.copilotkit.ai/reference/sdk/python/LangGraph)

### On this page

[LangGraphAgent](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent#langgraphagent) [Examples](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent#examples) [Parameters](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent#parameters) [CopilotKitConfig](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent#copilotkitconfig) [Parameters](https://docs.copilotkit.ai/reference/sdk/python/LangGraphAgent#parameters-1)

[Edit on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/docs/content/docs/reference/sdk/python/LangGraphAgent.mdx)

![](https://static.scarf.sh/a.png?x-pxid=ffc9f65d-0186-4575-b065-61d62ea9d7d3)

## CopilotKit Guardrails Guide
CrewAI CrewAI support is here! Checkout the [Crew](https://docs.copilotkit.ai/crewai-crews) and [Flow](https://docs.copilotkit.ai/crewai-flows) documentation.

Search docs

`⌘`  `K`

On this pageIntroduction