Skip to main content
Agents are configurable AI assistants. Each agent has an LLM provider, a system prompt, and a set of enabled tools. Key properties: Wildcard patterns for enabled_* fields:
Wildcards expand at tool discovery time. The resolved tools are validated against user permissions at execution time. Message hooks: Functions that run before/after agent messages. Each hook has:
  • function: reference to a function (namespace/name)
  • async: if true, fire-and-forget (no impact on latency)
  • on_timeout: block (stop pipeline) or passthrough (continue) — sync hooks only
Hook functions receive {"message": {"role": "...", "content": "..."}, "chat_id": "...", "agent": {"namespace": "...", "name": "..."}, "user_id": "..."} and can return:
  • {"content": "..."} to mutate the message
  • {"block": true, "reply": "..."} to stop the pipeline
  • null to pass through unchanged
Management endpoints:
Runtime endpoints (chats):
Invoke endpoint: A synchronous request/response alternative to the two-step chat flow. Intended for integrations (Slack, Telegram, webhooks) that need a simple call-and-response.
  • session_key: Maps an external identifier (Slack channel, Telegram chat, WhatsApp number) to a persistent Sinas chat. One chat per (agent_id, session_key) pair.
  • reset: true: Archives the existing session and starts a new conversation.
  • input: Agent input variables, only used when creating a new chat.
  • Streams internally, returns assembled reply as a single JSON payload.
How chat works:
  1. Create a chat linked to an agent (optionally with input variables validated against input_schema)
  2. Send a message — Sinas builds the conversation context with the system prompt, preloaded skills, message history, and available tools
  3. The LLM generates a response, possibly calling tools
  4. If tools are called, Sinas executes them (in parallel where possible) and sends results back to the LLM for a follow-up response
  5. The final response is streamed to the client via Server-Sent Events
Ephemeral chats can be created with a TTL by passing expires_in (seconds) when creating the chat. Expired chats are automatically hard-deleted (with all messages) by a scheduled cleanup job:
Chat archiving — Chats can be archived via PUT /chats/{id} with {"archived": true}. Archived chats are hidden from the default list but can be included with ?include_archived=true. Agent-to-agent calls go through the Redis queue so sub-agents run in separate workers, avoiding recursive blocking. Results stream back via Redis Streams. Function parameter defaults pre-fill values when an agent calls a function. Supports Jinja2 templates referencing the agent’s input variables: