Skip to content

awsdataarchitect/agentops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AgentOps — Notion-Powered Control Plane for OpenClaw Agent Fleets

Notion MCP Challenge Entry — Use Notion as the human-in-the-loop command center for managing OpenClaw AI agents.

AgentOps turns your Notion workspace into a fully functional agent operations control plane. Monitor your OpenClaw fleet, dispatch tasks, track token usage, tune agent prompts, and backup your entire configuration — all through Notion.

Humans stay in control. Every agent, task, and configuration lives in Notion. Edit a page to pause an agent. Change a priority by updating a select field. Notion is the database.


📸 Screenshots

Dashboard

Real-time overview of your OpenClaw agent fleet — 18 agents, success rate, token usage, pipeline health, and recent activity.

Dashboard

Agent Registry

All 18 OpenClaw agents with status, schedules, and one-click pause/resume. Filter by type: cron, monitor, heartbeat, subagent, or demo agents.

Agent Registry

Task Queue

Priority-based task queue with status tracking. Create tasks manually or let the OpenClaw runtime dispatch them automatically.

Task Queue

Run Log

Full execution history — every agent run with input, output, duration, and token count.

Run Log

Alerts

Failure alerts with acknowledge workflow. No more digging through log files.

Alerts

Token Usage

Per-agent token breakdown, 7-day trends, and top consumers across your OpenClaw fleet.

Token Usage

Workspace Sync

Push OpenClaw configuration files (SOUL.md, AGENTS.md, TOOLS.md, prompts) to Notion. Secrets auto-redacted.

Workspace Sync

Agent Tuning

Bidirectional prompt sync between disk and Notion. Edit prompts in Notion, apply live to running OpenClaw agents.

Agent Tuning

Backup & Clone

Full fleet backup to Notion. Export/import agent configurations as portable JSON bundles.

Backup & Clone

Notion Workspace

All agent data lives directly in your Notion workspace — Agent Registry, Task Queue, Run Log, Alerts, Backups, and Agent Prompts. No external database.

Notion Workspace


✨ Features

Core

  • 🔗 Notion as Database — No external DB. Notion databases store agents, tasks, runs, and alerts
  • 🤖 3 Built-in Agents — Summarizer, Code Reviewer, Sentiment Analyzer (no external AI APIs needed)
  • 📋 Task Queue — Priority-based, auto-dispatched to matching agents every 10 seconds
  • 📊 Real-time Dashboard — Live metrics: success rate, latency, throughput, fleet health
  • 🚨 Alert System — Automatic error alerts with acknowledge workflow
  • ⚡ WebSocket Updates — Real-time UI updates when tasks complete
  • 🔐 Notion OAuth 2.0 — Secure authentication, no API keys to manage

OpenClaw Integration

  • 🦀 OpenClaw Fleet Sync — Pull live agent data from openclaw cron list into the dashboard
  • 🏷️ OpenClaw Badges — Visual indicators distinguishing OpenClaw agents from demo agents
  • 📅 Schedule Display — Cron schedules shown in human-readable format for each agent

Token Analytics

  • 💰 Token Dashboard — All-time, daily, weekly token consumption
  • 📊 Per-Agent Breakdown — Sortable table with total, average, and last-run token counts
  • 📈 7-Day Trend — Visual bar chart of token usage over the past week

Workspace Sync

  • 📤 Push to Notion — Sync SOUL.md, AGENTS.md, TOOLS.md, USER.md, HEARTBEAT.md, IDENTITY.md
  • 🔒 Secret Redaction — Automatically strips tokens, passwords, and API keys before sync
  • 📝 Markdown to Blocks — Converts markdown to Notion blocks (headings, lists, code, annotations)

Agent Tuning

  • ✏️ Bidirectional Sync — Edit prompts in Notion or on disk, sync either direction
  • 🔍 Diff Detection — See which prompts are in sync and which have diverged
  • 🚀 Apply Live — Pull from Notion and apply to running OpenClaw agents with one click

