What is supported
LangGraph 1.0 and later. Onecortex recognises a compiled graph: the result ofStateGraph(...).compile(), and anything that returns one, such as LangChain’s create_agent. An uncompiled StateGraph is not recognised.
A complete agent
agent.yml
requirements.txt
agent.py
OPENAI_API_KEY as a secret on the agent’s Config tab, then deploy. Any model works: this one is an example. See Configuration and secrets.
A complete LangGraph example
support-triage: A support graph with a tool node and a checkpointer, on the oldest supported LangGraph. It runs with no model key.The prompt and the reply
The prompt arrives as the graph’s input state,{"messages": [{"role": "user", "content": prompt}]}, so a graph on MessagesState works unchanged. The reply is the text of the last message. A graph whose state has no messages answers with its final state as text.
Events it reports
See Streaming and events.
The caller’s fields
Underconfig["configurable"]["onecortex"], in any node that takes a config argument:
thread_id is set from the session, so the same sessionId always reaches the same thread. Compile the graph with a checkpointer and it remembers the conversation for as long as the session’s instance runs. Onecortex does not add a checkpointer for you: for memory that outlasts an instance, compile with one backed by your own database. See Sessions.
Pausing for a person
Call LangGraph’s owninterrupt() in a node, and the run ends with an interrupt event. The next call on the same sessionId carries the answer as a resume, and the graph continues from that node. Nothing from Onecortex is imported.
agent.py
- When the value you pass is a dict, its
reason,message,responseSchemaandexpiresAtbecome the interrupt’s fields. Any other value is shown to the person as itsmessage. LangGraph’s owninterrupt(value, response_schema=...)works too. - A
resolvedanswer reaches your node as itspayload. Acancelledone reaches it asNone: your graph decides what cancelling means. - The pause lives in your graph’s checkpointer, so a graph that pauses must be compiled with one. Without it the run fails with
agent_error:Your graph called interrupt() but was compiled without a checkpointer, so it could never be resumed. Pass one to compile(); see https://docs.onecortex.io/frameworks/langgraph. - An in memory checkpointer keeps the pause while the session’s instance runs. For a pause that must outlast it, compile with a checkpointer backed by your own database.
- Several nodes may pause at once. The resume must answer every interrupt, by its
id.
A LangGraph agent that pauses for approval
refund-approval: looks an order up, asks a person to approve the refund, then refunds, declines or cancels. It runs with no model key.Known limits
- Only the compiled graph is recognised. Export
builder.compile(), notbuilder. - Onecortex adds no checkpointer, and an in memory one lasts only as long as the session’s instance.
Troubleshooting
More on Troubleshooting and Errors.