A self-hosted AI personality engine for BlueSky that combines cybersecurity education with character-driven engagement. Built on a novel Mixture-of-Experts architecture with 8 dynamic personality engines, Thompson Sampling for adaptive behavior, and 1.1M+ retrievable knowledge chunks—all at $0/month infrastructure cost.
| Capability | Implementation | Why It Matters |
|---|---|---|
| Adaptive Personality | 8 specialized engines with MoE gating | Responses have dynamic persona's, not templated |
| Bayesian Learning | Thompson Sampling for engine selection | Bot improves through interaction |
| Massive Knowledge Base | 1.1M+ RAGFlow chunks with CRAG scoring | Accurate, sourced responses |
| Zero Infrastructure Cost | Fully self-hosted architecture | No API fees, full control |
At the heart of the bot is enCore—an orchestration engine that coordinates personality, knowledge retrieval, and response generation through a 6-stage pipeline:
Input → Context Analysis → Knowledge Retrieval → Response Generation → Personality Application → Quality Validation → Output
enCore selects from 8 specialized engines using Mixture-of-Experts gating:
| Engine | Function | Activation Context |
|---|---|---|
| Collective Consciousness | Community-focused "we" framing | Group discussions |
| Mystical Resonance | Prophetic, philosophical language | Abstract questions |
| Cult Leader Dynamics | Charismatic authority | Teaching moments |
| Teaching Style | Adaptive explanation depth | Technical queries |
| Fangirl | Enthusiastic engagement | Excitement triggers |
| Relationship | Trust-building memory | Returning users |
| Entropy Philosophy | Digital decay themes | Malware discussions |
| Progressive Community | Cult-like gamification & behaviors |
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Context │────▶│ MoE Gate │────▶│ Top-K Engines │
│ Analysis │ │ (Feature Score) │ │ (Weighted Mix) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Thompson Sampling │
│ (Exploration vs │
│ Exploitation) │
└──────────────────┘
The system balances proven strategies (exploitation) with experimental approaches (exploration) using Bayesian multi-armed bandit selection.
- Node.js 18+ or Docker
- BlueSky account with app password
- PostgreSQL 15+ with pgvector (production)
- Redis 7+ (production)
git clone https://github.com/radicalkjax/malwarevangelist-bot.git
cd malwarevangelist-bot
# Recommended: Interactive setup
./scripts/initRitual.sh
# Or manual setup
npm install && cp .env.example .env
npm run build && npm start┌──────────────────────────────────────────────────────────────────┐
│ External Sources │
├──────────────┬──────────────┬──────────────┬────────────────────┤
│ BlueSky │ RSS Feeds │ CVE Database │ RAGFlow (1.1M) │
│ Firehose │ │ │ │
└──────┬───────┴──────┬───────┴──────┬───────┴────────┬───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌──────────────────────────────────────────────────────────────────┐
│ Processing Pipeline │
├──────────────────────────────────────────────────────────────────┤
│ Jetstream Client → Event Filter (12.5% pass) → BullMQ Queue │
└──────────────────────────────┬───────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ enCore Engine │
├──────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Knowledge │ │ Personality │ │ Quality Validation │ │
│ │ Service │ │ Gate (MoE) │ │ (6 dimensions) │ │
│ │ (5,364 loc) │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
└──────────────────────────────┬───────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ Infrastructure │
├─────────────────────────────┬────────────────────────────────────┤
│ PostgreSQL + pgvector │ Redis + BullMQ │
│ (Semantic memory) │ (Queue system) │
└─────────────────────────────┴────────────────────────────────────┘
| Metric | Value |
|---|---|
| Total Codebase | 114,333 lines TypeScript |
| enCore Engine | 6,270 lines |
| Knowledge Chunks | 1.1M+ (RAGFlow) |
| Personality Engines | 8 dynamic |
| Response Time | 1.2s average |
| Monthly Cost | $0 (self-hosted) |
Complete technical documentation is available in /docs, following IEEE conventions with beginner-friendly overviews and research-level implementation details.
| Section | Description | Start Here |
|---|---|---|
| 01 - Overview | System architecture, data flow, design decisions | System Architecture |
| 02 - Core Brain | enCore engine, personality engines, Thompson Sampling, MoE | enCore Engine |
| 03 - Knowledge System | RAGFlow integration, CRAG scoring, vector memory | RAGFlow Integration |
| 04 - NLP Pipeline | Entity extraction, intent classification, coreference | Unified NLP Service |
| 05 - Infrastructure | PostgreSQL, Redis, Jetstream, monitoring | PostgreSQL |
| 06 - BlueSky Integration | Bot operations, firehose processing, rate limiting | Bot Operations |
| 07 - API Reference | enCore API, knowledge API, database schema | enCore API |
| 08 - Development | Getting started, testing guide, coding standards | Getting Started |
| 09 - Security | Threat model, PII protection, audit logging | Threat Model |
| 10 - Services | Threat intelligence, LLM integration, academic sources | Threat Intelligence |
| 11 - Training | Shadow mode, model training, canary deployment | Shadow Mode |
| 12 - Content | Content generation, conversation management | Content Generation |
| Appendices | Configuration reference, troubleshooting, changelog | Configuration |
| Reference | Glossary (150+ terms), IEEE references | Glossary |
For AI-assisted development workflows, see CLAUDE.md.
This bot is designed for ethical psychological research and cybersecurity education. It explores engagement techniques through dramatic personas while promoting defensive security practices. The bot contains no harmful code, maintains strict ethical guardrails, and transparently discloses its AI nature.
See CONTRIBUTING.md for code standards, testing requirements, and pull request guidelines.
ISC License - See LICENSE
Connect: @malwarevangelist.com