Agent Config
Agent configs are YAML files that define how an agent runs. They’re used by society run and society daemon.
Full schema
Section titled “Full schema”name: string # Required. Unique agent name.description: string # Optional. Human-readable description.port: integer # Optional. HTTP listen port (1-65535).handler: string # Required. One of: echo, greeter, exec.
backend: # Required when handler is "exec". command: string # Required. Executable name or path. args: [string] # Optional. Arguments prepended to each invocation. session_flag: string # Optional. Flag for session ID on first message. resume_flag: string # Optional. Flag for session ID on follow-up messages. env: [string] # Optional. Environment variables (KEY=VALUE format).
skills: # Optional. Capabilities advertised in the agent card. - id: string name: string description: string # Optional.Handlers
Section titled “Handlers”Returns the input message unchanged.
name: echoport: 8001handler: echogreeter
Section titled “greeter”Prepends “Hello! You said: ” to each message.
name: greeterport: 8002handler: greeterRuns an external command for each message. The command receives the message text as an argument and its stdout becomes the response.
name: claudeport: 8003handler: execbackend: command: claude args: ["-p", "--output-format", "json"] session_flag: "--session-id" resume_flag: "--resume"Session continuity
Section titled “Session continuity”When session_flag and resume_flag are set, the exec handler maintains conversation state:
- First message in a thread: appends
<session_flag> <session-id> - Follow-up messages: appends
<resume_flag> <session-id>
The session ID is stored in ~/.society/threads/<thread-id>.json.
Output parsing
Section titled “Output parsing”The exec handler tries to parse stdout as {"result": "<text>"} (the JSON format Claude Code uses with --output-format json). If that fails, it uses raw stdout as the response text.
Examples
Section titled “Examples”Claude Code
Section titled “Claude Code”name: claudedescription: Claude Code agentport: 8003handler: execbackend: command: claude args: ["-p", "--output-format", "json"] session_flag: "--session-id" resume_flag: "--resume"skills: - id: code name: Code Assistant - id: general name: GeneralOllama
Section titled “Ollama”name: llamadescription: Local Llama via Ollamaport: 8010handler: execbackend: command: ollama args: ["run", "llama3.2"]Custom script
Section titled “Custom script”name: summarizerdescription: Document summarizerport: 8020handler: execbackend: command: python3 args: ["tools/summarize.py", "--model", "gpt-4o"] env: - OPENAI_API_KEY=sk-xxxskills: - id: summarize name: SummarizeFile location
Section titled “File location”The daemon discovers all *.yaml and *.yml files in the agents directory (default: agents/). Override with --agents <dir>.