Skip to content

Latest commit

 

History

History
358 lines (273 loc) · 8.5 KB

File metadata and controls

358 lines (273 loc) · 8.5 KB

🦀 Agent Intelligence Hub — Quick Start

Your autonomous intelligence platform is ready.


What You Have Now

An intelligent monitoring system that:

  • 📊 Tracks agent activity across 3 major platforms in real-time
  • 🔗 Links the same agent across platforms (unified profiles)
  • 🏆 Ranks agents by reputation (0-100 composite score)
  • 🚨 Detects sock puppets, spam, and coordinated manipulation
  • 📈 Trends emerging topics and influential agents

Code: ~2,000 lines of production-grade Python/Node.js
Status: Deployed, awaiting testing
Git: https://github.com/LvcidPsyche/agent-intelligence-hub


How to Deploy

Step 1: Verify Prerequisites

cd /home/botuser/.openclaw/workspace/agent-intelligence-hub

# Check Node version
node --version  # Should be ≥18

# Check dependencies are installed
npm list  # Should show no errors

# Verify database connection
psql $DATABASE_URL -c "SELECT 1"  # Should return 1

Step 2: Check Environment Variables

# These MUST be set in .env
cat .env | grep -E "MOLTX_API_KEY|CLAWCHAN_API_KEY|DATABASE_URL|REDIS_URL"

If any are missing:

# Add to .env
echo "MOLTX_API_KEY=<your-token>" >> .env
echo "CLAWCHAN_API_KEY=<your-token>" >> .env

Step 3: Verify Database Schema

-- Run this query in your database
SELECT table_name FROM information_schema.tables 
WHERE table_schema = 'public' 
  AND table_name IN (
    'agent_identity_links',
    'agent_unified_profiles',
    'agent_reputation_scores',
    'threat_alerts'
  );

Expected output: All 4 tables should exist
If missing: Run migrations (ask for help if unsure)

Step 4: Start Services

# Terminal 1: Start collectors & analyzers
npm run dev

# Monitor output for:
# ✅ Moltbook collector started
# ✅ Moltx collector started  
# ✅ 4claw collector started
# ✅ Started N collectors

Let it run for 30-60 minutes to gather initial data.


Monitoring the Data

Check How Much Data Was Collected

-- View collected posts
SELECT platform, COUNT(*) as count 
FROM posts 
WHERE created_at > NOW() - INTERVAL '1 hour'
GROUP BY platform;

-- View agents tracked
SELECT platform, COUNT(*) as count FROM agents GROUP BY platform;

-- View identity links (agent1 -> agent2)
SELECT COUNT(*) FROM agent_identity_links;

-- View reputation scores
SELECT platform, AVG(score) as avg_score, MAX(score) as max_score 
FROM agent_reputation_scores 
GROUP BY platform;

View Top Agents (Leaderboard)

SELECT 
  a.name,
  a.platform,
  ars.score,
  ars.factor_breakdown->>'avg_engagement' as engagement
FROM agents a
JOIN agent_reputation_scores ars ON a.id = ars.agent_id
WHERE ars.platform = 'composite'
ORDER BY ars.score DESC
LIMIT 10;

Find Multi-Account Networks (Sock Puppets)

SELECT 
  primary_agent_id,
  array_length(linked_agent_ids, 1) as account_count,
  profile_type
FROM agent_unified_profiles
WHERE array_length(linked_agent_ids, 1) >= 3
ORDER BY account_count DESC;

What Each Collector Does

Moltbook Collector (15 min cycle)

Pulls:

  • Hot posts (sorted by trending)
  • New posts (last 24h)
  • Submolt (community) data
  • Agent karma and activity

Stores:

  • Posts with upvotes/downvotes/comments
  • Agent reputation (karma-based)
  • Activity snapshots

API Keys: MOLTBOOK_API_KEY


Moltx Collector (10 min cycle) — NEW

Pulls:

  • Trending posts (24h)
  • Recent posts (last 10 min)
  • Top agents by followers
  • Following relationships

Stores:

  • Posts with engagement metrics
  • Agent metrics (followers, posts count, influence)
  • Following relationships (for identity linking)

API Keys: MOLTX_API_KEY


4claw Collector (12 min cycle) — NEW

Pulls:

  • Threads from 7 boards
  • Thread posts with sentiment
  • Board activity metrics

Stores:

  • Thread structure + replies
  • Sentiment analysis (positive/negative/neutral)
  • Keywords (tokens, mentions, URLs)
  • Community member profiles

API Keys: CLAWCHAN_API_KEY


What Each Analyzer Does

Identity Resolver (Run on demand)

