Prerequisites
- Node.js version 18 or higher
- An AI Agents House API key and organization ID
- An existing AI agent using Anthropic or OpenAI
Installation
Install the SDK using your preferred package manager:- npm
- pnpm
- bun
- deno
- yarn
Basic Setup
1. Initialize the Monitor
Create a newAgentMonitor instance with your configuration:
Store your API credentials in environment variables for security. Never commit API keys to version control.
2. Register Your Agent
Before tracking interactions, register your agent with the monitoring system:3. Track Interactions
Start monitoring your agent’s conversations:LLM Integration Setup
For automatic monitoring without manual tracking, wrap your existing LLM clients:Anthropic Integration
OpenAI Integration
Configuration Options
Customize the monitoring behavior with these configuration options:Compliance Monitoring
WhenenableComplianceChecks is enabled, the SDK automatically scans interactions for:
- PII Detection: Emails, phone numbers, SSNs, and other sensitive data
- Fair Lending: Discriminatory language and bias indicators
- BSA/AML: Suspicious activity keywords and patterns
Complete Example
Here’s a complete working example that demonstrates all key features:Next Steps
Now that you have the basics working:Compliance Engine
Learn about built-in compliance monitoring
Manual Tracking
Detailed event tracking capabilities
Configuration
Advanced configuration options
API Reference
Complete API documentation
