{
  "markdown": "# Jarvis\n\n<p align=\"left\">\n  <a href=\"https://github.com/Ramsbaby/jarvis/stargazers\"><img src=\"https://img.shields.io/github/stars/Ramsbaby/jarvis?style=flat-square&logo=github\" alt=\"Stars\"></a>\n  <a href=\"https://github.com/Ramsbaby/jarvis/network/members\"><img src=\"https://img.shields.io/github/forks/Ramsbaby/jarvis?style=flat-square&logo=github\" alt=\"Forks\"></a>\n  <a href=\"https://github.com/Ramsbaby/jarvis/issues\"><img src=\"https://img.shields.io/github/issues/Ramsbaby/jarvis?style=flat-square\" alt=\"Issues\"></a>\n  <a href=\"https://github.com/Ramsbaby/jarvis/blob/main/LICENSE\"><img src=\"https://img.shields.io/github/license/Ramsbaby/jarvis?style=flat-square\" alt=\"License\"></a>\n  <img src=\"https://img.shields.io/github/last-commit/Ramsbaby/jarvis?style=flat-square\" alt=\"Last commit\">\n  <img src=\"https://img.shields.io/badge/Claude_Code-plugin-8A2BE2?style=flat-square&logo=anthropic\" alt=\"Claude Code plugin\">\n</p>\n\n\n<<<<<<< Updated upstream\n> **⚠️ Migration Notice (2026-04-17)**: Runtime data relocated from `~/.jarvis/` → `~/jarvis/runtime/`.\n=======\n> **⚠️ Migration Notice (2026-04-17)**: Runtime data relocated from `~/jarvis/runtime/` → `~/jarvis/runtime/`.\n>>>>>>> Stashed changes\n> Existing installations: `~/.jarvis` remains as a backward-compatible symlink through **2026-10-17** (D+180).\n> Fresh installs: use `~/jarvis/runtime/` directly. See [docs/A2-MIGRATION.md](infra/docs/A2-MIGRATION.md) (upcoming).\n\n> **🔧 Refactor Notice (2026-04-20)**: Modules `career-*` / `job-*` were renamed to `profile-*` / `inbox-*` in commit `e74f168` to reflect a more generic, owner-agnostic abstraction.\n> Legacy commit messages and closed issues may still reference the old names. **Current HEAD is the canonical naming.**\n\n> **📋 Recent Updates (2026-05-08 → 2026-06-27)**: 262 commits — the project grew ~40% since the last README refresh.\n> Highlights: **Compound Learning** (mistake clusters auto-promoted to permanent behavioural rules — the same error stops recurring) · **Proactive Owner State Engine** (infers your focus/mood and speaks first) · **Response Quality Gates** (auto-regenerates shallow or over-asserted replies) · **Image→Memory pipeline** (screenshots flow into long-term memory) · **3-tier notification routing** (severity-split channels).\n> **Scale now**: 358 automation scripts · 136 scheduled tasks · 170 LaunchAgents · 60+ skills. **Verified 7-day cron LLM cost: $9.42** (theoretical API price; $0 on a Claude subscription). See [CHANGELOG.md](CHANGELOG.md).\n\n> **🧩 Claude Code Plugins (2026-05-13)**: `jarvis-goal` · `jarvis-deep-interview` · `jarvis-plan-review` — Anthropic `/goal` port with irreversibility guard, Sorbh/interview-me convergent gating port, gstack `/plan-ceo-review` 11-section port. All OSS-safe English.\n> Install: `/plugin marketplace add Ramsbaby/jarvis` · See [.claude-plugin/marketplace.json](.claude-plugin/marketplace.json) for plugin details.\n\n<p align=\"center\">\n  <strong>AI operations platform that manages itself 24/7</strong><br>\n  Discord Bot + RAG Knowledge Base + Insight Layer + Self-Healing Automation\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/Ramsbaby/jarvis/stargazers\"><img src=\"https://img.shields.io/github/stars/Ramsbaby/jarvis?style=social\" alt=\"Stars\"></a>\n  <a href=\"https://github.com/Ramsbaby/jarvis/network/members\"><img src=\"https://img.shields.io/github/forks/Ramsbaby/jarvis?style=social\" alt=\"Forks\"></a>\n  <a href=\"https://github.com/Ramsbaby/jarvis/commits\"><img src=\"https://img.shields.io/github/last-commit/Ramsbaby/jarvis\" alt=\"Last commit\"></a>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License\">\n  <img src=\"https://img.shields.io/badge/Node.js-22+-green.svg\" alt=\"Node.js\">\n  <img src=\"https://img.shields.io/badge/Claude_CLI-Required-blue.svg\" alt=\"Claude CLI\">\n  <img src=\"https://img.shields.io/badge/Ollama-Optional-orange.svg\" alt=\"Ollama\">\n  <img src=\"https://img.shields.io/badge/Privacy-100%25_Local-brightgreen.svg\" alt=\"Privacy\">\n</p>\n\n<p align=\"center\">\n  <img src=\"docs/img/jarvis-demo-chat-en.png\" alt=\"Jarvis — AI Behavioural Analysis Chat + Insight Report\" width=\"700\">\n</p>\n<p align=\"center\"><em>Ask Jarvis anything — it analyses your behaviour patterns + daily auto-generated insight report</em></p>\n\n<p align=\"center\">\n  <img src=\"docs/img/jarvis-demo-system-en.png\" alt=\"Jarvis — System Health + Approval Workflow\" width=\"700\">\n</p>\n<p align=\"center\"><em>Dawn system health check (10 services) + L3 autonomous task approval workflow</em></p>\n\n---\n\n## What is Jarvis?\n\n> **\"An AI assistant that audits your systems, analyses news, and writes code — while you sleep.\"**\n\nMessage it on Discord and it chats. Send a voice message and it understands. Drop a file and it remembers.\nOvernight, 358 automation scripts run 136 scheduled tasks. If a service dies, it self-recovers within 3 minutes.\nEvery dawn, it analyses your behavioural patterns and responds knowing what you're focused on right now.\nZero API charges — runs on a Claude subscription. 100% of your data stays on your machine.\n\n**In short**: A personal AI operations platform. Runs 24/7, fixes itself when it breaks, gets smarter as you use it.\n\n### Architecture\n\n| Layer | Components | Role |\n|:---:|------|------|\n| **Interface** | Discord (text + voice) | 24/7 conversational UI. 60+ skills/commands, buttons, voice recognition |\n| **Brain** | Claude + 8 AI agent teams | Chat, analysis, code generation, decision-making |\n| **Harness** | Prompt Harness + Progressive Compaction + Session Handoff | Tiered prompt loading (77% token savings), 3-stage context management (40K/60K/80K), structured state transfer between sessions |\n| **Memory** | RAG (LanceDB) + **LLM Wiki** + Insight Layer + **Importance Gate** | 10,000+ doc search + Stateful wiki + behavioural metrics + Mem0-style scoring (score ≥ 3 only stored) |\n| **Defense** | BoundedMap + Error Ledger + API Semaphore + Failure Rule Engine | Memory leak prevention, silent error tracking, concurrent API protection, auto pattern matching for known failures |\n| **Automation** | 358 scripts + 136 scheduled tasks (170 LaunchAgents on macOS, PM2 on Linux) | Self-healing, dawn audits, news briefing, auto code execution |\n| **Integration** | MCP + Google Calendar + GitHub | External service connectivity |\n\n## Core Features\n\n| | Feature | Description |\n|---|---------|-------------|\n| 💬 | **Discord Bot** | 24/7 chat with streaming, voice recognition (Whisper STT), per-channel personas, 40+ slash commands |\n| 👥 | **Multi-User** | Per-user isolated memory, pairing codes for new users, family mode with privacy boundaries |\n| 📚 | **RAG Knowledge Base** | Long-term memory. BM25 + vector hybrid search across 10,000+ documents |\n| 🗂️ | **LLM Wiki** | [Karpathy's 3-layer pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) (Raw/Wiki/Schema). 4 ingest paths: realtime keyword routing, background LLM digest (Haiku), nightly batch synthesis (03:30), weekly lint (Sunday 04:00). Domain wikis (`career`/`trading`/`ops`/`knowledge`) + per-user pages. Feeds Discord bot, Board API, and Map NPCs. Knowledge compounds — new info updates existing pages, not appends |\n| 🧠 | **Insight Layer** | Daily auto-generated behavioural report — detects activity trends, focus shifts, situational context |\n| 📋 | **Dev-Queue** | AI-extracted action items auto-queued, then auto-executed by `jarvis-coder.sh` — hands-free development |\n| 🤖 | **8 AI Teams** | Council, Infra, Record, Brand, Career, Academy, Trend, Recon — each with specialised agents |\n| 🔧 | **Self-Healing** | Watchdog auto-restart, LaunchAgent guardian (3min), dawn code audits, cron failure tracking |\n| 🧬 | **Compound Learning** | Mistake clusters are auto-detected and promoted to permanent behavioural rules — the same error stops recurring because the *rule* accumulates, not just the one-off fix. Self-improving guard rails grow over time |\n| 👁️ | **Proactive Engagement** | An Owner State Engine infers your current focus and mood from activity signals and **speaks first** — not just reactive Q&A |\n| ✅ | **Response Quality Gates** | Auto-detects shallow, over-asserted, or emotionally-flat replies and regenerates them before they're sent |\n| 🏗️ | **Prompt Harness** | [Anthropic harness engineering](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) — Tier 0 (core, always <3KB) / Tier 1 (contextual, keyword-triggered). Progressive Compaction at 40K/60K/80K tokens. 77% system prompt reduction |\n| 🛡️ | **Defense Layers** | BoundedMap (memory leak prevention), Error Ledger (JSONL audit trail), API Semaphore (concurrent call protection), Failure Rule Engine (auto pattern learning), Symlink Health Check (hourly validation) |\n| 📢 | **Notification Formatter** | Cron messages get auto-headers (`> 🟢/🟡/🔴 taskname · HH:MM KST`), noise gate (suppress pure-success), severity-based Discord Embeds (Uptime Kuma pattern) |\n| 🔒 | **100% Local** | No cloud. No subscriptions. All data stays on your machine |\n| 🔌 | **MCP Integration** | Home Assistant, GitHub, Slack, Notion via [MCP ecosystem](https://github.com/topics/mcp-server) |\n\n## How Jarvis Compares\n\n|  | **Jarvis** | **Claude Memory** | **ChatGPT Memory** | **[OpenClaw](https://docs.openclaw.ai) Dreaming** |\n|---|:---:|:---:|:---:|:---:|\n| **Memory** | RAG + **LLM Wiki** + Insight Layer | File-based (CLAUDE.md + Auto Dream) | Inject-all (every memory, every turn) | 3-phase sleep cycle (Light → REM → Deep) |\n| **Trend Detection** | Yes (topic freq shifts, entity momentum) | No | No | Yes (REM-phase pattern extraction) |\n| **Automation** | 358 scripts + self-healing | No (CLI tool) | No | 1 cron (dreaming sweep) |\n| **Autonomous Coding** | Yes (Dev-Queue → jarvis-coder) | No | No | No |\n| **Multi-User** | Yes (isolated memory + family mode) | No (single user) | No (single user) | No (single agent) |\n| **Cost** | $0 (Claude subscription) | $0 (subscription) | $0 (free tier) | $0 (open source) |\n| **Data Location** | 100% local | Local (CLI) / Cloud (web) | Cloud (OpenAI servers) | Local |\n| **Interface** | Discord (text + voice) | Terminal / Web | Web / App | Terminal / Web |\n\n**What sets Jarvis apart**: It doesn't just remember — it **acts**. Memory + analysis + automation + self-healing in one system. Others stop at the memory layer; Jarvis uses memory to write code, recover services, and generate reports.\n\n## Platform Support\n\n| Platform | Status | Service Manager |\n|----------|:------:|-----------------|\n| **macOS** (primary) | Fully supported | LaunchAgents + cron |\n| **Linux / WSL2** | Fully supported | PM2 + cron |\n| **Docker** | Fully supported | PM2 (via `ecosystem.config.cjs`) |\n| **Windows (native)** | Not supported | Use WSL2 or Docker |\n\n> Cross-platform abstraction: `lib/compat.sh` auto-detects the OS and routes service commands (`launchctl` on macOS, `pm2` on Linux/WSL2).\n\n## Quick Start\n\n### Which plan do I need?\n\n| Setup | What you get | AI requirement | Cost |\n|-------|-------------|----------------|------|\n| **Standard** | Discord bot + 80 cron automations | Claude Max **or** Pro subscription | $20/mo (Pro) or $100/mo (Max) |\n| **Full** | Standard + RAG long-term memory | Claude subscription + Ollama (free, local) | same + 0 |\n\n> **Claude Max** = unlimited usage, best for 24/7 bot. **Claude Pro** = works fine, may hit rate limits under heavy use.\n> **Ollama** = free, open-source AI that runs locally. Only needed for RAG (document search + memory). The Discord bot itself runs on Claude.\n\n---\n\n### Step 0: Prerequisites\n\n1. **Claude Code CLI** (the brain)\n   ```bash\n   npm install -g @anthropic-ai/claude-code\n   claude   # opens browser to authenticate — log in with your Anthropic account\n   ```\n2. **Node.js 22+** and **Python 3.10+**\n   ```bash\n   node -v   # should be 22+\n   python3 --version\n   ```\n\n### Step 1: Get a Discord Bot Token\n\n> If you already have a token, skip to Step 2.\n\n1. Go to [Discord Developer Portal](https://discord.com/developers/applications)\n2. Click **\"New Application\"** → name it (e.g., \"Jarvis\") → **Create**\n3. Left sidebar → **\"Bot\"** tab → click **\"Reset Token\"** → **Copy the token** (save it!)\n4. Scroll down → enable **\"Message Content Intent\"** toggle → Save\n5. Left sidebar → **\"OAuth2\"** → **\"URL Generator\"**:\n   - Scopes: `bot`, `applications.commands`\n   - Bot permissions: `Send Messages`, `Read Message History`, `Attach Files`, `Use Slash Commands`\n6. Copy the generated URL → open in browser → invite the bot to your Discord server\n\n### Step 2: Clone & Setup\n\n```bash\ngit clone https://github.com/Ramsbaby/jarvis.git && cd jarvis\n```\n\n#### ⚡ Option A — Interactive Onboarding (Recommended)\n\nOpen the project in **Claude Code** and run:\n\n```\n/onboarding\n```\n\nThe onboarding wizard guides you through Steps 0–14 (idempotent — re-runnable safely):\n\n| Step | What it does |\n|------|-------------|\n| 0 | Checks Node.js 18+, git, Ollama (optional — RAG only) |\n| 1 | Detects installation state → **[V]** verify only / **[U]** update specific values / **[R]** full reinstall |\n| 2–5 | Collects tokens interactively — skips steps whose values are already configured |\n| 6 | Creates/updates `~/jarvis/runtime/.env` + 8 data directories — preserves existing values with `--merge` |\n| 7 | Runs `npm install` + copies `*.example.json` config templates (skips existing files) |\n| 8 | **RAG setup** (optional) — if Ollama detected, runs `python3 scripts/setup_rag.py` (~400MB model) |\n| 9 | Asks: **Auto-update** or **Manual-update**? (skips if policy already set) |\n| 10 | Creates `🚀jarvis-update` Discord channel + registers system persona |\n| 11 | Installs LaunchAgents (macOS) or PM2 + cron (Linux) — skips already-running agents |\n| 12 | Runs full verification: node_modules · bot syntax · data dirs · `.env` keys |\n| 13 | Confirms bot startup via log output |\n| 14 | Prints completion summary |\n\n**Auto-update**: When a new release is detected at 03:00 KST, Jarvis pulls latest code, syncs files, restarts the bot, and posts a notice to `#🚀jarvis-update`. Uses semver comparison (upstream > installed only).\n\n**Manual-update**: Posts a release alert to `#🚀jarvis-update` and waits for you to update.\n\n---\n\n#### Option B — Python Wizard\n\n```bash\npython scripts/setup_infra.py    # paste your Discord token when prompted\n```\n\nThe setup wizard will:\n- Check Node.js, create data directories\n- Ask for your **Discord bot token** (from Step 1)\n- Install dependencies and configure the bot\n\n> **Detailed guide**: [`infra/CLAUDE-SETUP-GUIDE.md`](infra/CLAUDE-SETUP-GUIDE.md) — MCP servers, personas, context setup, and troubleshooting\n\n### Step 3: RAG — Long-Term Memory (Optional, recommended)\n\nThis gives Jarvis the ability to search past conversations and documents.\n\n```bash\n# Install Ollama first (free, local AI for embeddings)\n# macOS:\nbrew install ollama && ollama serve\n\n# Linux:\ncurl -fsSL https://ollama.com/install.sh | sh && ollama serve\n\n# Then run RAG setup:\npython scripts/setup_rag.py    # downloads ~400MB embedding model, takes 2-5 min\n```\n\n### Platform-specific start\n\n**macOS** — auto-starts via LaunchAgent (setup_infra.py configures this)\n\n**WSL2 / Linux** — use PM2:\n```bash\nnpm install -g pm2\npm2 start infra/ecosystem.config.cjs\npm2 startup && pm2 save   # auto-start on boot\n```\n\n## Discord Bot\n\nA 24/7 interface powered by Claude with streaming responses.\n\n### Slash Commands\n\n| Command | Description |\n|---------|-------------|\n| `/search <query>` | RAG hybrid search across knowledge base |\n| `/remember <content>` | Save to long-term memory (auto-categorised: trading/work/family/travel/health) |\n| `/memory` | View your stored facts, preferences, corrections |\n| `/team <name>` | Summon an AI team (Council/Infra/Career/Academy/Trend/Recon...) |\n| `/run <task>` | Manually trigger a cron task (with autocomplete) |\n| `/schedule <task> <in>` | Schedule a task 30m/1h/2h/4h/8h from now |\n| `/status` | System health dashboard (disk/memory/cron) |\n| `/doctor` | Full health check + auto-fix (owner only) |\n| `/approve [draft]` | Approve a draft document → auto-apply |\n| `/commitments` | View unfulfilled promises Jarvis detected |\n| `/usage` | API cost & usage dashboard |\n| `/alert <msg>` | Send Discord + push notification (ntfy.sh) |\n| `/lounge` | Live activity feed of running tasks |\n| `/clear` | Reset channel conversation |\n| `/stop` | Cancel running Claude task |\n\n### Voice Recognition\n\nDiscord voice messages are automatically transcribed via **OpenAI Whisper** (Korean + multilingual). The transcribed text is processed by Claude with full RAG context — speak naturally, get AI-powered responses.\n\n### File Upload → Auto-Indexing\n\nDrop a file in Discord and it's automatically indexed into RAG. Your knowledge base grows as you chat.\n\n### Auto Memory Extraction with Importance Gate\n\nJarvis detects important information in conversations and auto-extracts it to long-term memory — preferences, facts, corrections. No manual `/remember` needed.\n\nEach extracted fact is scored 1-5 by the LLM ([Mem0 pattern](https://arxiv.org/abs/2504.19413)). **Only score ≥ 3 is stored** — reduces memory bloat by 40-60%. Say \"잊어줘\" (forget this) to delete specific facts.\n\n### Interactive Buttons\n\nEvery response includes contextual action buttons:\n- **Cancel** — stop in-progress Claude tasks\n- **Regen** — re-run the last query\n- **Summarize** — get a summary of the response\n- **Approve / Reject** — for L3 autonomous task approval workflow\n\n### Multi-User & Family Mode\n\n- Each Discord user gets **isolated memory** (facts, preferences, corrections, plans)\n- New users join via **pairing code** (6-digit, 10min TTL, owner approval)\n- **Family channels** automatically filter out owner's private data (configurable sensitive domains)\n- Per-channel **personas** — different personality per channel (`personas.json`)\n- **Message debouncing** — consecutive messages batched (1.5s) into single Claude call\n\n## Memory Architecture\n\nThree layers work together — LLM Wiki accumulates structured knowledge, RAG retrieves raw context, the Insight Layer understands behavioural patterns.\n\n```\n🗂️  LLM Wiki (daily digest)          📚 RAG Layer (per-query)          📊 Insight Layer (daily)\n  profile.md / work.md /               semantic search across              \"topic frequency shift detected\"\n  trading.md / projects.md             10,000+ indexed documents           \"domain focus transition\"\n  (Stateful — pages updated,                    │                                    │\n   not just appended)                           │                                    │\n              │                                 │                                    │\n              └─────────────────┬───────────────┘────────────────────────────────────┘\n                                ▼\n                       Claude responds with\n                       full situational awareness\n```\n\n### LLM Wiki\n\nInspired by [Andrej Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f). Transforms raw conversation sessions into a **Stateful, compounding knowledge base**.\n\n| | Traditional RAG | LLM Wiki |\n|---|---|---|\n| **Storage** | Raw text chunks | Structured `.md` wiki pages |\n| **State** | Stateless (re-search each query) | Stateful (pages updated, not appended) |\n| **Processing** | Index → retrieve | Claude Haiku digests → integrates into existing pages |\n| **Growth** | Accumulates independently | Compounds — new info updates existing knowledge |\n\n**7 wiki categories** (`~/jarvis/runtime/wiki/pages/{userId}/`):\n\n| Page | Captures |\n|------|---------|\n| `profile.md` | Name, job, family basics |\n| `work.md` | Tech stack, work context, professional goals |\n| `trading.md` | Portfolio, investment strategy, watchlist |\n| `projects.md` | Ongoing projects (Jarvis bot, side projects) |\n| `preferences.md` | Habits, likes/dislikes, routines |\n| `health.md` | Exercise, health, sleep patterns |\n| `travel.md` | Trip records and plans |\n\n**How it works**: Every night (03:00) the session summariser digests today's conversations via Claude Haiku → new facts are routed to the correct wiki page → pages are updated (not just appended) → context is injected into the next session's system prompt.\n\n### RAG Knowledge Base + Insight Layer\n\nTwo additional layers work together — RAG retrieves raw facts, the Insight Layer understands context.\n\n```\n📊 Insight Layer (daily, ~1.2KB)                 📚 RAG Layer (per-query)\n  \"topic frequency shift detected\"                  semantic search across\n  \"domain focus transition\"                         10,000+ indexed documents\n              │                                              │\n              └──────────────┬───────────────────────────────┘\n                             ▼\n                    Claude responds with\n                    full situational awareness\n```\n\n### Insight Layer\n\nAutomated behavioural analysis, generated daily at 04:15:\n\n| Step | Script | LLM | Cost |\n|------|--------|:---:|:----:|\n| Metrics collection | `insight-metrics.mjs` | None | $0 |\n| Interpretation | `insight-distill.mjs` | Claude | ~$0.03 |\n\nDetects: topic frequency shifts, cross-domain correlations, entity momentum, daily activity patterns. Integrates Google Calendar for D-day awareness. Output loaded into every system prompt automatically.\n\n### RAG\n\nHybrid search: BM25 full-text + Ollama vector similarity (`snowflake-arctic-embed2`, 1024-dim).\n\n| Spec | Value |\n|------|-------|\n| **Vector DB** | LanceDB (local, embedded) |\n| **Embedding** | Ollama snowflake-arctic-embed2 |\n| **Indexing** | Incremental every 4h, entity-graph daily |\n| **Search** | BM25 + vector hybrid (RRF k=60) + GraphRAG expansion |\n| **Smart filters** | Auto-excludes dev docs, filters family-sensitive data |\n\nSee [`rag/README.md`](rag/README.md) for details.\n\n## Dev-Queue — Autonomous Development\n\nJarvis doesn't just chat — it **writes code**.\n\n1. **Insight Extractor** analyses task results and news, auto-extracts high-priority action items\n2. Items are queued in **SQLite task store** with FSM state tracking (PENDING → RUNNING → SUCCESS/FAILED)\n3. **`jarvis-coder.sh`** picks up queued tasks and executes them via Claude — automated commits, fixes, improvements\n4. Skip patterns prevent recursive self-modification (manual tasks and self-referential items are filtered)\n\n## Self-Healing Automation\n\n<p align=\"center\">\n  <img src=\"docs/img/discord-system-health.png\" alt=\"System Health Check\" width=\"700\">\n</p>\n<p align=\"center\"><em>Automated system health check: 10 services monitored every 6 hours</em></p>\n\nJarvis doesn't just run — it **heals itself**. 358 automation scripts, 170 LaunchAgents, 136 scheduled tasks. Multi-layer self-recovery + systemic defense:\n\n**Harness (Anthropic 4-function pattern)**:\n- **Guides**: Tiered prompt loading — Tier 0 (always, <3KB) / Tier 1 (keyword-triggered)\n- **Sensors**: Session Handoff (structured state transfer) + Progressive Compaction (40K/60K/80K)\n- **Verification**: Tool Call Ledger (per-invocation JSONL audit) + Error Ledger (silent error tracking)\n- **Correction**: Failure Rule Engine (auto pattern learning + Bayesian confidence scoring)\n\n| | What it does | When |\n|---|---|---|\n| 🔄 | **Auto-Recovery** — watchdog detects crashed services, restarts them. Guardian re-registers unloaded daemons every 3 min | 24/7 |\n| 🔍 | **Dawn Audit** — scans cron health, RAG integrity, bot status. `jarvis-auditor.sh` + `scorecard-enforcer.sh` reports anomalies before you wake up | Daily 06:00 |\n| 📊 | **Insight Report** — behavioural metrics analysis → situational awareness context for every response | Daily 04:15 |\n| 🧪 | **E2E Testing** — `e2e-test.sh` validates 50 system components. `weekly-code-review.sh` runs automated code quality audits | Weekly |\n| 📚 | **RAG Pipeline** — incremental indexing (4h), entity-graph (03:45), weekly compaction (Sun 04:00), file watcher for real-time updates | Scheduled |\n| 📡 | **Health Monitor** — 10 services monitored, disk/memory alerts. Discord + ntfy.sh push notifications on threshold breach | Every 6h |\n| 📈 | **Cron Failure Tracker** — `cron-failure-tracker.sh` tracks success rates, detects degradation trends | Continuous |\n| 🚀 | **Safe Deployment** — smoke tests, graceful restart, log rotation. Zero-downtime updates | On demand |\n| 📰 | **News Briefing** — AI/Tech news curation with dev-queue suggestions | Daily |\n\n### 8 AI Agent Teams\n\nSummon specialised teams via `/team <name>`:\n\n| Team | Role |\n|------|------|\n| **Council** | CEO-level system review — stability + market + OKR decisions |\n| **Infra** | Infrastructure chief — cron/LaunchAgent/disk/memory audits |\n| **Record** | Meeting notes + decision audit log |\n| **Brand** | Blog content + portfolio management |\n| **Career** | Professional development + learning plans |\n| **Academy** | Learning plans + skill development |\n| **Trend** | Market signals + tech trend analysis |\n| **Recon** | Reconnaissance — competitive intelligence |\n\n### Board Meeting AI\n\nAutomated executive review system. 4 AI agents convene daily:\n\n| Agent | Role |\n|-------|------|\n| **CEO** | Final decisions — system stability + market + OKR progress |\n| **Infra Chief** | Uptime, error rates, performance metrics |\n| **Strategy Advisor** | Market signals, investment analysis, strategic planning |\n| **Record Keeper** | Meeting minutes, decision audit log |\n\nOutput: `context-bus.md` (shared context) + `decisions/{date}.jsonl` + `board-minutes/{date}.md`\n\n### Smart Features\n\n| Feature | Description |\n|---------|-------------|\n| **Zero-Cost Automation** | All cron tasks run via `claude -p` (subscription) — no per-token API charges |\n| **Commitment Tracking** | Auto-detects promises in Claude responses, tracks fulfilment |\n| **L3 Approval Workflow** | Autonomous tasks request human approval via Discord buttons (24h TTL) |\n| **Context Budget** | Auto-classifies prompt complexity, adjusts thinking depth |\n| **Visual Generation** | Charts (ChartJS) + tables (Puppeteer) rendered as images, cached by SHA256 |\n| **Stat Cards** | \"disk?\", \"RAG status?\" → auto-generates visual embed cards |\n| **Langfuse Observability** | Prompt tracing, cost tracking, error rates, latency monitoring |\n| **Rate Limiting** | Per-user token budget + semaphore concurrency control (max 3) |\n| **i18n** | Korean + multilingual support |\n\n## Where Jarvis Stores Things\n\n**Two directories, one reason** — code and your data live apart so updates can never touch your stuff.\n\n- **`~/jarvis/`** — the recipe book (this git repo; replaced on every update)\n- **`~/jarvis/runtime/`** — your fridge (tokens, chat history, RAG DB, personal configs; never touched by `git pull`)\n\nSame pattern as `~/.ssh` or `~/.aws` — the tool is shared, your data is yours. A phone OS update doesn't delete your photos; a `git pull` here doesn't delete your memory. `~/jarvis/runtime/private/` (repo-ignored) is the correct home for personal helper scripts that a public repo shouldn't carry.\n\nSince the A2 migration (2026-04-17), `~/jarvis/runtime/` is a symlink to `~/jarvis/runtime/` so the two paths resolve to the same files. Code-containing subdirectories (`bin/`, `lib/`, `scripts/`, `infra/`) are further symlinked into the repo so crons reference stable paths; everything else (`config/`, `data/`, `logs/`, `state/`, `ledger/`, `private/`, `wiki/`, `rag/`) is a real directory that holds only your data.\n\n## Project Structure\n\n```\njarvis/\n├── rag/                 # RAG module (LanceDB + Ollama + Insight Layer)\n│   ├── lib/             # Core engine, query, paths\n│   └── bin/             # Indexer, metrics, distiller, repair\n├── infra/               # Infrastructure & automation\n│   ├── discord/         # Discord bot + 30 handlers\n│   │   └── lib/\n│   │       ├── wiki-engine.mjs    # LLM Wiki CRUD + 7-category schema\n│   │       └── wiki-ingester.mjs  # Claude Haiku session digest pipeline\n│   ├── lib/             # Core libraries (MCP, task-store, insight-extractor)\n│   ├── bin/             # Cron executables (jarvis-cron, jarvis-coder, bot-cron)\n│   ├── scripts/         # Auditors, e2e tests, code review, deployment\n│   ├── config/          # Tasks, personas, channels, monitoring\n│   ├── agents/          # 8 AI team profiles\n│   └── templates/       # Cron & LaunchAgent templates\n├── scripts/             # Setup wizards\n└── docs/img/            # Screenshots\n```\n\n**Runtime wiki storage** (`~/jarvis/runtime/wiki/`):\n```\n~/jarvis/runtime/wiki/\n  schema.json            # Wiki structure rules\n  pages/{userId}/\n    profile.md / work.md / trading.md / projects.md\n    preferences.md / health.md / travel.md\n```\n\n<details>\n<summary><strong>Security</strong></summary>\n\n- **gitleaks** pre-commit hook scans for secrets before every commit\n- **`private/`** directory excluded from git for sensitive data\n- Family channel privacy boundaries (owner data filtered)\n- Pairing codes with TTL for new user onboarding\n\n</details>\n\n<details>\n<summary><strong>Troubleshooting</strong></summary>\n\n- **Discord bot won't start** — check `.env` has valid `DISCORD_TOKEN`\n- **Bot ignores messages** — enable `MESSAGE_CONTENT_INTENT` in Discord Developer Portal → Bot → Privileged Intents\n- **No MCP tools** — copy `config/discord-mcp.example.json` to `config/discord-mcp.json` and set paths\n- **Cron tasks fail** — verify `claude` CLI is installed and `CLAUDE_BINARY` path is correct in `.env`\n- **RAG returns no results** — `cd rag && npm run stats` to check DB status\n- **macOS: \"gtimeout not found\"** — `brew install coreutils`\n- **Full troubleshooting**: [`infra/CLAUDE-SETUP-GUIDE.md`](infra/CLAUDE-SETUP-GUIDE.md#6-troubleshooting)\n\n</details>\n\n## Contributing & Support\n\nJarvis is built in the open. If it helped you — or you just find the architecture interesting — **a ⭐ means a lot** and helps others discover it.\n\n- 🐛 **Found a bug or have an idea?** Open an [issue](https://github.com/Ramsbaby/jarvis/issues).\n- 🔧 **Want to contribute?** PRs welcome — see the [project structure](#project-structure) to get oriented.\n- 💬 **Questions?** Start a [discussion](https://github.com/Ramsbaby/jarvis/discussions).\n\n## License\n\n[MIT](LICENSE)\n\n---\n\n<p align=\"center\">\n  <a href=\"README.ko.md\">🇰🇷 한국어</a>\n</p>\n",
  "bytes": 30195,
  "sha": "944ae98043b9166ca45a474d4735251375acccc2e40b1c8b0c292eebd7135c4e",
  "repo_slug": "ramsbaby/jarvis",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_ramsbaby_jarvis_jarvis_plan_review_85f81d46/readme"
}