Skip to main content
entrypoint in agent.yml names the one object in your code that is the agent. Onecortex imports it once, when your agent starts, recognises what it is, and calls it on every request. You do not write a server: no FastAPI, no Express, no port, no Dockerfile.

The format

A file and a name at its top level, separated by a colon:
agent.yml
A file in a subfolder is src/agent.py:graph. The path is relative to the agent folder.

How the object is recognised

Onecortex looks at the object itself, in this order, and uses the first match. It never reads the framework field in agent.yml to decide.
An uncompiled LangGraph StateGraph is not a graph you can run, so it is not recognised: export the result of .compile().

A plain function always works

If your agent is on a framework not listed, or on none, point the entrypoint at a function. It takes the prompt, and returns the reply or yields it in pieces:
agent.py
Sync and async functions, generators and async generators all work. Declare a second parameter to receive the session ID, or a parameter named request for the whole request, params included. See A Python function.
A function is also how you serve an agent from a framework Onecortex does not recognise, such as AutoGen or Pydantic AI: wrap its run call in a function and point the entrypoint at the function.

Your code runs once at start

Onecortex imports your entrypoint’s file when the agent’s container starts, before any request. Anything at the top level of the file runs then. That is the right place to build your graph, load a model client or read a data file, and it is why an agent that starts slowly or not at all fails the build’s smoke test rather than a customer’s first call. It is also the most common failure for a repository that used to run as a script. A file that starts a server, loops on input(), or calls a model at the top level hangs or crashes on import. Guard that code:
agent.py
The working directory is your agent folder, so a relative path like open("data.json") reads a file from it.

When the object is not found

Every message is on Errors.
Last modified on September 28, 2026