> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiagentshouse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> A complete guide to configuring the AI Agents House SDK for your specific environment and needs.

Proper configuration is key to leveraging the full power of the AI Agents House SDK. This guide provides a central reference for all configuration options, helping you tailor the monitor for optimal performance, data accuracy, and cost-efficiency across different environments.

## Main Configuration (`AgentMonitorConfig`)

This object is passed to the `AgentMonitor` constructor and controls the core behavior of the SDK, such as authentication, batching, and logging.

<ParamField path="apiKey" type="string" required>
  Your AI Agents House API key. This is used to authenticate with the platform. It's highly recommended to load this from an environment variable (`process.env.AGENT_GOVERNANCE_API_KEY`).
</ParamField>

<ParamField path="organizationId" type="string" required>
  Your organization's unique identifier in the AI Agents House platform. This should also be loaded from an environment variable.
</ParamField>

<ParamField path="endpoint" type="string" default="https://api.aiagentshouse.com">
  The API endpoint for the AI Agents House platform. Only change this if you have a dedicated or on-premise instance.
</ParamField>

<ParamField path="environment" type="'production' | 'staging' | 'development'" default="production">
  The environment your application is running in. This helps you filter and analyze data in the dashboard.
</ParamField>

<ParamField path="batchSize" type="number" default="100">
  The number of events to collect in memory before sending them to the API. A larger size is more efficient for high-volume applications but uses more memory and has higher data loss risk on crash. Range: 1–1000.
</ParamField>

<ParamField path="flushInterval" type="number" default="5000">
  The maximum time in milliseconds the SDK will wait before sending a batch of events, even if `batchSize` has not been reached. Minimum: 100.
</ParamField>

<ParamField path="enableComplianceChecks" type="boolean" default="true">
  Set to true to activate the real-time, offline Compliance Engine to scan agent responses for violations.
</ParamField>

<ParamField path="enableLogging" type="boolean" default="true">
  Set to true to enable detailed logging from the SDK to your console. It's recommended to set this to false in production.
</ParamField>

<ParamField path="logLevel" type="'debug' | 'info' | 'warn' | 'error'" default="info">
  The minimum log level to output when `enableLogging` is true. Use `'debug'` for verbose troubleshooting.
</ParamField>

<ParamField path="retryAttempts" type="number" default="3">
  The number of times the SDK will retry sending a batch of events if the network request fails. Range: 0–10.
</ParamField>

<ParamField path="retryDelay" type="number" default="1000">
  The base delay in milliseconds between retry attempts. The SDK uses exponential backoff.
</ParamField>

## Agent Registration (`AgentInfo`)

This object is passed to the `monitor.registerAgent()` method to define the profile and settings for each of your AI agents.

<ParamField path="id" type="string" required>
  A unique identifier for the agent within your organization (e.g., `personal-banking-assistant-v2`).
</ParamField>

<ParamField path="name" type="string" required>
  A human-readable name for the agent that will be displayed on the dashboard.
</ParamField>

<ParamField path="category" type="AgentCategory" required>
  The type of agent. Can be `'persona'`, `'tool_calling'`, `'workflow'`, or `'autonomous'`.
</ParamField>

<ParamField path="specialty" type="BankingSpecialty">
  The agent's area of expertise within banking, such as `'personal_banking'` or `'fraud_detection'`. This helps with specialized analytics.
</ParamField>

<ParamField path="version" type="string" required>
  The version of your agent (e.g., `'1.2.0'`). This is crucial for tracking performance and compliance across different agent versions.
</ParamField>

<ParamField path="llmProvider" type="string" required>
  The name of the LLM provider (e.g., `'anthropic'`, `'openai'`).
</ParamField>

<ParamField path="model" type="string" required>
  The specific model the agent is using (e.g., `'claude-3-5-sonnet-20241022'`).
</ParamField>

<ParamField path="description" type="string" required>
  A brief description of the agent's purpose and capabilities.
</ParamField>

<ParamField path="complianceSettings" type="object">
  An object to configure which categories of compliance checks are active for this specific agent.

  <Expandable title="Compliance Settings">
    <ParamField path="sr11_7_enabled" type="boolean" required>
      Enable checks related to SR 11-7 model risk management.
    </ParamField>

    <ParamField path="fair_lending_monitoring" type="boolean" required>
      Enable checks for Fair Lending compliance.
    </ParamField>

    <ParamField path="bsa_aml_checks" type="boolean" required>
      Enable checks for Bank Secrecy Act / Anti-Money Laundering keywords.
    </ParamField>
  </Expandable>
</ParamField>

## Configuration Examples by Environment

It's a best practice to use different configurations for your various environments.

<CodeGroup>
  ```javascript title="Development" theme={null}
  // Optimized for immediate feedback and easy debugging
  const devMonitor = new AgentMonitor({
  apiKey: process.env.AGENT_GOVERNANCE_API_KEY,
  organizationId: process.env.AGENT_GOVERNANCE_ORG_ID,
  environment: 'development',
  enableLogging: true,
  logLevel: 'debug',
  batchSize: 5,         // Small batches for quick sending
  flushInterval: 1000,  // Frequent flushes
  enableComplianceChecks: true,
  retryAttempts: 1      // Fail fast
  });
  ```

  ```javascript title="Staging" theme={null}
  // A balanced configuration for realistic pre-production testing
  const stagingMonitor = new AgentMonitor({
  apiKey: process.env.AGENT_GOVERNANCE_API_KEY,
  organizationId: process.env.AGENT_GOVERNANCE_ORG_ID,
  environment: 'staging',
  enableLogging: true,
  logLevel: 'info',
  batchSize: 50,
  flushInterval: 5000,
  enableComplianceChecks: true,
  retryAttempts: 3
  });
  ```

  ```javascript title="Production" theme={null}
  // Optimized for performance, reliability, and cost-efficiency
  const prodMonitor = new AgentMonitor({
  apiKey: process.env.AGENT_GOVERNANCE_API_KEY,
  organizationId: process.env.AGENT_GOVERNANCE_ORG_ID,
  environment: 'production',
  enableLogging: false,     // Disable verbose logging
  logLevel: 'error',        // Only log critical errors
  batchSize: 500,           // Large batches for network efficiency
  flushInterval: 15000,     // Less frequent flushes
  enableComplianceChecks: true,
  retryAttempts: 5,         // More retries for reliability
  retryDelay: 2000
  });
  ```
</CodeGroup>

## Security Best Practices

<Warning>
  **Never hardcode your `apiKey` or `organizationId` in your source code.**
  Always use environment variables (e.g., `process.env`) or a dedicated secret management service (like AWS Secrets Manager, HashiCorp Vault, or Doppler) to handle sensitive credentials. This prevents accidental exposure in version control systems.
</Warning>

```javascript theme={null}
// Recommended way to initialize
import dotenv from 'dotenv';
dotenv.config();

const monitor = new AgentMonitor({
  apiKey: process.env.AGENT_GOVERNANCE_API_KEY,
  organizationId: process.env.AGENT_GOVERNANCE_ORG_ID,
  // ... other settings
});
```
