Getting Started
Build & deploy agents in minutes
Agently is the hosted platform for building, deploying, and scaling AI agents. Define your agent with a few lines of code, push to production with one command, and monitor everything in real-time.
No Kubernetes. No GPU management. No infrastructure headaches. Just ship.
Installation
Install the Agently SDK in your preferred language. Both Python and TypeScript/JavaScript are fully supported.
$ npm install agentlyRequirements: Python 3.9+ or Node.js 18+. An Agently account is required — sign up for early access.
Quick Start
Create and deploy your first agent in under 5 minutes. This example creates a customer support agent with tool access.
Initialize your project
Scaffold a new agent project with the CLI.
$ npx agently init my-agent
# Creates a new agent project with config and boilerplateDefine & deploy your agent
Write your agent configuration and deploy with a single command.
from agently import Agent, deploy
# Define your agent
agent = Agent(
name="support-bot",
model="gpt-4o",
instructions="You are a helpful customer support agent.",
tools=["search_docs", "create_ticket"]
)
# Deploy to production in one line
result = deploy(agent, environment="production")
print(f"Agent live at: {result.url}")Your agent is live
Your agent is now running at https://support-bot.agently.run with auto-scaling, monitoring, and a REST API — all configured automatically.
Project Structure
An Agently project follows a simple, opinionated structure. The CLI generates this when you run agently init.
my-agent/
|-- agent.py # Agent definition & tools
|-- agently.yaml # Configuration & deploy settings
|-- tools/
| |-- search.py # Custom tool implementations
| |-- tickets.py
|-- tests/
| |-- test_agent.py # Agent behavior tests
|-- requirements.txt # Python dependencies
|-- .env # Environment variables (local)agent.py — Your agent definition including model, instructions, and tool references.
agently.yaml — Deployment configuration: scaling, regions, environment variables, secrets.
tools/ — Custom tool implementations your agent can invoke.
API Reference
Core API
The Agently SDK exposes three primary functions: create, deploy, and monitor. Each is designed to be simple to use while offering deep configurability when needed.
#Agent()— Create Agents
Instantiate an agent with a model, instructions, and optional tool integrations. Agents are stateless by default but can be configured with persistent memory.
Parameters
| Parameter | Type |
|---|---|
| namerequired | string |
| modelrequired | string |
| instructionsrequired | string |
| tools | string[] |
| memory | boolean |
| max_tokens | number |
from agently import Agent
agent = Agent(
name="my-agent",
model="gpt-4o",
instructions="Respond helpfully to user queries.",
tools=["web_search", "calculator"],
memory=True,
max_tokens=4096
)#deploy()— Deploy Agents
Deploy an agent to Agently's managed infrastructure. Handles containerization, networking, TLS, and auto-scaling automatically.
Parameters
| Parameter | Type |
|---|---|
| agentrequired | Agent |
| environment | string |
| scaling | object |
| region | string |
from agently import deploy
result = deploy(
agent,
environment="production",
scaling={ "min_instances": 1, "max_instances": 10 },
region="us-east-1"
)
print(result.url) # https://my-agent.agently.run
print(result.status) # 'deployed'
print(result.version) # 'v1'Deployment returns: A result object with url, status, version, and dashboard_url for your monitoring dashboard.
#monitor— Monitor Agents
Access real-time logs, performance metrics, and execution traces for any deployed agent. Essential for debugging and optimizing agent behavior.
Available Methods
| Parameter | Type |
|---|---|
| monitor.logs() | method |
| monitor.metrics() | method |
| monitor.traces() | method |
from agently import monitor
# Get real-time logs
logs = monitor.logs("support-bot", tail=100)
# Get performance metrics
metrics = monitor.metrics("support-bot")
print(metrics.avg_latency_ms) # 245
print(metrics.requests_24h) # 12847
print(metrics.error_rate) # 0.002
# Get execution traces
traces = monitor.traces(
"support-bot",
limit=10,
include_tool_calls=True
)Code Examples
Full example: Customer support agent
End-to-end example showing how to create a customer support agent with custom tools, deploy it to production, and monitor its performance — all in under 30 lines.
from agently import Agent, deploy, monitor, Tool
# 1. Define custom tools
@Tool(name="search_knowledge_base")
def search_kb(query: str) -> str:
"""Search the company knowledge base for relevant articles."""
# Your search logic here
return perform_search(query)
@Tool(name="create_support_ticket")
def create_ticket(
title: str,
priority: str = "medium"
) -> dict:
"""Create a new support ticket in the system."""
return { "id": "TKT-1234", "status": "created" }
# 2. Create the agent
agent = Agent(
name="customer-support",
model="gpt-4o",
instructions="""
You are a world-class customer support agent.
Always search the knowledge base before answering.
Create tickets for issues you cannot resolve directly.
Be empathetic, concise, and solution-oriented.
"""
)
# 3. Deploy to production
result = deploy(
agent,
environment="production",
scaling={ "min": 2, "max": 20 },
)
print(f"Live at: {result.url}")
# 4. Monitor in real-time
metrics = monitor.metrics("customer-support")
print(f"Latency: {metrics.avg_latency_ms}ms")
print(f"Uptime: {metrics.uptime_pct}%")Create
Define agents with tools and instructions in a few lines.
Deploy
Push to production in one command with auto-scaling.
Monitor
Real-time logs, metrics, and traces out of the box.
Ready to build?
Get started with Agently today. Deploy your first agent in under 5 minutes.