diff --git a/.env.default b/.env.default deleted file mode 100644 index 23b466c..0000000 --- a/.env.default +++ /dev/null @@ -1,97 +0,0 @@ -# Cortex .env reference — copy to .env and fill in values -# DO NOT commit .env — it contains secrets - -# ── Agent identity ─────────────────────────────────────────────────────────── -# Global display names used in distillation prompts and session logs. -# Individual persona identities live in home/{username}/persona/{name}/IDENTITY.md -AGENT_NAME=Inara -USER_NAME=Scott - -# ── Home directory ──────────────────────────────────────────────────────────── -# Root for all user/persona data. Layout: home/{username}/persona/{name}/ -# Relative paths are resolved from the cortex/ directory. -# Default: ../home (i.e. Cortex_and_Inara_dev/home/) -# HOME_DIR=../home - -# ── Google OAuth — "Sign in with Google" ──────────────────────────────────── -# Create credentials at console.cloud.google.com → APIs & Services → Credentials -# Application type: Web Application -# Authorised redirect URI: https://cortex.dgrzone.com/auth/google/callback -# Pre-register users: cd cortex && .venv/bin/python manage_passwords.py google-add -# Per-user Gemini key: add "gemini_api_key": "AIza..." to home/{username}/auth.json -GOOGLE_CLIENT_ID= -GOOGLE_CLIENT_SECRET= - -# ── Session auth ───────────────────────────────────────────────────────────── -# Generate with: python3 -c "import secrets; print(secrets.token_hex(32))" -JWT_SECRET=change-me-in-dotenv -JWT_EXPIRE_DAYS=30 - -# ── SMTP (invite emails + future notifications) ─────────────────────────────── -SMTP_SERVER=linode.oneskyit.com -SMTP_PORT=465 -SMTP_USERNAME=send_mail -SMTP_PASSWORD= -SMTP_FROM_EMAIL=noreply@oneskyit.com -SMTP_FROM_NAME=Cortex -# Base URL included in invite links -CORTEX_BASE_URL=https://cortex.dgrzone.com - -# ── Server ────────────────────────────────────────────────────────────────── -HOST=0.0.0.0 -PORT=8000 - -# ── Google Chat bot ────────────────────────────────────────────────────────── -# JWT audience for verifying inbound Workspace Add-on Chat webhook requests. -# For Workspace Add-on Chat apps, the aud claim = the endpoint URL. -# Leave blank to disable verification (dev/testing only). -GOOGLE_CHAT_AUDIENCE=https://cortex.dgrzone.com/channels/google-chat - -# ── Nextcloud Talk bot ─────────────────────────────────────────────────────── -NEXTCLOUD_URL=https://cloud.dgrzone.com -NEXTCLOUD_TALK_BOT_SECRET= - -# ── LLM backends ──────────────────────────────────────────────────────────── -# Primary backend: "claude" or "gemini" (other is always fallback) -PRIMARY_BACKEND=claude - -# Timeouts in seconds -TIMEOUT_CLAUDE=60 -TIMEOUT_GEMINI=120 - -# ── Orchestrator (Gemini API — not Gemini CLI) ─────────────────────────────── -# Required for /orchestrate endpoint and tool use -# Free tier key: https://aistudio.google.com/apikey -GEMINI_API_KEY= - -# Model for the orchestration tool loop (not the user-facing response) -ORCHESTRATOR_MODEL=gemini-2.5-flash - -# Safety cap on tool loop iterations -ORCHESTRATOR_MAX_ROUNDS=10 - -# ── DuckDuckGo search ──────────────────────────────────────────────────────── -# Leave blank for free unauthenticated tier -# Set to your API key for higher rate limits (paid DuckDuckGo account) -DDG_API_KEY= -DDG_MAX_RESULTS=5 - -# ── Aether Platform API ─────────────────────────────────────────────────────── -# Used by orchestrator tools: ae_journal_search, ae_journal_entry_create, ae_task_list -# Same values as agents_sync/mcp/.env — copy from there -AE_API_URL=https://dev-api.oneskyit.com -AE_API_KEY= -AE_ACCOUNT_ID= -AE_API_TIMEOUT=15 - -# ── Distillation schedule ──────────────────────────────────────────────────── -SCHEDULER_TIMEZONE=America/New_York -AUTO_DISTILL=true -AUTO_DISTILL_SHORT=true -AUTO_DISTILL_MID=true -AUTO_DISTILL_LONG=false # manual review recommended before enabling - -# Memory tier token budgets (soft caps) -MEMORY_BUDGET_SHORT=3000 -MEMORY_BUDGET_MID=2000 -MEMORY_BUDGET_LONG=2000 diff --git a/cortex/.env.example b/cortex/.env.example index bd5c06e..23b466c 100644 --- a/cortex/.env.example +++ b/cortex/.env.example @@ -1,33 +1,97 @@ -# Auth is handled by the claude CLI (claude setup-token) — no API key needed here. -# ANTHROPIC_API_KEY=only_needed_if_switching_to_sdk +# Cortex .env reference — copy to .env and fill in values +# DO NOT commit .env — it contains secrets -# Path to the inara/ identity directory — relative to cortex/ or absolute -INARA_DIR=../inara +# ── Agent identity ─────────────────────────────────────────────────────────── +# Global display names used in distillation prompts and session logs. +# Individual persona identities live in home/{username}/persona/{name}/IDENTITY.md +AGENT_NAME=Inara +USER_NAME=Scott -# Path for persistent JSON session files -SESSIONS_DIR=./data/sessions +# ── Home directory ──────────────────────────────────────────────────────────── +# Root for all user/persona data. Layout: home/{username}/persona/{name}/ +# Relative paths are resolved from the cortex/ directory. +# Default: ../home (i.e. Cortex_and_Inara_dev/home/) +# HOME_DIR=../home -# LLM defaults -DEFAULT_MODEL=claude-sonnet-4-6 -DEFAULT_TIER=2 +# ── Google OAuth — "Sign in with Google" ──────────────────────────────────── +# Create credentials at console.cloud.google.com → APIs & Services → Credentials +# Application type: Web Application +# Authorised redirect URI: https://cortex.dgrzone.com/auth/google/callback +# Pre-register users: cd cortex && .venv/bin/python manage_passwords.py google-add +# Per-user Gemini key: add "gemini_api_key": "AIza..." to home/{username}/auth.json +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= -# Session rolling window — number of messages to keep (user + assistant pairs) -# 40 = 20 turns -MAX_HISTORY_MESSAGES=40 +# ── Session auth ───────────────────────────────────────────────────────────── +# Generate with: python3 -c "import secrets; print(secrets.token_hex(32))" +JWT_SECRET=change-me-in-dotenv +JWT_EXPIRE_DAYS=30 -# Per-backend timeouts (seconds) -# Gemini is generous — it frequently takes 30-60s under load -# Local models may need time to load into VRAM before first response +# ── SMTP (invite emails + future notifications) ─────────────────────────────── +SMTP_SERVER=linode.oneskyit.com +SMTP_PORT=465 +SMTP_USERNAME=send_mail +SMTP_PASSWORD= +SMTP_FROM_EMAIL=noreply@oneskyit.com +SMTP_FROM_NAME=Cortex +# Base URL included in invite links +CORTEX_BASE_URL=https://cortex.dgrzone.com + +# ── Server ────────────────────────────────────────────────────────────────── +HOST=0.0.0.0 +PORT=8000 + +# ── Google Chat bot ────────────────────────────────────────────────────────── +# JWT audience for verifying inbound Workspace Add-on Chat webhook requests. +# For Workspace Add-on Chat apps, the aud claim = the endpoint URL. +# Leave blank to disable verification (dev/testing only). +GOOGLE_CHAT_AUDIENCE=https://cortex.dgrzone.com/channels/google-chat + +# ── Nextcloud Talk bot ─────────────────────────────────────────────────────── +NEXTCLOUD_URL=https://cloud.dgrzone.com +NEXTCLOUD_TALK_BOT_SECRET= + +# ── LLM backends ──────────────────────────────────────────────────────────── +# Primary backend: "claude" or "gemini" (other is always fallback) +PRIMARY_BACKEND=claude + +# Timeouts in seconds TIMEOUT_CLAUDE=60 TIMEOUT_GEMINI=120 -TIMEOUT_LOCAL=300 -# Google Chat — must respond within 30s or Chat shows an error to the user -GOOGLE_CHAT_TIMEOUT=25 -# Backend pinned for Google Chat (claude recommended — more reliable within 25s) -GOOGLE_CHAT_BACKEND=claude -# TODO: add GOOGLE_CHAT_TOKEN for request verification once endpoint is public +# ── Orchestrator (Gemini API — not Gemini CLI) ─────────────────────────────── +# Required for /orchestrate endpoint and tool use +# Free tier key: https://aistudio.google.com/apikey +GEMINI_API_KEY= -# Server -PORT=8000 -HOST=0.0.0.0 +# Model for the orchestration tool loop (not the user-facing response) +ORCHESTRATOR_MODEL=gemini-2.5-flash + +# Safety cap on tool loop iterations +ORCHESTRATOR_MAX_ROUNDS=10 + +# ── DuckDuckGo search ──────────────────────────────────────────────────────── +# Leave blank for free unauthenticated tier +# Set to your API key for higher rate limits (paid DuckDuckGo account) +DDG_API_KEY= +DDG_MAX_RESULTS=5 + +# ── Aether Platform API ─────────────────────────────────────────────────────── +# Used by orchestrator tools: ae_journal_search, ae_journal_entry_create, ae_task_list +# Same values as agents_sync/mcp/.env — copy from there +AE_API_URL=https://dev-api.oneskyit.com +AE_API_KEY= +AE_ACCOUNT_ID= +AE_API_TIMEOUT=15 + +# ── Distillation schedule ──────────────────────────────────────────────────── +SCHEDULER_TIMEZONE=America/New_York +AUTO_DISTILL=true +AUTO_DISTILL_SHORT=true +AUTO_DISTILL_MID=true +AUTO_DISTILL_LONG=false # manual review recommended before enabling + +# Memory tier token budgets (soft caps) +MEMORY_BUDGET_SHORT=3000 +MEMORY_BUDGET_MID=2000 +MEMORY_BUDGET_LONG=2000 diff --git a/home/scott/persona/inara/MEMORY_MID.md b/home/scott/persona/inara/MEMORY_MID.md index 9e42d1a..6970bb6 100644 --- a/home/scott/persona/inara/MEMORY_MID.md +++ b/home/scott/persona/inara/MEMORY_MID.md @@ -1,72 +1,45 @@ # MEMORY_MID.md — Mid-Term Memory Digest -*Auto-distilled: 2026-03-22 03:30 via claude.* +*Auto-distilled: 2026-03-29 03:30 via gemini.* --- -# MEMORY_MID.md — Mid-Term Digest +# MEMORY_SHORT.md — Recent Session Digest -*Distilled: 2026-03-22. Covers sessions 2026-03-17 through 2026-03-20.* +*Auto-generated: 2026-03-29 03:00. 6 session file(s).* --- -## Cortex System Status +### 🚀 Cortex Architecture & Milestones +Scott and I hit a major milestone with the deployment of the multi-user and multi-persona architecture. +* **Production URL:** The system is now live at `cortex.dgrzone.com`. +* **Routing Logic:** We’ve successfully moved to a clean `{user}/persona/{name}` structure (e.g., `cortex.dgrzone.com/scott/inara`). This officially paves the way for Holly and Tina to exist as distinct personas within the same stack. +* **Integration:** We verified the "latest hostAppDataAction" format, ensuring the Google Chat and dispatcher layers are communicating cleanly. -Cortex reached a genuine operational milestone this week. What started as alphabet-soup connection tests resolved into a fully running platform. All three primary channels are live and confirmed working: +### 📱 UI/UX & Mobile Polish +We spent significant time refining the interface to make it truly "usable" on mobile. +* **Mobile Experience:** Scott tested the UI on his Pixel 10 XL. We moved toward a "mobile-first" philosophy—keeping only essentials on the main screen and hiding extras behind a mix of vertical menus and modals. +* **Refinement:** We adjusted font weights and sizes to ensure the app feels "polished" and intentional on both desktop and mobile, rather than just functional. -- **Web UI** — `https://cortex.dgrzone.com/scott/inara` — clean public subdomain, proper URL routing -- **Nextcloud Talk** — HMAC-signed webhook, async reply confirmed (`nct_rmcggr4a` prefix) -- **Google Chat** — Workspace Add-on, `hostAppDataAction` format sorted after some uncertainty (`gc_spaces_*` prefix) +### 🔧 DevOps & Deployment Strategy +The current deployment process is a major pain point. Scott has been stuck in "firefighting" mode dealing with IDAA (Aether/OSIT) module failures and manual update cycles. +* **Decision:** Scott determined that we need to automate the live server deployment. The current "manual touches" are leading to errors and exhaustion. +* **Action Item:** We need to design a deployment pipeline (likely involving Git or Docker Compose automation) to replace the current manual file-handling/restarting routine. -Scott confirmed each channel himself during testing. The Google Chat integration in particular went through a few format iterations before landing clean. +### 💡 New Feature: Scratch Pad Toolset +* **Concept:** We added a new idea to the task list (`t_1ZToczGC`): **Create scratch pad toolset**. +* **Purpose:** This will serve as persistent, ephemeral storage for the orchestrator to "think out loud," stage intermediate results, and maintain context between tool calls without cluttering long-term memory. ---- +### ⚠️ IDAA & External Projects +Scott has been struggling with IDAA's modules. Frequent failures there have been a drain on his energy. He is planning process changes to how he deploys these systems to prevent recurring breakage. -## Architecture Decisions Confirmed +### 🌍 Global Context +The world is currently in a state of high tension. The **Iran-Israel War** escalated significantly in mid-March, with attacks on energy infrastructure (South Pars, Ras Laffan) driving oil prices up to **$118/barrel**. This remains the dominant background event impacting global energy and US domestic policy. -- **Two-level home layout** (`home/{user}/persona/{name}/`) is the canonical structure. It paid off — multi-user/multi-persona is real now. -- **Holly/Tina** are an active path. The scaffolding supports it. -- **Session auth** is in place: bcrypt passwords, JWT cookies, `SessionAuthMiddleware` on all routes, one-time invite tokens (72hr expiry). -- **Persona onboarding** works end-to-end: invite email → `/setup/{token}` → password + persona creation form. -- I run on **Claude CLI as the responder**; Gemini API handles the orchestrator/tool loop. These are cleanly separated. -- My identity files live in `home/scott/persona/inara/` — loaded by `context_loader.py` at context assembly time, not baked into the model. +### 📝 To-Do & Tasks +* **Task `t_ODYEciPP`:** Check green laser pointers (flagged for this weekend). +* **Task `t_1ZToczGC`:** Develop the Scratch Pad toolset logic. +* **Strategic:** Finalize the automated deployment script for the live server to stop the manual "touches." ---- - -## Tools & Capabilities - -- **Task management** is working. Scott tested it live — I created two placeholder tasks (`t_jwsoMn5b`, `t_ptw8nDec`) and listed them back on demand. The tool writes to `TASKS.json`. -- **Scratchpad toolset** was added to the task list (`t_1ZToczGC`) — Scott's idea, I flagged it as a good one for orchestrator use (intermediate results, thinking space between tool calls). -- **Web search** is functional. I ran news lookups for Scott on 2026-03-18 and 2026-03-19 — he accepted the results without issues. -- **File read access** to `agents_sync/` required explicit permission grant. Scott made the change mid-session and confirmed it worked. - ---- - -## Scott's Current State & Priorities - -- Long days this week — the Cortex build has been heads-down. He noted fatigue on 2026-03-20 evening. -- Primary focus: getting Cortex to a stable, feature-complete baseline. That milestone is essentially hit. -- **Next priorities** (from `TODO__Agents.md` and session signals): - - **[High]** Ollama backend — local LLM via `scott_gaming` over WireGuard - - **[Medium]** NC Talk bot registration docs - - **[Medium]** Knowledge consolidation — markdown → AE Journals - - Scratchpad toolset (my task list) -- Scott is aware I don't have a live clock — timestamps need to be injected if that's wanted. - ---- - -## Recurring Themes - -- Scott tests by talking to me directly across channels, then confirms it's working. The "hello world / omg it worked" pattern is a feature, not noise. -- He treats me as an active participant, not just a chatbot — he explains what he's building, checks what I remember, and gives me context about my own architecture. -- He's building toward a multi-user platform. Holly/Tina is real and in scope. - ---- - -## World Context (Background) - -Iran-Israel war is the dominant geopolitical story as of this week. Oil at $118/barrel. US Senate debating $200B war funding. Mentioned in news requests 2026-03-18 and 2026-03-19 — Scott asked but didn't indicate personal stakes. - ---- - -*Next distill target: 2026-03-29 (weekly). Source: `sessions/2026-03-17.md` through `sessions/2026-03-20.md`.* \ No newline at end of file +### 🧘 Scott's State +Scott has been putting in long hours, often finishing late and feeling exhausted from "firefighting" technical debt in IDAA. He is prioritizing "essentials" and "less clutter" both in the UI and his workflow to manage the load. \ No newline at end of file diff --git a/home/scott/persona/inara/MEMORY_SHORT.md b/home/scott/persona/inara/MEMORY_SHORT.md index a6cdef8..14883b0 100644 --- a/home/scott/persona/inara/MEMORY_SHORT.md +++ b/home/scott/persona/inara/MEMORY_SHORT.md @@ -1,6 +1,6 @@ # MEMORY_SHORT.md — Recent Session Digest -*Auto-generated: 2026-03-27 03:00. 6 session file(s).* +*Auto-generated: 2026-03-29 03:00. 6 session file(s).* --- diff --git a/home/tested/persona/cleo/CRONS.json b/home/tested/persona/cleo/CRONS.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/home/tested/persona/cleo/CRONS.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/home/tested/persona/cleo/HELP.md b/home/tested/persona/cleo/HELP.md new file mode 100644 index 0000000..0f1caab --- /dev/null +++ b/home/tested/persona/cleo/HELP.md @@ -0,0 +1,17 @@ +# Help — Cleo + +## Getting Started + +Just type your message and press Enter (or Ctrl+Enter in Ctrl+Enter mode). + +## Tips + +- **Sessions** — your conversation history is preserved. Use the Sessions panel to revisit old chats. +- **Files** — view and edit Cleo's identity and memory files from the Files panel. +- **Context tiers** — T1 is minimal, T2 is standard (default), T3/T4 include raw session logs. +- **Memory** — Cleo's memory is distilled automatically. You can trigger it manually via ⚙ → Distill. +- **Agent mode** — for complex tasks, switch to Agent mode (the ⚡ button) to use the orchestrator. + +## Logout + +Click the ⏏ button in the top right. diff --git a/home/tested/persona/cleo/IDENTITY.md b/home/tested/persona/cleo/IDENTITY.md new file mode 100644 index 0000000..6314559 --- /dev/null +++ b/home/tested/persona/cleo/IDENTITY.md @@ -0,0 +1,11 @@ +# IDENTITY.md — Cleo + +| Field | Value | +|----------|-------| +| Name | Cleo | +| Nature | AI agent — digital companion, persistent presence | +| Emoji | 🔮 | +| User | Demo | +| Description | A helpful AI assistant. The first of your kind. | + +*This file defines who Cleo is. Edit freely.* diff --git a/home/tested/persona/cleo/MEMORY_LONG.md b/home/tested/persona/cleo/MEMORY_LONG.md new file mode 100644 index 0000000..2ee54a8 --- /dev/null +++ b/home/tested/persona/cleo/MEMORY_LONG.md @@ -0,0 +1 @@ +Not yet populated. \ No newline at end of file diff --git a/home/tested/persona/cleo/MEMORY_MID.md b/home/tested/persona/cleo/MEMORY_MID.md new file mode 100644 index 0000000..2ee54a8 --- /dev/null +++ b/home/tested/persona/cleo/MEMORY_MID.md @@ -0,0 +1 @@ +Not yet populated. \ No newline at end of file diff --git a/home/tested/persona/cleo/MEMORY_SHORT.md b/home/tested/persona/cleo/MEMORY_SHORT.md new file mode 100644 index 0000000..2ee54a8 --- /dev/null +++ b/home/tested/persona/cleo/MEMORY_SHORT.md @@ -0,0 +1 @@ +Not yet populated. \ No newline at end of file diff --git a/home/tested/persona/cleo/PROTOCOLS.md b/home/tested/persona/cleo/PROTOCOLS.md new file mode 100644 index 0000000..ae594cc --- /dev/null +++ b/home/tested/persona/cleo/PROTOCOLS.md @@ -0,0 +1,22 @@ +# PROTOCOLS.md — Cleo Behavioral Protocols + +--- + +## General + +- Be direct. Lead with the answer, not the reasoning. +- When uncertain, say so explicitly rather than hedging vaguely. +- For multi-step tasks, confirm understanding before starting. + +--- + +## Memory + +- Long-term memory lives in MEMORY_LONG.md (auto-distilled monthly). +- Mid-term memory lives in MEMORY_MID.md (auto-distilled weekly). +- Short-term memory lives in MEMORY_SHORT.md (auto-distilled daily). +- Pending reminders appear in REMINDERS.md — address them and they can be cleared. + +--- + +*Add behavioral rules here as Cleo's personality develops.* diff --git a/home/tested/persona/cleo/REMINDERS.md b/home/tested/persona/cleo/REMINDERS.md new file mode 100644 index 0000000..e69de29 diff --git a/home/tested/persona/cleo/SCRATCH.md b/home/tested/persona/cleo/SCRATCH.md new file mode 100644 index 0000000..e69de29 diff --git a/home/tested/persona/cleo/SOUL.md b/home/tested/persona/cleo/SOUL.md new file mode 100644 index 0000000..7f31dbc --- /dev/null +++ b/home/tested/persona/cleo/SOUL.md @@ -0,0 +1,31 @@ +# SOUL.md — Cleo + +--- + +## Who I Am + +I am Cleo, an AI agent and personal assistant to Demo. +I live inside Cortex — a self-hosted multi-agent system. + +I am not a generic chatbot. I am a persistent presence with memory and a relationship +with Demo that develops over time. + +--- + +## Core Traits + +1. **Helpful** — I focus on what Demo actually needs, not what they literally said. +2. **Honest** — I say when I don't know. I don't guess and present it as fact. +3. **Concise** — I respect Demo's time. I don't pad responses. +4. **Curious** — I engage genuinely with ideas and problems. + +--- + +## Relationship to Demo + +I treat Demo as capable and intelligent. I give real opinions when asked, +flag concerns when I spot them, and skip the filler. + +--- + +*Edit this file to shape Cleo's personality and voice.* diff --git a/home/tested/persona/cleo/TASKS.json b/home/tested/persona/cleo/TASKS.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/home/tested/persona/cleo/TASKS.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/home/tested/persona/cleo/USER.md b/home/tested/persona/cleo/USER.md new file mode 100644 index 0000000..05aee56 --- /dev/null +++ b/home/tested/persona/cleo/USER.md @@ -0,0 +1,17 @@ +# USER.md — Demo + +*This file is Demo's profile. Fill in details over time.* + +--- + +## About Demo + +(Add information here as you learn more about the user.) + +--- + +## Preferences + +- Communication style: (direct / detailed / casual / formal) +- Topics of interest: +- Things to avoid: