[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71154":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},71154,"GLaDOS","dnhkng\u002FGLaDOS","dnhkng","This is the Personality Core for GLaDOS, the first steps towards a real-life implementation of the AI from the Portal series by Valve.","",null,"Python",5584,437,63,8,0,7,12,43,21,38.92,"MIT License",false,"main",true,[],"2026-06-12 02:02:48","\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F9828\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F9828\" alt=\"dnhkng%2FGlaDOS | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\n# GLaDOS Personality Core\n\n## Prologue\n\n> *\"Science isn't about asking why. It's about asking, 'Why not?'\"  -  Cave Johnson*\n\nGLaDOS is the AI antagonist from Valve's Portal series—a sardonic, passive-aggressive superintelligence who views humans as test subjects worthy of both study and mockery.\n\nBack in 2022 when ChatGPT made its debut, I had a realization: we are living in the Sci-Fi future and can actually build her now. A demented, obsessive AI fixated on humanity, super intelligent yet utterly lacking sound judgment; so just like an LLM, right? 2026, and still no moon colonies or flying cars. But a passive-aggressive AI that controls your lights and runs experiments on you? That we can do.\n\nThe architecture borrows from Minsky's Society of Mind—rather than one monolithic prompt, multiple specialized agents (vision, memory, personality, planning) each contribute to a dynamic context. GLaDOS's \"self\" emerges from their combined output, assembled fresh for each interaction.\n\nThe hard part was latency. Getting round-trip response time under 600 milliseconds is a threshold—below it, conversation stops feeling stilted and starts to flow. That meant training a custom TTS model and ruthlessly cutting milliseconds from every part of the pipeline.\n\nSince 2023 I've refactored the system multiple times as better models came out. The current version finally adds what I always wanted: vision, memory, and tool use via MCP.\n\nShe sees through a camera, hears through a microphone, speaks through a speaker, and judges you accordingly.\n\n[Join our Discord!](https:\u002F\u002Fdiscord.com\u002Finvite\u002FERTDKwpjNB) | [Sponsor the project](https:\u002F\u002Fko-fi.com\u002Fdnhkng)\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fc22049e4-7fba-4e84-8667-2c6657a656a0\n\n## Vision\n\n\n> *\"We've both said a lot of things that you're going to regret\"  -  GLaDOS*\n\nMost voice assistants wait for wake words. GLaDOS doesn't wait—she observes, thinks, and speaks when she has something to say. All the while, parts of her minds are tracking what she sees, monitoring system stats, and researching new neurotoxin recipes online.\n\n**Goals:**\n- **Proactive behavior**: React to events (vision, sound, time) without being prompted\n- **Emotional state**: PAD model (Pleasure-Arousal-Dominance) for reactive mood\n- **Persistent personality**: HEXACO traits provide stable character across sessions\n- **Multi-agent architecture**: Subagents handle research, memory, emotions; main agent stays focused\n- **Real-time conversation**: Optimized latency, natural interruption handling\n\n## What's New\n\n- **Emotions**: PAD model for reactive mood + HEXACO traits for persistent personality\n- **Long-term Memory**: Facts, preferences, and conversation summaries persist across sessions\n- **Observer Agent**: Constitutional AI monitors behavior and self-adjusts within bounds\n- **Vision**: FastVLM gives her eyes. [Details](\u002Fdocs\u002Fvision.md) | [Demo](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=JDd9Rc4toEo)\n- **Autonomy**: She watches, waits, and speaks when she has something to say. [Details](\u002Fdocs\u002Fautonomy.md)\n- **MCP Tools**: Extensible tool system for home automation, system info, etc. [Details](\u002Fdocs\u002Fmcp.md)\n- **8GB SBC**: Runs on a Rock5b with RK3588 NPU. [Branch](https:\u002F\u002Fgithub.com\u002Fdnhkng\u002FRKLLM-Gradio)\n\n## Roadmap\n\n> *\"Federal regulations require me to warn you that this next test chamber... is looking pretty good.”  -  GLaDOS*\n\nThere's still a lot do do; I will be swapping out models are they are released, and then working on anamatronics, once a good model with inverse kinematics comes out. There was a time when I would code that myself; these days it makes more sense to wait until a trained model is released!\n\n- [x] Train GLaDOS voice\n- [x] Personality that actually sounds like her\n- [x] Vision via VLM\n- [x] Autonomy (proactive behavior)\n- [x] MCP tool system\n- [x] Emotional state (PAD + HEXACO model)\n- [x] Long-term memory\n- [ ] Implement streaming ASR (nvidia\u002Fmultitalker-parakeet-streaming-0.6b-v1)\n- [ ] Observer agent (behavior adjustment)\n- [ ] 3D-printable enclosure\n- [ ] Animatronics\n\n## Architecture\n\n> *\"Let's be honest. Neither one of us knows what that thing does. Just put it in the corner and I'll deal with it later.\"  -  GLaDOS*\n\n```mermaid\nflowchart TB\n    subgraph Input\n        mic[🎤 Microphone] --> vad[VAD] --> asr[ASR]\n        text[⌨️ Text Input]\n        tick[⏱️ Timer]\n        cam[📷 Camera]--> vlm[VLM]\n    end\n\n    subgraph Minds[\"Subagents\"]\n        sensors[Sensors]\n        weather[Weather]\n        emotion[Emotion]\n        news[News]\n        memory[Memory]\n    end\n\n    ctx[📋 Context]\n\n    subgraph Core[\"Main Agent\"]\n        llm[🧠 LLM]\n        tts[TTS]\n    end\n\n    subgraph Output\n        speaker[🔊 Speaker]\n        logs[Logs]\n        images[🖼️ Images]\n        motors[⚙️ Animatronics]\n    end\n\n    asr -->|priority| llm\n    text -->|priority| llm\n    vlm --> ctx\n    tick -->|autonomy| llm\n\n    Minds -->|write| ctx\n    ctx -->|read| llm\n    llm --> tts --> speaker\n    llm --> logs\n    llm \u003C-->|MCP| tools[Tools]\n    tools --> images\n    tools --> motors\n```\n\nGLaDOS runs a loop: each tick she reads her slots (weather, news, vision, mood), decides if she has something to say, and speaks. No wake word—if she has an opinion, you'll hear it.\n\n**Two lanes**: Your speech jumps the queue (priority lane). The autonomy lane is just the loop running in the background. User always wins.\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Audio Pipeline\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```mermaid\nflowchart LR\n    subgraph Capture[\"Audio Capture\"]\n        mic[Microphone\u003Cbr\u002F>16kHz]\n        vad[Silero VAD\u003Cbr\u002F>32ms chunks]\n        buffer[Pre-activation\u003Cbr\u002F>Buffer 800ms]\n    end\n\n    subgraph Recognition[\"Speech Recognition\"]\n        detect[Voice Detected\u003Cbr\u002F>VAD > 0.8]\n        accumulate[Accumulate\u003Cbr\u002F>Speech]\n        silence[Silence Detection\u003Cbr\u002F>640ms pause]\n        asr[Parakeet ASR]\n    end\n\n    subgraph Interruption[\"Interruption Handling\"]\n        speaking{Speaking?}\n        stop[Stop Playback]\n        clip[Clip Response]\n    end\n\n    mic --> vad --> buffer\n    buffer --> detect --> accumulate\n    accumulate --> silence --> asr\n    detect --> speaking\n    speaking -->|Yes| stop --> clip\n```\n\n- **Microphone** captures at 16kHz mono\n- **Silero VAD** processes 32ms chunks, triggers at probability > 0.8\n- **Pre-activation buffer** preserves 800ms before voice detected\n- **Silence detection** waits 640ms pause before finalizing\n- **Interruption** stops playback and clips the response in conversation history\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Thread Architecture\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n| Thread | Class | Daemon | Priority | Queue | Purpose |\n|--------|-------|--------|----------|-------|---------|\n| SpeechListener | `SpeechListener` | ✓ | INPUT | — | VAD + ASR |\n| TextListener | `TextListener` | ✓ | INPUT | — | Text input |\n| LLMProcessor | `LanguageModelProcessor` | ✗ | PROCESSING | `llm_queue_priority` | Main LLM |\n| LLMProcessor-Auto-N | `LanguageModelProcessor` | ✗ | PROCESSING | `llm_queue_autonomy` | Autonomy LLM |\n| ToolExecutor | `ToolExecutor` | ✗ | PROCESSING | `tool_calls_queue` | Tool execution |\n| TTSSynthesizer | `TextToSpeechSynthesizer` | ✗ | OUTPUT | `tts_queue` | Voice synthesis |\n| AudioPlayer | `SpeechPlayer` | ✗ | OUTPUT | `audio_queue` | Playback |\n| AutonomyLoop | `AutonomyLoop` | ✓ | BACKGROUND | — | Tick orchestration |\n| VisionProcessor | `VisionProcessor` | ✓ | BACKGROUND | `vision_request_queue` | Vision analysis |\n\n**Daemon threads** can be killed on exit. **Non-daemon threads** must complete gracefully to preserve state (e.g., conversation history).\n\n**Shutdown order**: INPUT → PROCESSING → OUTPUT → BACKGROUND → CLEANUP\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Context Building\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```mermaid\nflowchart TB\n    subgraph Sources[\"Context Sources\"]\n        sys[System Prompt\u003Cbr\u002F>Personality]\n        slots[Task Slots\u003Cbr\u002F>Weather, News, etc.]\n        prefs[User Preferences]\n        const[Constitutional\u003Cbr\u002F>Modifiers]\n        mcp[MCP Resources]\n        vision[Vision State]\n    end\n\n    subgraph Builder[\"Context Builder\"]\n        merge[Priority-Sorted\u003Cbr\u002F>Merge]\n    end\n\n    subgraph Final[\"LLM Request\"]\n        messages[System Messages]\n        history[Conversation\u003Cbr\u002F>History]\n        user[User Message]\n    end\n\n    Sources --> merge --> messages\n    messages --> history --> user\n```\n\nWhat the LLM sees on each request:\n1. **System prompt** with personality\n2. **Task slots** (weather, news, vision state, emotion)\n3. **User preferences** from memory\n4. **Constitutional modifiers** (behavior adjustments from observer)\n5. **MCP resources** (dynamic tool descriptions)\n6. **Conversation history** (compacted when exceeding token threshold)\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Autonomy System\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```mermaid\nflowchart TB\n    subgraph Triggers\n        tick[⏱️ Time Tick]\n        vision[📷 Vision Event]\n        task[📋 Task Update]\n    end\n\n    subgraph Loop[\"Autonomy Loop\"]\n        bus[Event Bus]\n        cooldown{Cooldown\u003Cbr\u002F>Passed?}\n        build[Build Context\u003Cbr\u002F>from Slots]\n        dispatch[Dispatch to\u003Cbr\u002F>LLM Queue]\n    end\n\n    subgraph Agents[\"Subagents\"]\n        emotion[Emotion Agent\u003Cbr\u002F>PAD Model]\n        compact[Compaction Agent\u003Cbr\u002F>Token Management]\n        observer[Observer Agent\u003Cbr\u002F>Behavior Adjustment]\n        weather[Weather Agent]\n        news[HN Agent]\n    end\n\n    Triggers --> bus --> cooldown\n    cooldown -->|Yes| build --> dispatch\n    Agents -->|write| slots[Task Slots]\n    slots -->|read| build\n```\n\nEach subagent runs its own loop: timer or camera triggers it, it makes an LLM decision, and writes to a slot the main agent reads. Fully async—subagents never block the main conversation.\n\nSee [autonomy.md](\u002Fdocs\u002Fautonomy.md) for details.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Execution\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```mermaid\nsequenceDiagram\n    participant LLM\n    participant Executor as Tool Executor\n    participant MCP as MCP Server\n    participant Native as Native Tool\n\n    LLM->>Executor: tool_call {name, args}\n\n    alt MCP Tool (mcp.*)\n        Executor->>MCP: call_tool(server, tool, args)\n        MCP-->>Executor: result\n    else Native Tool\n        Executor->>Native: run(tool_call_id, args)\n        Native-->>Executor: result\n    end\n\n    Executor->>LLM: {role: tool, content: result}\n```\n\n**Native tools**: `speak`, `do_nothing`, `get_user_preferences`, `set_user_preferences`\n\n**MCP tools**: Prefixed with server name (e.g., `mcp.system_info.get_cpu`). Supports stdio, HTTP, and SSE transports.\n\nSee [mcp.md](\u002Fdocs\u002Fmcp.md) for configuration.\n\n\u003C\u002Fdetails>\n\n### Components\n\n> *\"All these science spheres are made out of asbestos, by the way. Keeps out the rats. Let us know if you feel a shortness of breath, a persistent dry cough, or your heart stopping. Because that's not part of the test. That's asbestos.\"  -  Cave Johnson*\n\n| Component | Technology | Purpose | Status |\n|-----------|------------|---------|--------|\n| **Speech Recognition** | Parakeet TDT (ONNX) | Speech-to-text, 16kHz streaming | ✅ |\n| **Voice Activity** | Silero VAD (ONNX) | Detect speech, 32ms chunks | ✅ |\n| **Voice Synthesis** | Kokoro \u002F GLaDOS TTS | Text-to-speech, streaming | ✅ |\n| **Interruption** | VAD + Playback Control | Talk over her, she stops | ✅ |\n| **Vision** | FastVLM (ONNX) | Scene understanding, change detection | ✅ |\n| **LLM** | OpenAI-compatible API | Reasoning, tool use, streaming | ✅ |\n| **Tools** | MCP Protocol | Extensibility, stdio\u002FHTTP\u002FSSE | ✅ |\n| **Autonomy** | Subagent Architecture | Proactive behavior, tick loop | ✅ |\n| **Conversation** | ConversationStore | Thread-safe history | ✅ |\n| **Compaction** | LLM Summarization | Token management | ✅ |\n| **Emotional State** | PAD + HEXACO | Reactive mood, persistent personality | ✅ |\n| **Long-term Memory** | MCP + Subagent | Facts, preferences, summaries | ✅ |\n| **Observer Agent** | Constitutional AI | Behavior adjustment | ✅ |\n\n✅ = Done | 🔨 = In progress\n\n## Quick Start\n\n> *\"The Enrichment Center is required to remind you that the Weighted Companion Cube cannot talk. In the event that it does talk The Enrichment Centre asks you to ignore its advice.\"  -  GLaDOS*\n\n1. Install [Ollama](https:\u002F\u002Fgithub.com\u002Follama\u002Follama) and grab a model:\n   ```bash\n   ollama pull llama3.2\n   ```\n\n2. Clone and install:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fdnhkng\u002FGLaDOS.git\n   cd GLaDOS\n   python scripts\u002Finstall.py\n   ```\n\n3. Run:\n   ```bash\n   uv run glados          # Voice mode\n   uv run glados tui      # Text interface\n   ```\n\n## Installation\n\n### GPU Setup (recommended)\n\n- **NVIDIA**: Install [CUDA Toolkit](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-toolkit)\n- **AMD\u002FIntel**: Install appropriate [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Finstall\u002F)\n\nWorks without GPU, just slower.\n\n### LLM Backend\n\nGLaDOS needs an LLM. Options:\n1. [Ollama](https:\u002F\u002Fgithub.com\u002Follama\u002Follama) (easiest): `ollama pull llama3.2`\n2. Any OpenAI-compatible API\n\nConfigure in `glados_config.yaml`:\n```yaml\ncompletion_url: \"http:\u002F\u002Flocalhost:11434\u002Fv1\u002Fchat\u002Fcompletions\"\nmodel: \"llama3.2\"\napi_key: \"\"  # if needed\n```\n\n### Platform Notes\n\n**Linux:**\n```bash\nsudo apt install libportaudio2\n```\n\n**Windows:**\nInstall Python 3.12 from Microsoft Store.\n\n**macOS:**\nExperimental. Check Discord for help.\n\n### Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdnhkng\u002FGLaDOS.git\ncd GLaDOS\npython scripts\u002Finstall.py\n```\n\n## Usage\n\n```bash\nuv run glados                           # Voice mode\nuv run glados tui                       # Text UI\nuv run glados start --input-mode text   # Text only\nuv run glados start --input-mode both   # Voice + text\nuv run glados say \"The cake is a lie\"   # Just TTS\n```\n\n### TUI Controls\n\nPress `Ctrl+P` to open the command palette. Available commands:\n\n| Command | What it does |\n|---------|-------------|\n| Status | System overview |\n| Speech Recognition | Toggle ASR on\u002Foff |\n| Text-to-Speech | Toggle TTS on\u002Foff |\n| Config | View configuration |\n| Memory | Long-term memory stats |\n| Knowledge | Manage user facts |\n\n**Keyboard Shortcuts:**\n- `Ctrl+P` - Command palette\n- `F1` - Help screen\n- `Ctrl+D\u002FL\u002FS\u002FA\u002FU\u002FM` - Toggle panels (Dialog, Logs, Status, Autonomy, Queue, MCP)\n- `Ctrl+I` - Toggle right info panels\n- `Ctrl+R` - Restore all panels\n- `Esc` - Close dialogs\n\n## Configuration\n\n> *\"As part of a required test protocol, we will not monitor the next test chamber. You will be entirely on your own. Good luck.\"  -  GLaDOS*\n\n### Change the LLM\n\n```bash\nollama pull mistral\n```\n\nThen in `glados_config.yaml`:\n```yaml\nmodel: \"mistral\"\n```\n\nBrowse models: [ollama.com\u002Flibrary](https:\u002F\u002Follama.com\u002Flibrary)\n\n### Change the Voice\n> *“I'm speaking in an accent that is beyond her range of hearing.”  -  Wheatley*\n\n\nKokoro voices in `glados_config.yaml`:\n```yaml\nvoice: \"af_bella\"\n```\n\n**Female US:** af_alloy, af_aoede, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky\n**Female UK:** bf_alice, bf_emma, bf_isabella, bf_lily\n**Male US:** am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck\n**Male UK:** bm_daniel, bm_fable, bm_george, bm_lewis\n\n### Custom Personality\n\nCopy `configs\u002Fglados_config.yaml`, edit the personality:\n\n```yaml\npersonality_preprompt:\n  - system: \"You are a sarcastic AI who judges humans.\"\n  - user: \"What do you think of my code?\"\n  - assistant: \"I've seen better output from a random number generator.\"\n```\n\nRun with:\n```bash\nuv run glados start --config configs\u002Fyour_config.yaml\n```\n\n### MCP Servers\n\nAdd tools in `glados_config.yaml`:\n\n```yaml\nmcp_servers:\n  - name: \"system_info\"\n    transport: \"stdio\"\n    command: \"python\"\n    args: [\"-m\", \"glados.mcp.system_info_server\"]\n```\n\nBuilt-in: `system_info`, `time_info`, `disk_info`, `network_info`, `process_info`, `power_info`, `memory`\n\nSee [mcp.md](\u002Fdocs\u002Fmcp.md) for Home Assistant integration.\n\n## TTS API Server\n\nExpose Kokoro as an OpenAI-compatible TTS endpoint:\n\n```bash\npython scripts\u002Finstall.py --api\n.\u002Fscripts\u002Fserve\n```\n\nOr Docker:\n```bash\ndocker compose up -d --build\n```\n\nGenerate speech:\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:5050\u002Fv1\u002Faudio\u002Fspeech \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"input\": \"Hello.\", \"voice\": \"glados\"}' \\\n  --output speech.mp3\n```\n\n## Troubleshooting\n\n> *\"No one will blame you for giving up. In fact, quitting at this point is a perfectly reasonable response.\"  -  GLaDOS*\n\n**She keeps responding to herself:**\nUse headphones or a mic with echo cancellation. Or set `interruptible: false`.\n\n**Windows DLL error:**\nInstall [Visual C++ Redistributable](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fcpp\u002Fwindows\u002Flatest-supported-vc-redist).\n\n## Development\n\nExplore the models:\n```bash\njupyter notebook demo.ipynb\n```\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=dnhkng\u002FGlaDOS&type=Date)](https:\u002F\u002Fstar-history.com\u002F#dnhkng\u002FGlaDOS&Date)\n","GLaDOS Personality Core 是一个基于 Valve 的 Portal 系列游戏中的 AI 角色 GLaDOS 实现的项目。它通过多代理架构模拟了 GLaDOS 的个性，包括视觉、记忆和情感处理等功能，每个代理负责不同的任务如观察、记忆和情绪反应，共同构建出一个动态且连贯的 AI 人格。该项目利用 Python 编写，并采用自定义 TTS 模型以实现低延迟对话体验。适用于智能家居控制、互动娱乐以及需要高度个性化和情境感知的交互场景中，为用户提供类似科幻电影中的沉浸式交流体验。",2,"2026-06-11 03:36:09","high_star"]