OmniBrain: Oracle RAG Self-Hosted para Slack & Notion
mahendra-shah/org-brain
Oracle RAG self-hosted para Slack com roteamento multi-LLM e cache eficiente
Ver no GitHubMCP server enterprise que funciona como cérebro central da organização, integrando Slack e Notion via RAG (Retrieval-Augmented Generation) com roteamento multi-LLM inteligente. Oferece busca e síntese de informações em tempo real com failover automático entre provedores e cache otimizado para reduzir custos de tokens em até 80%.
Instalação
npx convez-ai mahendra-shah/org-brain1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Busca e síntese de informações em workspaces Slack conectados a Notion
- Automação de respostas a perguntas organizacionais com contexto dinâmico
- Dashboard de custo de tokens com análise comparativa entre provedores LLM
Veredito

Solução sólida para empresas que precisam de RAG on-premise com alta resiliência e otimização de custos. O roteamento multi-LLM com failover automático e cache local são diferenciadores reais, mas exige expertise em DevOps e configuração de MCP servers para produção.
README
A tradução para o português deste README ainda está na fila.
OmniBrain: Self-Hosted Workspace RAG Oracle for Slack & Web
OmniBrain is an enterprise-grade, highly resilient, and cost-efficient self-hosted RAG (Retrieval-Augmented Generation) system. It connects Slack and a sleek glassmorphic Web QA UI to your Notion workspace using the official Notion Model Context Protocol (MCP) Server. OmniBrain orchestrates advanced multi-LLM routing to answer complex organization questions, manage tasks, and track projects in real-time.
Engineered for production reliability, it implements automated multi-LLM failover (DeepSeek ➡️ Gemini ➡️ Claude), subprocess supervisor watchdogs, local token-saving caching, input content safety filters, and Slack event de-duplication.
✨ Premium Capabilities
- Router-Generator Split (Single-Turn RAG): Slashes input token costs by 80%+ and reduces RAG latency by converting multi-turn tool calling into a predictable, single-round parallel flow.
- Active Multi-LLM Failover: Automatically switches providers (e.g., DeepSeek to Gemini or Claude) during API outages, network timeouts, or rate limits.
- Dynamic Identity Resolution: Resolves Slack users' names and emails against workspace profiles to answer self-referential queries ("what are my tasks?") dynamically without hardcoded IDs.
- Subprocess MCP Supervisor: Spawns and monitors the Notion MCP server over secure
stdiochannels with auto-restart on unexpected crashes. - Local Server-Side Caching: Fast 15-minute in-memory TTL caching with thread-aware history hashing (serves repeated thread queries in 0ms).
- Interactive Cost Dashboard: Glassmorphic UI to track token usage, region costs (ap-south-1 Mumbai), and comparative savings.
- Schema Safety Guardrails: Programmatically checks property types and blocks invalid Notion filters that trigger 400 Bad Request errors.
🚀 Architecture Blueprint
flowchart TD
%% Node Styling Definitions
classDef userNode fill:#3b82f6,stroke:#1d4ed8,stroke-width:2px,color:#fff;
classDef serviceNode fill:#8b5cf6,stroke:#6d28d9,stroke-width:2px,color:#fff;
classDef cacheNode fill:#10b981,stroke:#047857,stroke-width:2px,color:#fff;
classDef llmNode fill:#f59e0b,stroke:#d97706,stroke-width:2px,color:#fff;
classDef mcpNode fill:#ef4444,stroke:#b91c1c,stroke-width:2px,color:#fff;
%% Elements
User["User: Slack / Web UI"]
App["OmniBrain Service"]
Cache{"Memory Cache"}
Router["LLM Router"]
Notion["Notion MCP Server"]
Gen["LLM Generator"]
class User userNode;
class App serviceNode;
class Cache cacheNode;
class Router llmNode;
class Notion mcpNode;
class Gen llmNode;
%% Flow Path
User -->|1. Submit Query| App
App -->|2. Check Cache| Cache
%% Cache Hit Pathway
Cache -->|Cache Hit| User
%% Cache Miss Pathway (Full RAG)
Cache -->|3. Cache Miss| Router
Router -->|4. Search Plan| App
App -->|5. Run Parallel Queries| Notion
Notion -->|6. Return Context| App
App -->|7. Synthesize Answer| Gen
Gen -->|8. Return Answer| App
App -->|9. Update Cache| Cache
App -->|10. Deliver Response| User
⚙️ Configuration Setup
Configure your environment settings using the provided template in .env.example. Copy the template to .env in the root directory:
cp .env.example .env
Critical Environment Settings
Only a few variables are required to get started. For the full list of options, see .env.example.
# Selected LLM Provider ("deepseek", "gemini", or "claude")
LLM_PROVIDER=deepseek
# API Keys (Configure keys for your active providers and fallbacks)
DEEPSEEK_API_KEY=your_deepseek_api_key
GEMINI_API_KEY=your_gemini_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
# Notion Integration
NOTION_API_TOKEN=secret_your_notion_token
📂 Project Structure
src/index.ts— App entry point coordinating Slack Bolt and Express.src/config.ts— Validates and loads environment settings.src/llm.ts— Multi-LLM client supporting DeepSeek, Gemini, and Claude with automatic failover.src/mcp.ts— Monitors and supervises the Notion MCP subprocess client.src/rag.ts— RAG core coordinating router-generator split, caches, and context.src/server.ts— Express server hosting the API routes and Web QA Dashboard.src/utils/— Notion helpers, response formatters, and safety filters.
🛠️ Getting Started
Prerequisites
- Node.js (v18+)
- Notion Integration Token (Notion Developers Portal)
- Slack Bot Configuration (Socket Mode enabled)
Installation & Run
-
Install dependencies:
npm install -
Build TypeScript files:
npm run build -
Start the application:
npm start
Once started, the console will show Notion database pre-caching, Slack Bolt connection setup, and local web dashboard availability.
🧪 Verification & QA Dashboard
Automated Tests
Run the standalone sandbox scenarios (which verify task fetching, user mapping, and search workflows offline):
npx tsx tests/run-batch-tests.ts
Local Web UI
When the server is active, visit:
- Interactive Chat UI:
http://localhost:3000(test questions and inspect raw citations). - Cost Report Dashboard:
http://localhost:3000/cost_report.html(compare cost savings, toggle currency exchange rates, and evaluate token models).
🛡️ Resiliency & Safeguards
- Failure-Proof Failover: Automatic degradation to secondary LLMs if primary APIs fail, protecting critical client integrations.
- Supervisor Watchdog: Automatically restarts the Notion MCP stdio subprocess within 3 seconds of a crash.
- Safe Slack mrkdwn Formatting: Natively formats lists, bold text, checkboxes (
[ ]➡️ ⬜,[x]➡️ ✅), and links into Slack-supported markdown.