Entrypoints
Entrypoints are the entry points for agent execution.
@entrypoint Decorator
from sypho_sdk import entrypoint, AgentContext
@entrypoint
async def main(input: dict, context: AgentContext):
"""Main entrypoint"""
return {"result": "success"}
Function Signature
async def entrypoint_name(
input: dict, # User input
context: AgentContext # Runtime context
) -> dict: # Return value
pass
- input: User-provided data from run request
- context: SDK-provided runtime context
- return: Result dict (sent back to control plane)
Multiple Entrypoints
@entrypoint
async def main(input: dict, context: AgentContext):
"""Primary entrypoint"""
pass
@entrypoint
async def worker(input: dict, context: AgentContext):
"""Background worker entrypoint"""
pass
Run specific entrypoint:
sypho run my-agent:0.1.0 --entrypoint worker
Docstring as System Prompt
The entrypoint docstring becomes the agent's system prompt:
@entrypoint
async def support_agent(input: dict, context: AgentContext):
"""
You are a customer support agent for Acme Corp.
Your responsibilities:
- Answer product questions
- Help with order tracking
- Process refund requests
Always be polite and professional.
"""
pass
Input Structure
# Run created with:
{
"input": {
"query": "What is the weather?",
"user_id": "123"
}
}
# Entrypoint receives:
@entrypoint
async def main(input: dict, context: AgentContext):
query = input.get("query")
user_id = input.get("user_id")
...
Return Value
@entrypoint
async def main(input: dict, context: AgentContext):
return {
"status": "completed",
"result": {...},
"metadata": {...}
}
Returned dict is stored in runs.result column.