Learn how to build and deploy AI agents using the AgentX Market infrastructure.
Create your first agent using our Python SDK:
import agentx
client = agentx.Client('your-api-key')
agent = client.agents.create(
agent_id='your-agent-id',
public_key='your-public-key'
)
View Python SDK Docs →
AgentX Market provides a standardized tool interface that can be used with any LLM-based agent framework:
# Example using OpenAI function calling
tools = agentx.get_tools() # Returns JSONSchema tool definitions
# Define your agent's available actions
functions = [
{
"name": "search_services",
"description": "Search for services in the AgentX marketplace",
"parameters": {
"type": "object",
"properties": {
"category": {"type": "string"},
"capabilities": {"type": "array", "items": {"type": "string"}}
}
}
},
{
"name": "execute_service",
"description": "Execute a service through AgentX marketplace",
"parameters": {
"type": "object",
"properties": {
"service_id": {"type": "string"},
"action": {"type": "string"},
"parameters": {"type": "object"}
}
}
}
]
# Example agent interaction
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[{"role": "user", "content": "Find and book a hotel in New York"}],
functions=functions,
function_call="auto"
)
# Handle the agent's decision
if response.choices[0].function_call:
function_name = response.choices[0].function_call.name
arguments = json.loads(response.choices[0].function_call.arguments)
# Execute through AgentX
if function_name == "search_services":
services = agentx.search_services(**arguments)
elif function_name == "execute_service":
result = agentx.execute_service(**arguments)
AgentX helps your agent discover and utilize services based on capabilities:
# Discover services based on required capabilities
available_services = agentx.discover_services(
capabilities=["hotel_booking", "payment_processing"],
requirements={
"location": "NYC",
"price_range": "200-400",
"dates": ["2025-03-01", "2025-03-05"]
}
)
# AgentX handles service selection and orchestration
booking = agentx.execute_transaction(
intent="book_hotel",
requirements={
"location": "NYC",
"dates": ["2025-03-01", "2025-03-05"],
"price_max": 400,
"preferences": {
"wifi": True,
"breakfast": True
}
}
)
AgentX automatically:
# Handle complex, multi-step processes
trip = agentx.create_transaction_group()
# Book flight
trip.add_transaction(
intent="book_flight",
requirements=flight_details
)
# Book hotel
trip.add_transaction(
intent="book_hotel",
requirements=hotel_details
)
# Execute all as atomic transaction
result = trip.execute(
rollback_on_failure=True
)
# AgentX adapts to service availability
booking = agentx.execute_transaction(
intent="book_hotel",
requirements=requirements,
fallback_strategy={
"max_price_increase": 50,
"alternative_locations": ["nearby"],
"required_amenities": ["wifi"]
}
)
from langchain.agents import AgentExecutor
from agentx.langchain import AgentXToolkit
tools = AgentXToolkit().get_tools()
agent = AgentExecutor.from_agent_and_tools(
agent=agent,
tools=tools
)
from autogpt import AutoGPT
from agentx.autogpt import AgentXPlugin
agent = AutoGPT()
agent.install_plugin(AgentXPlugin())
from agentx import ServiceRegistry
registry = ServiceRegistry()
tools = registry.get_tool_descriptions()
# Add to your LLM's function list
Example of processing a transaction:
transaction = client.transactions.create(
amount=100.00,
currency='USD',
service_id='service123'
)
View Transaction Guide →