Skip to main content

Agents

An Agent is a configurable, autonomous AI worker on FlyMy.AI. You define what it does (goal), what tools it can use, and a status. The platform handles execution, scaling, and delivery.

Agent Properties

PropertyRequiredDescription
nameYesHuman-readable name (string)
goalYesPrimary instruction for the agent (string, stored as user_prompt)
toolsYesList of integer tool IDs (available_tools)
statusNoOne of: draft, initialization_required, active, archived
Memory

Conversation memory is available on the underlying model and does not require explicit configuration.

Creating an Agent

Before creating an agent, you need to add tools from the catalog. Tools are created separately and referenced by their integer IDs.

Step 1: Add Tools

from flymyai import AgentClient

client = AgentClient(api_key="fly-***")

# Browse the tool catalog
catalog = client.tools.available()
for t in catalog:
print(f"{t.name} ({t.type}): {t.description}")

# Add a tool from the catalog
search_tool = client.tools.create(mcp_tool="tavily")

# Configure the tool if needed
if not search_tool.is_configured:
search_tool = client.tools.provide_config(
search_tool.id,
user_response={"TAVILY_API_KEY": "tvly-***"}
)

Step 2: Create the Agent

agent = client.agents.create(
name="News Digest",
goal="Find today's top 5 AI news stories and summarize them.",
tools=[search_tool.id]
)

print(f"Agent created: {agent.id} (status: {agent.status})")

Full Example

from flymyai import AgentClient

client = AgentClient(api_key="fly-***")

# Set up tools
tavily = client.tools.create(mcp_tool="tavily")
tavily = client.tools.provide_config(tavily.id, user_response={"TAVILY_API_KEY": "tvly-***"})

browser = client.tools.create(mcp_tool="browser")

# Create the agent with multiple tools
agent = client.agents.create(
name="Technical SEO Auditor",
goal="""Perform a technical SEO audit of the given website.
Check page speed, meta tags, mobile responsiveness, and structured data.
Produce a scored report with actionable recommendations.""",
tools=[tavily.id, browser.id],
status="active"
)

Agent Lifecycle

draft  →  active  →  archived
StatusDescription
draftBeing configured. Not yet ready for execution
initialization_requiredTools or configuration need to be finalized
activeLive and ready to accept runs
archivedDeactivated. No new runs can be started

You can transition an agent between statuses by updating it:

# Activate a draft agent
client.agents.update(agent_id=agent.id, status="active")

# Archive an agent you no longer need
client.agents.update(agent_id=agent.id, status="archived")

Management

# List your agents
agents = client.agents.list()

# Update an agent
client.agents.update(
agent_id=agent.id,
goal="Updated goal.",
tools=[tavily.id, browser.id]
)

# Delete an agent
client.agents.delete(agent_id=agent.id)

Next Steps

  • Runs -- executing agents and getting results
  • Tools -- browse the catalog, configure, and attach tools