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
- Python
- TypeScript
A file and a name at its top level, separated by a colon:A file in a subfolder is
agent.yml
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 theframework field in agent.yml to decide.
- Python
- TypeScript
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:- Python
- TypeScript
agent.py
request for the whole request, params included. See A Python 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 oninput(), or calls a model at the top level hangs or crashes on import. Guard that code:
agent.py
open("data.json") reads a file from it.
When the object is not found
Every message is on Errors.