CoAgents (Early Access)
Advanced Usage
Exit Agent

Exit Agent

To exit the agent, call copilotkit_exit This will exit the agent session as soon as the current LangGraph run is finished (either by a breakpoint or by reaching the END node)

copilotkit_exit(config)

Exiting the agent has different effects in router-mode and in agent-mode:

  • In router-mode, exiting agent mode hands off input handling back to the router (which can initiate chat, call actions, other agents, etc.).
  • In agent mode, exiting the agent restarts the agent loop.

© Tawkit, Inc. All rights reserved.