Running an Agent Worker

Running an Agent Worker

There are two common ways to run an agent worker:

  • Development: agent.dev()
  • Production: agent.start()

Minimal example

from siphon.agent import Agent
from dotenv import load_dotenv

load_dotenv()   # Load environment variables from .env file

agent = Agent(agent_name="Receptionist")

if __name__ == "__main__":
    agent.dev()

This starts a worker that can accept jobs. You can add defaults (LLM/STT/TTS) now, or inject them dynamically per call.

Standard example

This is a typical worker setup with plugins + environment variables.

from dotenv import load_dotenv
from siphon.agent import Agent
from siphon.plugins import openai, cartesia, deepgram

load_dotenv()   # Load environment variables from .env file

agent = Agent(
    agent_name="Receptionist",
    llm=openai.LLM(),
    stt=deepgram.STT(),
    tts=cartesia.TTS(),
    send_greeting=True,
    system_instructions="You are a helpful customer support agent.",
    greeting_instructions="Thanks for calling. How can I help?",
)

if __name__ == "__main__":
    agent.dev()
    # agent.start()

One-time downloads

On a fresh setup, SIPHON may need to download required files.

  • Run agent.download_files() once.
  • After that, run agent.dev() / agent.start() directly.

dev() vs start()

  • dev()

    • Best for local iteration.
    • If startup fails due to missing files, SIPHON attempts to download files and retry.
  • start()

    • Use for production deployments.
    • Same retry behavior for missing files.

Agent naming

agent_name is required.

It must match the name used by:

  • Inbound dispatch: Dispatch(agent_name=...)
  • Outbound call: Call(agent_name=...)