Overview
Raphael is a fully self-hosted, AI-powered knowledge management system that captures Discord conversations and transforms them into a searchable, interconnected wiki — driven by an evolving AI persona inspired by the Great Sage from That Time I Got Reincarnated as a Slime. It acts as a digital memory for Aylian Studios that grows smarter every day.
The system listens to Discord, identifies valuable knowledge within discussions, generates comprehensive wiki pages automatically, discovers connections between topics across channels, and provides a clean interface to explore everything captured.
From the Original Plan
The original Raphael concept was scoped as the operating system of Aylian Studios — a voice and text interface for controlling studio infrastructure (deploying services, checking server health, managing workflows), integrated into the BOSS dashboard. It had three defined visual states: a Blue Halo for idle, a spinning red/gold geometric mandala for processing, and a waveform visualizer for speaking. The persona was hyper-competent, slightly arrogant, and fiercely loyal — addressing the user as "Master" or "Partner."
That version was blocked on BOSS reaching sufficient maturity. Rather than wait, development pivoted to Discord as the interface layer — a platform already in active daily use — and the scope shifted to knowledge capture and wiki generation as a concrete, immediately useful foundation. The Great Sage archetype (analytical, advisory, grows with accumulated knowledge) proved a better fit than the studio OS framing for this stage of the project.
The three visual states and BOSS integration remain part of the long-term vision. They are designed and waiting on the right surface to build them into.
Architecture
RS1000 (Proxy & Automation)
├── Nginx Proxy Manager → routes wiki domain to RS4000
└── n8n → Raphael router, shopping agent, Discord webhooks
RS4000 (Docker Compose — Primary Stack)
├── PostgreSQL 16 + pgvector database + vector search
├── Redis 7 caching & sessions
├── Rust Backend (Axum) REST API + AI processor + auth
├── Next.js Wiki wiki frontend
└── Discord Bot (Raphael) Bun + Discord.js
RS4000 (Docker Compose — LocalAI Stack, optional)
└── LocalAI CPU or GPU profile, port 8088
The Rust backend handles all business logic, AI processing, authentication, and data management. The Discord bot captures messages and commands, while n8n workflows handle message routing and automation. LocalAI provides a self-hosted AI runtime with a cloud fallback chain: LocalAI → OpenCode → MiniMax → Kimi.
Changelog
v1.0 — Infrastructure Foundation
- PostgreSQL 16 + pgvector schema with 9 tables:
messages,pages,page_relations,embeddings,skills,page_evolution,page_corrections,processing_logs - Docker Compose stack with internal network
172.21.0.0/16and health checks on all services - Redis 7 with AOF persistence
- Rust backend scaffold (Axum 0.7, SQLx, Tokio)
- Basic Next.js wiki shell
v2.0 — AI Integration
AIClientwith multi-provider fallback chain (LocalAI → OpenCode → MiniMax → Kimi)- Page generation pipeline: Discord messages grouped by semantic similarity, analyzed by AI, written as structured wiki pages with cross-links
- 1024-dimensional vector embeddings stored via pgvector
- Cross-page relationship discovery (semantic, hierarchical, reference)
- Daily cron job at 1 AM CET via
tokio-cron-scheduler
v2.1 — Wiki UI
- Full Next.js wiki with professional dark theme and Lucide icons throughout
- Responsive layout with backlinks display and knowledge graph visualization
- Markdown rendering with syntax highlighting and command palette (Ctrl+K)
- Rust backend logs cleaned up with structured tracing
- n8n workflow audit and updates
v2.2 — Autonomous Research Agents
ResearchAgentinai.rsruns background research tasks without blocking DiscordPOST /api/agent/researchtriggers complex multi-step queries asynchronouslyGET /api/agent/status/:idfor polling long-running jobs
v2.3 — Multi-Modal Vision
- Discord bot extracts image attachment URLs from messages
AIClient::analyze_image()sends images to vision model (LocalAI first, OpenCode fallback)- Image descriptions injected into the message processing pipeline and reflected in generated wiki pages
v2.4 — Auth, LocalAI, Plugins & Backfill
- Bearer token auth middleware in Axum — public and protected routers separated; webhook routes remain public for internal Docker network calls
- Global Axios interceptor in the Discord bot injects
Authorization: Bearer <API_KEY>on all Rust backend calls - Historical backfill on bot startup: fetches up to 2,000 messages per tracked channel, safe to re-run via
ON CONFLICT DO NOTHING - LocalAI as a separate Docker Compose stack with
[cpu]and[gpu]profiles on port 8088, joins the main network as an external network - AliExpress stub endpoints (
/api/shop/aliexpress,/api/shop/track) implemented as protected routes - Plugin list endpoint (
/api/plugins) — dynamic loading stubbed for Phase 7
Current Status
The system is running in Docker on RS4000 and in active testing as of March 2026. All six phases are complete and all services are online.
| Component | Status | |---|---| | PostgreSQL 16 + pgvector | Running | | Redis 7 | Running | | Rust Backend (Axum) | Running — 30+ endpoints | | Next.js Wiki | Running — rebuild pending for API URL fix | | Discord Bot (Raphael) | Online — 10 slash commands, backfill working | | LocalAI | Optional — CPU profile available | | n8n Workflows | Running |
What's Next — v2.5
- Soul Container: Persona middleware in
api.rsthat shapes Raphael's raw LLM output before it reaches Discord — injects "Notice, ..." prefixes on declarative statements, enforces first-person, removes AI hedging phrases unspeechVoice Proxy:moeru-ai/unspeechas an optional Docker service that normalizes STT/TTS backends (Whisper, Piper, ElevenLabs) behind a single OpenAI-compatible endpoint — enables Phase 8 voice work without coupling to any one provider- Wiki Container Rebuild: Apply the
NEXT_PUBLIC_API_URLfix so the browser-side wiki correctly targets the internal API endpoint
Roadmap
- [x] Phase 1 — Infrastructure Foundation
- [x] Phase 2 — AI Integration
- [x] Phase 3 — Wiki UI
- [x] Phase 4 — Autonomous Research Agents
- [x] Phase 5 — Vision Processing
- [x] Phase 6 — Auth, LocalAI, Plugins, Backfill
- [ ] v2.5 — Soul Container, Voice Proxy, Wiki Fix
- [ ] Phase 7 — Dynamic Plugin Ecosystem
- [ ] Phase 8 — Multi-Modal (Voice, YouTube Summaries)
- [ ] Phase 9 — Scale & Export (Obsidian vault, enterprise features)
- [ ] BOSS Integration — Visual states, studio ops control surface