Advanced content analysis platform with multiple AI agents for detecting toxicity, bias, misinformation, and coordination patterns in text content.
- Real AI Models: Uses Cerebras Qwen-3-32B for intelligent analysis
- Multi-Agent Analysis: Four specialized AI agents working together
- Toxicity Detection: AI-powered detection of harmful and inappropriate content
- Bias Detection: Intelligent detection of bias and discrimination patterns
- Misinformation Detection: AI analysis of false claims and misleading content
- Coordination Detection: Detection of coordinated behavior and manipulation
- Modern Web UI: Responsive interface with real-time AI analysis
- RESTful API: Comprehensive API for integration with other systems
- Context Understanding: Real AI models understand meaning, not just keywords
emakia-node/
├── agents/
│ ├── toxicityAgent.js # Toxicity detection agent
│ ├── biasAgent.js # Bias detection agent
│ ├── misinformationAgent.js # Misinformation detection agent
│ └── coordinationAgent.js # Coordination detection agent
├── routes/
│ └── classify.js # API routes for classification
├── public/
│ └── index.html # Web interface
├── app.js # Main server file
├── package.json # Dependencies and scripts
└── README.md # This file
- Node.js (version 16 or higher)
- npm or yarn package manager
-
Clone or navigate to the project directory:
cd emakia-node -
Install dependencies:
npm install
-
Set up environment variables (optional for enhanced AI models):
# Create .env file touch .env # Add your Cerebras API configuration (optional) echo "CEREBRAS_API_KEY=your_cerebras_api_key_here" >> .env echo "CEREBRAS_API_URL=https://api.cerebras.com" >> .env echo "CEREBRAS_MODEL=Qwen-3-32B" >> .env
Note: The system works without the API key using intelligent fallback detection, but the Cerebras Qwen-3-32B model provides superior accuracy for complex cases.
npm run devnpm startThe application will start on http://localhost:3000
Analyze text with all or selected agents.
Request Body:
{
"text": "Your text to analyze",
"agents": ["toxicity", "bias", "misinformation", "coordination"]
}Response:
{
"text": "Your text to analyze",
"timestamp": "2024-01-01T12:00:00.000Z",
"analyses": {
"toxicity": {
"isToxic": true,
"toxicityScore": 0.8,
"severity": "high",
"categories": {...},
"recommendations": [...]
},
"bias": {...},
"misinformation": {...},
"coordination": {...}
},
"summary": {
"totalIssues": 3,
"criticalIssues": 1,
"highIssues": 2,
"mediumIssues": 0,
"lowIssues": 0
},
"overallRisk": "critical"
}Analyze text using query parameters.
Example:
GET /api/classify?text=your message&agents=toxicity,bias
POST /api/classify/toxicity- Toxicity analysis onlyPOST /api/classify/bias- Bias analysis onlyPOST /api/classify/misinformation- Misinformation analysis onlyPOST /api/classify/coordination- Coordination analysis only
Check system health and agent status.
Get information about available agents.
- Categories: Hate speech, violence, harassment, profanity
- Severity Levels: Low, medium, high, critical
- Features: Pattern matching, severity assessment, recommendations
- Categories: Gender, racial, age, religious, socioeconomic bias
- Indicators: Absolute statements, generalizations, stereotypes, loaded language
- Features: Bias detection, inclusive language recommendations
- Categories: Conspiracy theories, pseudoscience, clickbait, sensationalism
- Red Flags: Emotional language, urgency, authority appeals, exclusivity
- Features: Fact-checking guidance, source verification
- Categories: Bot-like behavior, coordinated campaigns, manipulation tactics
- Indicators: Urgency pressure, emotional manipulation, social proof
- Features: Authenticity verification, manipulation detection
Create a .env file with the following variables:
# Server Configuration
PORT=3000
NODE_ENV=development
# API Configuration
API_VERSION=v1
API_TIMEOUT=30000
# Agent Configuration
AGENT_TIMEOUT=10000
AGENT_CONFIDENCE_THRESHOLD=0.6
# Logging Configuration
LOG_LEVEL=info
LOG_FORMAT=combined
# Security Configuration
CORS_ORIGIN=*
RATE_LIMIT_WINDOW=15
RATE_LIMIT_MAX=100Each agent can be customized by updating patterns and thresholds:
// Example: Update toxicity patterns
const toxicityAgent = new ToxicityAgent();
toxicityAgent.updatePatterns({
new_category: ['new', 'keywords', 'here']
});
// Example: Update severity thresholds
toxicityAgent.updateSeverityLevels({
custom: 0.5
});The web interface provides:
- Multi-agent selection: Choose which agents to use
- Real-time analysis: Instant results with visual indicators
- Detailed breakdown: Individual agent results with scores
- Recommendations: Actionable advice for each detected issue
- Responsive design: Works on desktop and mobile devices
app.js: Express server with agent initialization and route handlingagents/: Individual agent classes with specialized analysis logicroutes/classify.js: API endpoints for text classificationpublic/index.html: Modern web interface with JavaScript
- Create a new agent class in
agents/ - Implement the required methods:
analyze(),getName(),getDescription(), etc. - Add the agent to
app.js - Update the web interface to include the new agent
Each agent supports:
- Pattern updates via
updatePatterns() - Threshold updates via
updateSeverityLevels() - Custom analysis logic in the
analyze()method
-
Port already in use:
PORT=3001 npm start
-
Agent errors:
- Check agent initialization in
app.js - Verify agent class exports
- Review console logs for specific errors
- Check agent initialization in
-
API errors:
- Verify request format
- Check required fields (text, agents)
- Review server logs
Enable debug logging:
LOG_LEVEL=debug npm start- Input validation on all endpoints
- Rate limiting to prevent abuse
- Error handling without exposing sensitive information
- CORS configuration for cross-origin requests
- Agent analysis runs asynchronously
- Configurable timeouts for external API calls
- Efficient pattern matching algorithms
- Memory-conscious text processing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Check the troubleshooting section
- Review the API documentation
- Open an issue on GitHub
Note: This is a demonstration platform. For production use, implement proper security measures, error handling, and integrate with real AI models for improved accuracy.