Overview
The OpsHub AI Agent provides real-time assistance through a WebSocket connection. This enables:- Natural language query building
- Interactive spreadsheet manipulation
- Context-aware suggestions
- Real-time validation feedback
WebSocket Endpoint
Connection
Establish Connection
Message Types
Client → Agent Messages
Initialize Session
User Message
Tool Result
Feedback
Agent → Client Messages
Agent Response
Tool Call
Streaming Response
Error
Available Tools
The agent can invoke various tools to assist you:Database Query Tool
Visual Data Modeler Tool
Formula Translation Tool
Smart Suggestions Tool
Context Awareness
The agent maintains context throughout the conversation:Rate Limits
WebSocket connections are subject to rate limits:- Max Connections: 5 per user
- Messages/Minute: 60
- Max Message Size: 1MB
- Connection Duration: 4 hours (auto-reconnect)
Error Handling
Connection Errors
Connection Errors
Handle connection failures gracefully:
Message Errors
Message Errors
Validate messages before sending:
Timeout Handling
Timeout Handling
Implement ping/pong for connection health:
Best Practices
Reconnection Logic
Implement exponential backoff for reconnections
Message Validation
Validate all messages before sending
Context Management
Keep context minimal and relevant
Error Logging
Log all errors for debugging
Complete Example
Next Steps
Sessions API
Manage agent sessions
Messages API
Query message history
Data API
Work with portfolio data
Workflows
Orchestrate workflows