Skip to main content

SDK Overview

The Sypho SDK (sypho-sdk) is a Python framework for building autonomous AI agents.

Features

  • 🎯 @entrypoint Decorator - Define agent entry points
  • 🛠️ @tool Decorator - Create tools for LLMs to call
  • 🤖 Agent Mode - Autonomous execution with LLM loops
  • 📦 Auto-Discovery - Generate manifests from decorators
  • 🔌 Platform Tools - Access structured data, vectors, graphs
  • 🌐 AgentContext - Runtime context with tool calling

Installation

pip install sypho-sdk

Quick Example

from sypho_sdk import entrypoint, tool, AgentContext

@tool
async def fetch_weather(city: str):
"""Fetch weather for a city"""
# Your implementation
return {"temp": 72, "condition": "sunny"}

@entrypoint
async def main(input: dict, context: AgentContext):
"""Weather agent entrypoint"""
city = input.get("city", "San Francisco")

weather = await context.call_tool("fetch_weather", {
"city": city
})

return {
"city": city,
"weather": weather
}

Execution Modes

Agent Mode (Autonomous)

The agent runs with an LLM in a loop, making tool calls until complete:

@entrypoint
async def main(input: dict, context: AgentContext):
# SDK automatically enters run_loop()
# LLM decides which tools to call
# Agent runs until task is complete
pass

Requires agent_config in manifest:

{
"agent_config": {
"model": "anthropic/claude-3-5-sonnet-20241022",
"max_tokens": 4096,
"max_iterations": 10,
"system_prompt": "You are a helpful assistant."
}
}

Key Components

Decorators

  • @entrypoint - Marks functions as agent entry points
  • @tool - Marks functions as tools for LLMs

AgentContext

Runtime context provided to entrypoints:

class AgentContext:
async def call_tool(name: str, args: dict) -> any
run_id: str
step_id: str
lease_id: str

Platform Tools

Automatically available via context:

  • structured_data_save
  • structured_data_get
  • structured_data_query
  • structured_data_delete
  • structured_data_list_keys

Development Workflow

  1. Write agent code with decorators
  2. Build with sypho build (auto-discovery)
  3. Deploy with sypho deploy
  4. Test locally with sypho dev

Next Steps