Model Registry: - Add per-user custom roles (add/remove via UI); required roles chat/orchestrator/distill are always present and cannot be removed - Auto-migrate legacy .env-defined roles to custom_roles on first access - Role config panel (gear): Remove role button moved inside panel; required badge below name - Role select: Primary + Backup slots only (was three) Settings pages — Tailwind CSS migration (CDN, preflight: false): - local_llm.html, settings.html, help.html, notifications.html, tools_settings.html, crons.html, integrations.html all migrated; pg-* color tokens; dark/light via data-theme pg.css fixes: - input[type=checkbox/radio]: width: auto — prevents pg.css width:100% from stretching checkboxes - btn-submit: responsive sizing via Tailwind w-full md:w-96 on each button (no longer full-width on desktop) Documentation: - MASTER.md, TODO__Agents.md: remove "/ Inara" from titles; description updated to "per-user AI personas" - HELP.md: persona-agnostic language throughout (NC Talk, Google Chat, push, schedules, HA sections); roles section restructured to show required vs. custom roles with examples - notifications.html: subtitle and HA description use "your persona" not "Inara" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
110 lines
6.5 KiB
Markdown
110 lines
6.5 KiB
Markdown
# Cortex — Master Index
|
|
|
|
> Start here. This document is a map, not a manual.
|
|
> Last updated: 2026-05-13
|
|
>
|
|
> **Documentation philosophy:** Cortex is a no-black-box system. Docs must match reality.
|
|
> Update docs before implementing significant changes. Verify they still match after.
|
|
|
|
---
|
|
|
|
## What It Is
|
|
|
|
Cortex is a self-hosted personal AI platform. It routes messages from any input channel to AI backends, manages per-user AI personas with persistent memory, and coordinates across a fleet of machines. It is infrastructure, not a product.
|
|
|
|
**Running at:** `https://cortex.dgrzone.com` | `systemctl --user restart cortex`
|
|
|
|
---
|
|
|
|
## Current State
|
|
|
|
| Component | Status | Notes |
|
|
|---|---|---|
|
|
| Web UI | ✅ Live | SPA, dark theme, mobile-responsive, PWA-installable |
|
|
| Nextcloud Talk bot | ✅ Live | HMAC-signed, per-user routing |
|
|
| Google Chat Add-on | ✅ Live | JWT-verified, per-user routing |
|
|
| Claude backend | ✅ Live | Primary — via Claude Code CLI |
|
|
| Gemini backend | ✅ Live | Fallback — via Gemini CLI |
|
|
| Local backend | ✅ Live | Open WebUI/Ollama on scott_gaming; per-user multi-model config |
|
|
| Gemini orchestrator | ✅ Live | Tool loop → Claude response, ⚡ toggle in UI (62 tools) |
|
|
| Local orchestrator | ✅ Live | OpenAI-compatible ReAct loop; used when orchestrator role → local model |
|
|
| Model registry V2 | ✅ Live | Providers (Anthropic/Google/Local), multi-account Gemini, role assignments |
|
|
| Memory distillation | ✅ Live | Short (daily) / Mid (weekly) / Long (monthly) |
|
|
| Multi-user | ✅ Live | Scott, Holly, Brian — each with own personas |
|
|
| Session search | ✅ Live | Full-text search across past session logs |
|
|
| Proactive cron | ✅ Live | 5 job types: `remind`, `note`, `message`, `brief`, `task` (full orchestrator loop) → NC Talk / web push |
|
|
| Schedules web UI | ✅ Live | `/settings/crons` — view, add, edit, pause/resume, delete jobs without going through the AI |
|
|
| Tool audit log | ✅ Live | Every orchestrator tool call logged to `home/{user}/tool_audit/` |
|
|
| Token usage tracking | ✅ Live | Per-user daily buckets in `home/{user}/usage.json`; visible in Settings |
|
|
| Web push notifications | ✅ Live | VAPID push; `web_push` orchestrator tool; subscribe via ☰ menu |
|
|
| Proactive notifications | ✅ Live | Daily reminder check (09:00); distill/cron completion alerts; dedicated `/settings/notifications` page |
|
|
| Sub-agent spawning | ✅ Live | `spawn_agent` tool — synchronous sub-agents via any configured model |
|
|
| Agent private notes | ✅ Live | `AGENT_NOTES.md` — orchestrator-only notepad; 3 rolling backups; user-visible as read-only |
|
|
| Distill safety | ✅ Live | Per-persona asyncio lock, per-endpoint cooldowns, Rebuild option |
|
|
| Guided onboarding | ✅ Live | Setup Step 3 for OpenRouter; existing-user banner; settings quick-link |
|
|
|
|
**65 orchestrator tools** across 17 domain modules — added 2026-05-12: `file_diff`, `git_status` / `git_log` / `git_diff` (read-only git inspection), `ae_db_query` / `ae_db_describe` / `ae_db_show_view` (SELECT-only Aether MariaDB access, admin, per-user credentials). `/settings/integrations` page added (admin-only). File attachments in chat (images for vision-capable local models; text/code files for all backends). Settings pages unified under `pg.css`. Added 2026-05-13: `task` cron type (full orchestrator loop on a schedule); monthly/yearly schedule formats (`monthly`, `monthly:DD:HH:MM`, `yearly:MM:DD:HH:MM`); Schedules web UI at `/settings/crons` (list, add, edit, pause, delete); HA inbound webhook tools toggle (orchestrator vs. direct LLM); Anthropic API key backend (`anthropic_api` model type via Anthropic SDK — alternative to CLI OAuth); Cloud APIs catalog in Model Registry — named provider picker (OpenRouter, OpenAI, Groq, X.ai/Grok, Together.ai, Fireworks.ai, Custom) with auto-filled URLs; hosts split into Cloud APIs / Local Hosts sections. Added 2026-05-15: Per-user custom roles — three required roles (`chat`, `orchestrator`, `distill`) are always present; users can add/remove custom roles (e.g. `coder`, `research`) via the Model Registry UI; existing `.env`-defined roles auto-migrated. Settings pages (`local_llm.html` + all settings pages) migrated to Tailwind CSS CDN (no build step); `preflight: false` preserves `pg.css` base styles; `input[type=checkbox/radio]` global width fix in `pg.css`; `btn-submit` now responsive (`w-full md:w-96`).
|
|
|
|
**Active users / personas:** scott/inara, holly/tina, brian/wintermute
|
|
|
|
---
|
|
|
|
## Document Map
|
|
|
|
### Project-Level
|
|
| Doc | What it covers |
|
|
|---|---|
|
|
| **This file** | Index and current state |
|
|
| [`CORTEX.md`](../CORTEX.md) | Vision, philosophy, "what it is and isn't" |
|
|
| [`ROADMAP.md`](ROADMAP.md) | Phases — what's done, what's next, what's deferred |
|
|
| [`TODO__Agents.md`](TODO__Agents.md) | Active task list — read before starting work |
|
|
|
|
### Architecture
|
|
| Doc | What it covers |
|
|
|---|---|
|
|
| [`ARCH__SYSTEM.md`](ARCH__SYSTEM.md) | Overall architecture, component map, key design decisions |
|
|
| [`ARCH__BACKENDS.md`](ARCH__BACKENDS.md) | LLM backends, routing, fallback, per-user config |
|
|
| [`ARCH__PERSONA.md`](ARCH__PERSONA.md) | Persona system, context tiers, memory distillation |
|
|
| [`ARCH__CHANNELS.md`](ARCH__CHANNELS.md) | Input channels — web, NC Talk, Google Chat, cron |
|
|
| [`ARCH__FUTURE.md`](ARCH__FUTURE.md) | Planned: local orchestrator, dev agents, knowledge layer |
|
|
|
|
### Setup & Reference
|
|
| Doc | What it covers |
|
|
|---|---|
|
|
| [`docs/NEXTCLOUD_TALK_BOT.md`](../docs/NEXTCLOUD_TALK_BOT.md) | NC Talk bot setup and troubleshooting |
|
|
| [`docs/GOOGLE_CHAT_BOT.md`](../docs/GOOGLE_CHAT_BOT.md) | Google Chat Add-on setup |
|
|
| [`docs/OPEN_WEBUI_API.md`](../docs/OPEN_WEBUI_API.md) | Open WebUI/Ollama API reference for local model work |
|
|
|
|
### Code-Level
|
|
| Doc | What it covers |
|
|
|---|---|
|
|
| [`CLAUDE.md`](../CLAUDE.md) | Project instructions for Claude Code — directory map, run commands, design decisions |
|
|
| [`README.md`](../README.md) | Project root orientation, quick-start, user management |
|
|
| [`cortex/static/HELP.md`](../cortex/static/HELP.md) | In-app help (rendered in UI for all users) |
|
|
| [`SELF_UPDATE.md`](SELF_UPDATE.md) | Bootstrap for agents doing self-maintenance — git, Syncthing, scripts, doc checklist |
|
|
|
|
---
|
|
|
|
## Quick Reference
|
|
|
|
**Start the service / check logs**
|
|
```bash
|
|
systemctl --user restart cortex
|
|
journalctl --user -u cortex -f
|
|
```
|
|
|
|
**Syntax check before restart**
|
|
```bash
|
|
python3 -m py_compile cortex/<file>.py
|
|
```
|
|
|
|
**Add a user**
|
|
```bash
|
|
cd cortex && .venv/bin/python manage_passwords.py invite <username> <email>
|
|
```
|
|
|
|
**Run tests**
|
|
```bash
|
|
cd cortex && .venv/bin/python -m pytest tests/ -q
|
|
```
|