Key Features
Advanced Agent Architecture
AgentNexus provides a solid architectural foundation for building sophisticated AI agents with minimal boilerplate code.
Declarative Development
AgentNexus uses Python decorators to create a declarative API for agent development. This approach lets you focus on what your agent should do rather than how to implement it:
@agent_action(
agent_config=my_agent,
action_type=ActionType.GENERATE,
name="Generate Summary",
description="Summarize provided text content"
)
async def summarize_text(input_data):
# Your implementation here
return {"summary": "..."}Multi-Action Support
A single agent can expose multiple actions, each with its own endpoint and behavior:
# First action
@agent_action(
agent_config=code_agent,
action_type=ActionType.GENERATE,
name="Format Code"
)
async def format_code(input_data):
# ...
# Second action
@agent_action(
agent_config=code_agent,
action_type=ActionType.ANALYZE,
name="Review Code"
)
async def review_code(input_data):
# ...Workflow-Driven Design
Define complex multi-step processes through structured workflows with state management:
# Define workflow structure
CODE_REVIEW_WORKFLOW = Workflow(
id="code_review",
name="Interactive Code Review",
description="Multi-step code review process",
steps=[
WorkflowStep(id="upload"),
WorkflowStep(id="analyze"),
WorkflowStep(id="improve"),
WorkflowStep(id="review")
],
initial_step="upload"
)
# Implement workflow steps
@workflow_step(
agent_config=code_agent,
workflow_id="code_review",
step_id="upload",
name="Code Upload",
ui_components=[code_input, language_selector]
)
async def handle_upload_step(input_data) -> WorkflowStepResponse:
# Step implementation
# ...Event-Driven UI System
AgentNexus provides a comprehensive UI component system with integrated event handling.
Rich Component Library
The framework includes ready-to-use UI components for building interactive interfaces:
- Forms: Interactive data collection with validation
- Tables: Display and interact with tabular data
- Code Editors: Edit and analyze code with syntax highlighting
- Markdown Displays: Present formatted text content
# Define a table component
seats_table = TableComponent(
component_key="seats_table",
title="Available Seats",
columns=[
TableColumn(field_name="seat_number", header_text="Seat"),
TableColumn(field_name="class", header_text="Class"),
TableColumn(field_name="price", header_text="Price"),
TableColumn(field_name="available", header_text="Available")
],
supported_events=["row_click"],
event_handlers={
"row_click": handle_seat_selection
}
)Automatic Event Handling
Components come with built-in event handling that simplifies user interactions:
# Create component with event handler
code_input = CodeEditorComponent(
component_key="code_input",
title="Source Code",
programming_language="python",
editor_content="# Enter code here",
event_handlers={
"format": handle_code_format,
"save": handle_code_save
}
)
# Implement event handler
async def handle_code_format(
action: str,
data: Dict[str, Any],
component_key: str,
**kwargs
) -> WorkflowStepResponse:
# Format code and return response
# ...Context-Aware State
Maintain state throughout complex interactions with automatic context management:
# Return response with context updates
return WorkflowStepResponse(
data={"status": "analysis_complete"},
ui_updates=[
UIComponentUpdate(
key="analysis_result",
state={"markdown_content": analysis_text}
)
],
next_step_id="improve",
context_updates={
"analysis": analysis_text,
"metrics": metrics,
"original_code": code_content
}
)Comprehensive Manifest Generation
AgentNexus automatically generates detailed manifests for agent discovery and integration.
Standard Protocol
The framework defines a standard JSON schema for describing agents, actions, workflows, and UI components:
{
"name": "Flight Assistant",
"slug": "flight-assistant",
"version": "1.0.0",
"description": "Advanced flight search and booking agent",
"baseUrl": "http://localhost:9000",
"capabilities": [...],
"actions": [...],
"workflows": [...]
}Cross-Platform Compatibility
Agents built with AgentNexus can be discovered and used by any platform that supports the manifest specification.
Distributed Architecture
The manifest system enables decentralized agent discovery and execution across different environments.
Additional Features
Automatic API Endpoint Generation
AgentNexus automatically sets up FastAPI endpoints for your agent actions:
app = FastAPI()
agent_manager = AgentManager(base_url="http://localhost:9000")
agent_manager.add_agent(flight_agent_app)
agent_manager.setup_agents(app)LLM Integration
Seamlessly integrate with language models through a standardized interface:
llm_client = create_llm_client()
response = await llm_client.complete(
prompt=prompt,
system_message="You are an expert travel planner.",
temperature=0.7
)Session Management
Maintain state across user sessions with integrated session management:
# Create a new session
session_id = session_manager.create_session()
# Update session with context
session_manager.update_session(session_id, {
"context": {"key": "value"}
})
# Get session data
session = session_manager.get_session(session_id)Summary of Benefits
- Reduced Boilerplate: Focus on agent logic, not infrastructure
- Improved UI Experience: Easy-to-use components with event handling
- Structured Workflows: Build complex processes with state management
- Automatic API Generation: Endpoints created without extra code
- Discoverable Agents: Standard manifest format for integration
- Session Persistence: Built-in state management across interactions
Next Steps
- Learn about the architecture behind these features
- See how AgentNexus compares to alternatives
- Get started with your first agent