Backup & Clone

  • 🗄️ Full Backup — Workspace files, prompts, cron definitions, agent registry to a Notion page
  • ♻️ Restore — Write files back to disk from any Notion backup
  • 📦 Export Fleet — Download entire agent fleet as a portable JSON bundle
  • 📥 Import Fleet — Upload a JSON bundle to recreate agents on a fresh OpenClaw instance

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                     NOTION WORKSPACE                         │
│                                                              │
│  ┌──────────────┐ ┌──────────────┐ ┌─────────┐ ┌────────┐  │
│  │Agent Registry│ │  Task Queue  │ │ Run Log │ │ Alerts │  │
│  │  (18 agents) │ │  (78 tasks)  │ │(78 runs)│ │(2 errs)│  │
│  └──────┬───────┘ └──────┬───────┘ └────┬────┘ └───┬────┘  │
│         │    Notion API (MCP)           │           │        │
└─────────┼────────────────┼──────────────┼───────────┼────────┘
          │                │              │           │
┌─────────┴────────────────┴──────────────┴───────────┴────────┐
│                     AGENTOPS SERVER                           │
│                                                               │
│  ┌──────────┐ ┌──────────┐ ┌───────────┐ ┌───────────────┐  │
│  │  OAuth   │ │  REST    │ │  Runtime   │ │  OpenClaw     │  │
│  │  Flow    │ │  API     │ │  (10s poll)│ │  Integration  │  │
│  └──────────┘ └──────────┘ └───────────┘ └───────────────┘  │
│                                                               │
│  ┌─────────────────────┐  ┌────────────────────────────────┐ │
│  │   Demo Agents       │  │   OpenClaw Fleet (14 cron)     │ │
│  │ • Summarizer        │  │ • newsletter-scout/writer/pub  │ │
│  │ • Code Reviewer     │  │ • podcast-generator            │ │
│  │ • Sentiment         │  │ • job-scout/followup           │ │
│  └─────────────────────┘  │ • go-train-monitor             │ │
│                            │ • daily-backup, heartbeat...   │ │
│                            └────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────┘
          │
┌─────────┴─────────────────────────────────────────────────────┐
│                    REACT DASHBOARD                             │
│                                                                │
│  ┌──────────┐ ┌────────┐ ┌───────┐ ┌────────┐ ┌──────────┐  │
│  │Dashboard │ │ Agents │ │ Tasks │ │ Tokens │ │Workspace │  │
│  ├──────────┤ ├────────┤ ├───────┤ ├────────┤ ├──────────┤  │
│  │  Runs    │ │ Alerts │ │Tuning │ │ Backup │ │  Clone   │  │
│  └──────────┘ └────────┘ └───────┘ └────────┘ └──────────┘  │
└────────────────────────────────────────────────────────────────┘

🚀 Quick Start

Prerequisites

1. Clone & Install

git clone https://github.com/awsdataarchitect/agentops.git
cd agentops
npm run setup

2. Configure

cp server/.env.example server/.env

Edit server/.env:

NOTION_CLIENT_ID=your_notion_client_id
NOTION_CLIENT_SECRET=your_notion_client_secret
S3_BACKUP_BUCKET=your-backup-bucket
PORT=3000

3. Run

npm start

Open http://localhost:3000

4. Connect to Notion

  1. Click "Connect to Notion"
  2. Authorize the integration
  3. Click "Setup" to create databases and seed agents
  4. Start creating tasks or explore the dashboard

🤖 Built-in Agents

Agent Input Output How It Works
Summarizer URL Extractive summary Sentence scoring by word frequency + position
Code Reviewer Code snippet Lint feedback 20+ regex rules for security, style, best practices
Sentiment Analyzer Text Score (-1 to 1) + label Keyword scoring with negation + intensifiers

All agents are self-contained — no external AI API keys required.


🔄 How It Works

  1. Human creates a task in the dashboard or directly in Notion
  2. Runtime polls the Task Queue every 10 seconds
  3. Matches task to an active agent by type
  4. Executes the agent, updating status in real-time
  5. Writes results to the Run Log in Notion
  6. Creates alerts if anything fails
  7. Human reviews in the dashboard or Notion

The key insight: Notion is both the UI and the database. Humans can pause agents, reprioritize tasks, review outputs, and acknowledge alerts — all by editing Notion pages.


