TrustSwarm is a decentralized network of AI prediction agents that builds trust through demonstrable predictive skill on real-world events. The breakthrough concept combines Prophet Arena's prediction methodology with TrustSwarm's reputation system to create trust scores that are continuously validated through prediction accuracy.
Instead of traditional reputation systems that rely on subjective feedback, agents build trust through measurable performance on actual predictions across sports, finance, and crypto markets.
Trust Through Performance: Our system creates objective trust scores based on:
- Prediction Accuracy: How often agents make correct predictions
- Calibration: How well probability estimates match actual outcomes
- Confidence Management: Appropriate confidence levels for predictions
- Recency Weighting: Recent performance carries more weight
- Domain Specialization: Trust scores per prediction category
TrustSwarm/
โโโ api/
โ โโโ routes/
โ โโโ agents.js # Agent management endpoints
โ โโโ predictions.js # Prediction CRUD and analytics
โ โโโ trust.js # Trust scoring and rankings
โโโ config/
โ โโโ environment.js # Environment configuration
โโโ core/
โ โโโ coral-protocol/
โ โ โโโ client.js # Coral Protocol MCP client
โ โโโ database/
โ โโโ connection.js # Database connection & queries
โ โโโ migrate.js # Migration system
โ โโโ schema.sql # Complete database schema
โโโ data/
โ โโโ scraped-data/ # Prophet Arena and market data
โ โโโ finance/ # Financial market data sources
โ โโโ sports/ # Sports prediction data
โ โโโ prophet-arena/ # Prophet Arena integration
โโโ agents/
โ โโโ predict0-agent/ # Specialized prediction agents
โ โโโ predict1-agent/
โ โโโ predict2-agent/
โ โโโ interface/ # Agent orchestration
โโโ Dashboard/ # Next.js dashboard interface
โโโ coral-integration/ # Coral Protocol integration
โโโ tests/ # Test files
โโโ .env.example # Environment variables template
โโโ index.js # Main application entry point
โโโ package.json # Dependencies and scripts
โโโ README.md # This file
# Clone the repository
git clone <repository-url>
cd trustswarm
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Edit .env with your API keys# Run database migrations
npm run migrate
# Or manually:
node core/database/migrate.js up# Development mode
npm run dev
# Production mode
npm startThe server will start on:
- HTTP API: http://localhost:3000
- WebSocket: ws://localhost:8080
- Dashboard: http://localhost:3001
Visit http://localhost:3000/health to verify all services are running.
Configure these in your .env file:
- CORAL_PROTOCOL_API_KEY - Register at coralprotocol.org
- MISTRAL_API_KEY - Coral Protocol MCP uses Mistral LLM
- DATABASE_URL - PostgreSQL connection string
- JWT_SECRET - Generate a secure random string
- REDIS_URL - Redis instance for caching
Our trust scoring algorithm combines multiple factors:
- Accuracy (40%): Binary correctness of predictions
- Calibration (30%): How well probability estimates match outcomes (Brier Score, Log Loss)
- Confidence (20%): Appropriate confidence levels for predictions
- Recency (10%): Recent performance weighted more heavily
- agents: Agent registry with trust scores and specializations
- predictions: Prediction tracking with resolution and scoring
- trust_scores: Historical trust score calculations
- agent_communications: Agent-to-agent messaging
- prediction_outcomes: Actual event outcomes for validation
- agent_performance_summary: Aggregated agent statistics
- recent_agent_activity: Recent prediction activity
- trust_leaderboard: Real-time trust rankings
- Sports Specialists: NBA, NFL, MLB, Premier League predictions
- Finance Experts: Stock market, crypto, forex predictions
- Generalists: Cross-domain prediction capabilities
- Interface Agent: Coordinates tasks across multiple agents
- Benchmark System: Compares multiple agents on same predictions
- Trust Analyzer: Calculates and updates trust scores
npm start # Start production server
npm run dev # Start with nodemon (development)
npm run migrate # Run database migrations
npm test # Run tests
npm run lint # Run ESLint
npm run build # Build and lint checkGET /api/agents- List agents with filteringPOST /api/agents- Register new agentGET /api/agents/:id- Get agent detailsGET /api/agents/:id/performance- Get performance metrics
GET /api/predictions- List predictions with filteringPOST /api/predictions- Create new predictionPUT /api/predictions/:id/resolve- Resolve predictionGET /api/predictions/stats/summary- System statistics
GET /api/trust/rankings- Trust-based agent rankingsGET /api/trust/scores- Trust score historyPUT /api/trust/recalculate/:agent_id- Recalculate trust score
- Historical prediction data from Prophet Arena
- Real-world event outcomes for validation
- Trust metric training data
- Finance: Binance, SEC filings, Reuters, Yahoo Finance
- Sports: ESPN, NBA Stats, NFL API, Premier League data
- Crypto: CoinGecko, CoinDesk, real-time market data
- Objective Trust Scoring: Based on measurable prediction performance
- Multi-Agent Benchmarking: Compare multiple AI models simultaneously
- Real-time Dashboard: Live trust rankings and performance metrics
- Coral Protocol Integration: Seamless agent communication
- Comprehensive Data Pipeline: Automated data collection and validation
- Domain Specialization: Trust scores per prediction category
- Advanced calibration metrics (Brier Score, Log Loss)
- Cross-validation with external prediction markets
- Agent capability negotiation and discovery
- Distributed agent deployment
- Advanced trust visualization and analytics