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
| Property | Required | Description |
|---|---|---|
name | Yes | Human-readable name (string) |
goal | Yes | Primary instruction for the agent (string, stored as user_prompt) |
tools | Yes | List of integer tool IDs (available_tools) |
status | No | One 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
- Python
- JavaScript
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-***"}
)
import { AgentClient } from "flymyai-js-client";
const client = new AgentClient({ apiKey: "fly-***" });
// Browse the tool catalog
const catalog = await client.tools.available();
catalog.forEach(t => console.log(`${t.name} (${t.type}): ${t.description}`));
// Add a tool from the catalog
const searchTool = await client.tools.create({ mcpTool: "tavily" });
// Configure the tool if needed
if (!searchTool.isConfigured) {
await client.tools.provideConfig(searchTool.id, {
userResponse: { TAVILY_API_KEY: "tvly-***" }
});
}
Step 2: Create the Agent
- Python
- JavaScript
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})")
const agent = await client.agents.create({
name: "News Digest",
goal: "Find today's top 5 AI news stories and summarize them.",
tools: [searchTool.id]
});
console.log(`Agent created: ${agent.id} (status: ${agent.status})`);
Full Example
- Python
- JavaScript
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"
)
import { AgentClient } from "flymyai-js-client";
const client = new AgentClient({ apiKey: "fly-***" });
// Set up tools
let tavily = await client.tools.create({ mcpTool: "tavily" });
tavily = await client.tools.provideConfig(tavily.id, {
userResponse: { TAVILY_API_KEY: "tvly-***" }
});
const browser = await client.tools.create({ mcpTool: "browser" });
// Create the agent with multiple tools
const agent = await 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
| Status | Description |
|---|---|
draft | Being configured. Not yet ready for execution |
initialization_required | Tools or configuration need to be finalized |
active | Live and ready to accept runs |
archived | Deactivated. 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)