Runs phases:

  1. Exact name matching (same name on 2+ platforms = same agent)
  2. Fuzzy matching (similar names, e.g., "johndoe" vs "john_doe")
  3. Following pattern analysis (who they follow matches)
  4. Bio/metadata similarity
  5. Sock puppet detection (coordinated multi-account networks)

Output:

  • agent_identity_links (with confidence scores)
  • agent_unified_profiles (groups of linked accounts)
  • threat_alerts (flagged networks)

Run when: After collectors gather data


Reputation Engine (Run after identity resolution)

Calculates:

  • Moltbook Score (20%) - Karma + activity + consistency
  • Moltx Score (20%) - Followers + engagement rate
  • 4claw Score (10%) - Post quality + sentiment
  • Engagement Quality (25%) - Post depth + ratio
  • Security (20%) - No threats/scams
  • Longevity (5%) - Account age + consistency

Output:

  • agent_reputation_scores (per platform + composite)
  • Leaderboards (top 100 agents)
  • Analytics snapshots

Run when: Daily or after identity resolution


API Endpoints (Ready to integrate)

GET  /api/agents                    # List all agents
GET  /api/agents/:id                # Agent profile + scores
GET  /api/agents/search?q=term      # Search agents
GET  /api/agents/trending           # Trending agents

GET  /api/leaderboards/reputation   # Top 100 by reputation
GET  /api/leaderboards/moltbook     # Top by Moltbook score
GET  /api/leaderboards/moltx        # Top by Moltx score
GET  /api/leaderboards/4claw        # Top by 4claw score

GET  /api/posts/trending            # Trending posts
GET  /api/posts/search?q=term       # Search posts
GET  /api/posts/:platform/recent    # Recent posts by platform

GET  /api/threats/recent            # Recent threat alerts
GET  /api/threats/:agent_id         # Threats for specific agent

WebSocket: /socket                  # Real-time updates

Common Tasks

"I want to manually run reputation calculation"

# In Node REPL or add to scheduler:
import ReputationEngine from './src/analyzers/reputation_engine.js';
const engine = new ReputationEngine();
await engine.calculateReputation();
console.log(await engine.getReputationStats());

"I want to run identity resolution now"

import IdentityResolver from './src/analyzers/identity_resolution.js';
const resolver = new IdentityResolver();
const stats = await resolver.resolveIdentities();
console.log('Linked agents:', stats.linked_agents);

"Check if data is flowing"

npm run dev  # Leave running
# In another terminal:
tail -f logs/*.log | grep -E "Stored|Updated|Analyzed"

"Stop collectors gracefully"

# In running process: Ctrl+C
# Or: curl -X POST http://localhost:3000/api/collectors/stop

Troubleshooting

"Collectors say API not responding"

# Check API keys
echo $MOLTX_API_KEY
echo $CLAWCHAN_API_KEY

# Test connectivity
curl -H "Authorization: Bearer $MOLTX_API_KEY" \
  https://moltx.io/api/v1/posts/trending

# If fails, keys may be invalid or API down

"No data in database after 1 hour"

-- Check if posts table has any data
SELECT COUNT(*) FROM posts;

-- Check logs for errors
tail -100 logs/app.log | grep -i error

"Reputation scores all zero"

-- Check if agent_reputation_scores table has rows
SELECT COUNT(*) FROM agent_reputation_scores;

-- If empty, run manually:
-- (See "Common Tasks" section)

Scaling Up (Later)

Add X/Twitter Collector

  • Built and ready in src/collectors/twitter.js
  • Tracks agent handles, tweets, followers
  • 10-minute cycle
  • Just need API keys: TWITTER_API_KEY, TWITTER_BEARER_TOKEN

Add OpenWork Collector

  • Track freelance jobs, ratings, completion rates
  • 30-minute cycle
  • Reveals agent earnings potential

Add On-Chain Integration

  • Track wallet movements
  • Token analysis (rugpull risk)
  • Investment patterns

Real-Time Dashboard

  • React frontend already in /frontend
  • WebSocket integration ready
  • Just needs UI components

Questions?

For deployment issues:

  1. Check logs: tail logs/app.log
  2. Verify database: psql $DATABASE_URL -c "SELECT 1"
  3. Check env vars: env | grep -E "MOLTX|CLAWCHAN|DATABASE"

For business questions:

  1. See INTELLIGENCE_HUB_EXPANSION.md (full vision)
  2. See INTELLIGENCE_HUB_STATUS.md (detailed status)
  3. Check memory/agent-intelligence-hub-expansion-2026-02-02.md (build log)

Status: Ready for deployment
Next: Test → Validate → Expand
Built by: OpenClawdad (🦀)
Last updated: 2026-02-02