Skip to content

Integration with AegisAI / AgentOps

AgentBI runs standalone or alongside AegisAI and AgentOps. In integration mode it consumes data from those systems for deeper business analytics.

Project Focus What it contributes to AgentBI
AegisAI Security Agents, policies, anomalies, audit logs
AgentOps Orchestration Tasks, chains, schedules, cost tracking
AgentBI Business value ROI, value, time saved, comparison

What is integrated

Source Data Business outcome in AgentBI
AegisAI Agents, policies, anomalies, audit logs ROI with security context; incident cost via business events
AgentOps Tasks, chains, schedules, cost tracking ROI with orchestration context; chain efficiency

Integration methods

1. API (primary)

Configure in .env:

```bash AEGISAI_API_URL=https://aegisai.example/api/v1 AEGISAI_API_KEY=your_aegisai_key

AGENTOPS_API_URL=https://agentops.example/api/v1 AGENTOPS_API_KEY=your_agentops_key ```

Sync agents from AegisAI:

bash python scripts/migrate_aegisai_data.py

The script:

  1. Reads AEGISAI_API_URL / AEGISAI_API_KEY
  2. Fetches the upstream agent list
  3. Creates / updates rows in AgentBI agents
  4. Stores external_refs.aegisai_id

Suggested hourly cron:

bash 0 * * * * cd /opt/agentbi && .venv/bin/python scripts/migrate_aegisai_data.py >> logs/sync.log 2>&1

2. Webhook (real-time)

AegisAI / AgentOps can push events into AgentBI:

http POST /api/v1/ingest/webhook X-API-Key: abi_... Content-Type: application/json

Example payload (AgentBI schema):

json { "agent_id": "support-triage", "event_type": "task_completed", "duration_ms": 1500, "cost_usd": 0.05, "business_value": 10.0, "time_saved_minutes": 15, "metadata": { "source": "agentops", "task_id": "task-9981", "chain_id": "chain-sales-q3" } }

Example upstream webhook config:

yaml webhooks: - url: https://your-agentbi.example/api/v1/ingest/webhook headers: X-API-Key: abi_your_key events: - agent.registered - agent.action - task.completed - cost.updated

Recommended event mapping:

Upstream event AgentBI event_type Fields
task.completed task_completed cost_usd, business_value, time_saved_minutes
cost.updated cost_updated cost_usd
agent.action + anomaly error metadata.severity
agent.registered create via /api/v1/agents or auto-register on first event

3. SDK (directly from agents)

Agents can send business metrics without a middle layer:

```python

sdk/agentbi.py

from agentbi import AgentBI

client = AgentBI( base_url="https://your-agentbi.example", api_key="abi_...", )

client.track( agent_id="agent-001", event_type="task_completed", duration_ms=1500, cost_usd=0.05, business_value=100.00, time_saved_minutes=15, metadata={ "description": "Sales deal closed", "source": "agent_runtime", }, )

client.track_batch([ { "agent_id": "agent-001", "event_type": "task_completed", "cost_usd": 0.04, "business_value": 12.0, "time_saved_minutes": 8, }, { "agent_id": "agent-001", "event_type": "task_completed", "cost_usd": 0.06, "business_value": 20.0, "time_saved_minutes": 12, }, ]) ```


Integration value example

Without AgentBI:

  • AegisAI: “Agent performed 1000 actions, 3 anomalies”
  • AgentOps: “Agent completed 50 tasks, cost $45”

With AgentBI:

Agent Support Triage handled 1000 requests, saved 87 hours, delivered $1,250 in value (including labor savings), cost $45.80, ROI 2,629%.

System relationship:

Runtime Agent │ ├─► AegisAI (policy / audit) ├─► AgentOps (orchestration / cost) └─► AgentBI (business value / ROI) ← CEO/CFO view


Minimum fields for meaningful ROI:

Field Type Required Meaning
agent_id string yes Agent identifier
event_type string yes task_completed / error / …
cost_usd float yes Call / task cost
business_value float recommended Direct business value ($)
time_saved_minutes int recommended Employee time saved
duration_ms int no Duration
metadata object no Context (deal_id, ticket_id, …)

If business_value is omitted, ROI can still use labor savings (time_saved × hourly_human_cost_usd).


Integration security

  1. Use separate API keys per upstream (AegisAI sync, AgentOps webhook, Prod agents).
  2. Never commit keys — only .env.
  3. Restrict CORS and Traefik exposure in production.
  4. For on-prem setups, keep AgentBI on the same private network as AegisAI / AgentOps.

Integration troubleshooting

migrate_aegisai_data.py does nothing

text AEGISAI_API_URL not set — nothing to migrate.

Set variables in .env or export them in the shell.

Webhook 401

Check X-API-Key — it must be created via /api/v1/auth/api-keys and is_active=true.

Agents exist in AegisAI but ROI is 0

Agent sync does not create business events. You still need ingest events with cost_usd / business_value / time_saved_minutes.


Integration roadmap

  • [ ] Scheduled audit-log pull from AegisAI
  • [ ] AgentOps cost-stream import
  • [ ] Unified agent identity graph (aegisai_id + agentops_id + agentbi_id)
  • [ ] “Security cost of incidents” dashboard (AegisAI anomalies × $ impact)

See also: Home · CEO/CFO guide