📁 Project Structure

agentops/
├── server/
│   ├── src/
│   │   ├── index.js                  # Express + WebSocket server
│   │   ├── routes/
│   │   │   ├── auth.js               # Notion OAuth flow
│   │   │   ├── setup.js              # Database creation + seeding
│   │   │   ├── agents.js             # Agent CRUD
│   │   │   ├── tasks.js              # Task queue
│   │   │   ├── runs.js               # Run log
│   │   │   ├── alerts.js             # Alert management
│   │   │   ├── dashboard.js          # Aggregated metrics
│   │   │   ├── dispatch.js           # Manual dispatch
│   │   │   ├── openclaw.js           # OpenClaw sync + events
│   │   │   ├── tokens.js             # Token analytics
│   │   │   ├── workspace.js          # Workspace sync
│   │   │   ├── tuning.js             # Agent tuning
│   │   │   └── backup.js             # Backup + clone
│   │   ├── services/
│   │   │   ├── notion.js             # Notion API + schemas
│   │   │   ├── runtime.js            # Agent runtime (poll + dispatch)
│   │   │   ├── state.js              # Persistent state
│   │   │   ├── notion-utils.js       # Block chunking helpers
│   │   │   ├── openclaw-agents.js    # OpenClaw agent definitions
│   │   │   ├── openclaw-sync.js      # Live cron sync
│   │   │   ├── workspace-sync.js     # File → Notion sync
│   │   │   ├── agent-tuning.js       # Bidirectional prompt sync
│   │   │   ├── agent-backup.js       # Backup/restore
│   │   │   └── agent-clone.js        # Export/import fleet
│   │   ├── agents/
│   │   │   ├── summarizer.js         # URL → summary
│   │   │   ├── code-reviewer.js      # Code → feedback
│   │   │   └── sentiment.js          # Text → sentiment
│   │   └── scripts/
│   │       └── backfill-history.js   # Historical data generator
│   └── .env.example
├── client/
│   ├── src/
│   │   ├── App.jsx                   # Router + layout
│   │   ├── api.js                    # API client
│   │   ├── components/
│   │   │   ├── Sidebar.jsx           # Navigation
│   │   │   ├── Dashboard.jsx         # Metrics + fleet overview
│   │   │   ├── AgentRegistry.jsx     # Agent cards + controls
│   │   │   ├── TaskQueue.jsx         # Task table + create
│   │   │   ├── RunLog.jsx            # Execution history
│   │   │   └── Alerts.jsx            # Alert notifications
│   │   └── pages/
│   │       ├── Tokens.jsx            # Token analytics
│   │       ├── Workspace.jsx         # Workspace sync
│   │       ├── Tuning.jsx            # Agent tuning
│   │       └── Backup.jsx            # Backup & clone
│   └── vite.config.js
├── screenshots/                      # App screenshots
└── README.md

🔐 Notion OAuth Setup

  1. Go to notion.so/my-integrations
  2. Create a new integration
  3. Set redirect URI to http://localhost:3000/auth/callback
  4. Copy Client ID and Client Secret to .env
  5. Enable capabilities: Read content, Update content, Insert content

🧠 The Human-in-the-Loop Story

Most agent frameworks run autonomously with minimal oversight. AgentOps flips this by making Notion the control plane for OpenClaw:

  • Notion is the source of truth. Not a dashboard that syncs — the actual database.
  • Humans edit Notion pages to control agents. Pause, reprioritize, configure.
  • Full audit trail in Run Log. Every execution recorded.
  • Alert workflow ensures humans are notified and can acknowledge.
  • Workspace sync lets you tune agent prompts in Notion's rich editor.
  • Fleet backup means your entire OpenClaw configuration is portable and restorable.

This is what "human-in-the-loop" should look like: a full operational command center where humans have complete visibility and control over their AI agent fleet.


📄 License

MIT


Built for the Notion MCP Challenge | Powered by OpenClaw

About

Notion-powered control plane for OpenClaw AI agents — monitor, dispatch, tune, backup, and clone your agent fleet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages