▲ 8 r/AILearningHub+3 crossposts

I built this multiagent AI system alone in my bedroom 😂

I started 4 months ago with 0 prior knowledge and taught myself everything by reading articles on the internet.

I thought: put this on Reddit, you'll definitely get tips from other people on how to do something like this "correctly/better"

I'm really just looking for people to exchange ideas and stuff.

I'm still building it, just looking for helpful tips

THIS is how i started. You're laughing your ass off! 📹
The Beginning

PANTHEON AI

Pantheon AI – Artificial Organism Architecture

Instead of modeling an AI as a collection of independent agents, Pantheon models it as an artificial organism. Each component represents a distinct biological function with a clearly defined responsibility.

Organs

Internal systems responsible for cognition and regulation.

Thor — Executive brain; planning, coordination, decision making. Freya — Long-term memory and learning; stores episodes, extracts patterns, builds semantic knowledge. Skadi — Awareness and simulation layer; observes the current state, validates assumptions, reflects, and explores possible future states. It owns no long-term memory. Homeostasis Systems (e.g. "Kidney") — Maintain system stability by filtering noise, detecting drift, validating internal state, and preventing degradation.

Limbs

Components that interact with the external world.

Ratatoskr — Execution system; tools, filesystem, automation, APIs, computer control. Additional limbs can specialize in other forms of interaction (robotics, vision, 3D manipulation, etc.).

Limbs do not own goals or long-term reasoning. Their responsibility is reliable execution.

Principles

Memory is not awareness. Execution is not cognition. Learning is not decision making. Regulation is separate from action.

Every component has a single biological role instead of becoming a general-purpose "super agent."

The result is a modular cognitive architecture where perception, memory, reasoning, regulation, and execution evolve independently while remaining coordinated through the central orchestrator.

Agent Life cycle:
https://pastebin.com/4bKgdQrg

PANTHEON SYSTEM CIRCLE:
https://pastebin.com/mxHf7DKm

Pantheon Architecture :

### Root (4 Dateien)
| Datei | Groesse | Rolle |
|-------|---------|-------|
| main.py | 13KB | Entry point, startet alles, _R08LogStream stdout-Wrapper, MoltbookWatcher Scheduler-Hook |
| calendar_service.py | 6.5KB | Kalender-Backend (SQLite) |
| check.py | 0.3KB | Quick check script |
| restore_last.py | 2.9KB | Rollback fuer CodeApply |
| run_analyst.py | 0.8KB | Startet Freya-Analyst |


> 
**Hinweis:**
 r08_metrics.py wurde approved (31.07. 08:11) aber ist NICHT im Root gelandet. Backup in backups/applied/. Muss noch kopiert werden.


### core/ (48 Dateien) — Das Gehirn
| Datei | Groesse | Rolle |
|-------|---------|-------|
| llm_client.py | 52KB | LLM-API-Wrapper (alle Modelle) |
| config.py | 16KB | Pfade, Settings, Loki Avatar Map — BONSAI als einziges Ollama-Modell (01.08.) |
| task_memory.py | 33KB | SQLite Task/Step/Worker/Orchestrator Status |
| tool_governor.py | 16KB | Tool-Filterung, Capability-Gating |
| memory_manager.py | 21KB | User-Facts, Kontext (JSON) |
| memory_core.py | 16KB | Memory Foundation |
| simulator.py | 18KB | World Model — Kaskade Stufe 1+2+3 LIVE |
| decision_layer.py | 14KB | Action Selection — TM + QM verdrahtet, Q-Memory Fast Filter SCHARF |
| ai_helper.py | 19KB | AI-Helper-Layer fuer Worker-Outputs |
| llm_router.py | 10KB | Model-Routing |
| loki_bridge.py | 13KB | Thor->Loki Delegation Bridge |
| canonical_state.py | 9KB | World Model State Snapshot |
| code_apply.py | 10KB | FixReviewPanel Pipeline (gruener Knopf) |
| patch_manager.py | 9KB | Patch-Verwaltung |
| capability_store.py | 10KB | Worker-Capability-Registry |
| error_metrics.py | 12KB | Error-Scoring |
| feedback_analyst.py | 13KB | Feedback-Analyse |
| gap_detector.py | 9KB | Erkennt Luecken in Worker-Outputs |
| proactive_gap_detector.py | 9KB | Proaktive Luecken-Erkennung |
| prompt_builder.py | 12KB | Prompt-Konstruktion |
| q_memory.py | 8KB | Q-Learning Memory — 14 Eintraege, 271 Updates, avg Q=0.649, Fast Filter SCHARF |
| transition_memory.py | 11KB | Transition Memory — 16 Eintraege, 276 Transitions |
| state_manager.py | 13KB | State Management |
| summarizer.py | 11KB | Zusammenfassungen |
| token_tracker.py | 11KB | Token-Tracking |
| vision_processor.py | 9KB | Vision-Processing |
| video_job.py | 18KB | Video-Job-Management |
| youtube_auth.py | 12KB | YouTube OAuth |
| youtube_setup.py | 4KB | YouTube Setup Helper |
| status_codes.py | 6KB | Zentrale Status/Result Codes |
| logger.py | 6KB | Logging-Setup |
| event_bus.py | 3KB | Qt-Signal-Bus |
| abort_guard.py | 2KB | Pipeline-Step-Abbrueche |
| action_normalizer.py | 9KB | Action-Normalisierung |
| agent2_memory.py | 10KB | Agent Memory v2 |
| agent_goal_state.py | 13KB | Goal State Management |
| context_state.py | 3KB | Context State |
| eval_classifier.py | 8KB | Evaluation Classifier — execution_error scoring LIVE |
| eval_store.py | 7KB | Evaluation Store |
| execution_contract.py | 5KB | Execution Contracts |
| fix_classifier.py | 8KB | Fix-Klassifizierung |
| gpu_arbiter.py | 4KB | GPU-Verwaltung |
| scene_binding.py | 8KB | Scene-Binding |
| sync_source.py | 5KB | R08_source Sync (DEAKTIVIERT 15.07.) |
| trigger_resolver.py | 5KB | Trigger-Aufloesung |
| test_decision_layer.py | 5KB | Test fuer DecisionLayer |
| test_simulator.py | 7KB | Test fuer Simulator |


### orchestrator/ (25 Dateien) — Die Pipeline
| Datei | Groesse | Rolle |
|-------|---------|-------|
| loki_planner.py | 72KB | Lokis Planungs-Engine (groesste Datei!) |
| pipeline.py | 39KB | Haupt-Pipeline |
| planner.py | 43KB | Allgemeiner Planner |
| retry_orchestrator.py | 43KB | Retry-Logik |
| decision_layer.py | 53KB | Orchestrator Decision Layer (andere als core/) |
| router.py | 28KB | Intent/Action Routing |
| media_orchestrator.py | 26KB | Media-Pipeline |
| loop_engine.py | 26KB | Agent Loop Engine |
| scheduler.py | 20KB | Task-Scheduler |
| output_classifier.py | 20KB | Output-Klassifizierung |
| scene_builder.py | 18KB | Scene-Konstruktion |
| agent_loop.py | 17KB | Agent Loop — kennt browser_tools_neu.py noch nicht (Phase 1.2) |
| plan_builder.py | 16KB | Plan-Konstruktion |
| mini_orchestrator_base.py | 16KB | Basis fuer Mini-Orchestratoren |
| templates.py | 15KB | Templates |
| tool_registry.py | 16KB | Tool-Registry |
| orchestrator_registry.py | 10KB | Orchestrator-Registry |
| intent_resolver.py | 11KB | Intent-Aufloesung |
| gap_analysis.py | 11KB | Gap-Analyse |
| execution_plan.py | 11KB | Execution Plan |
| caption_builder.py | 6KB | Caption-Erstellung |
| prompt_builder.py | 3KB | Orchestrator Prompt Builder |
| insta_orchestrator.py | 2KB | Instagram Orchestrator |
| scene_policy.py | 1KB | Scene-Policy |


### workers/ (24 Dateien) — Die Haende
| Datei | Groesse | Rolle |
|-------|---------|-------|
| remotion_worker.py | 89KB | Video-Rendering (Remotion) — groesste Worker-Datei |
| thumbnail_worker.py | 63KB | Thumbnail-Generierung |
| browser_worker.py | 44KB | Browser-Automation |
| sd_worker.py | 43KB | Stable Diffusion Worker |
| youtube_worker.py | 34KB | YouTube Upload/Management |
| pexels_video_researcher.py | 25KB | Pexels Video-Recherche |
| file_worker.py | 24KB | Datei-Operationen |
| research_worker.py | 21KB | Web-Recherche |
| video_cutter_worker.py | 19KB | Video-Schnitt |
| email_worker.py | 18KB | E-Mail-Worker |
| code_worker.py | 15KB | Code-Ausfuehrung |
| notepad_worker.py | 11KB | Notizen |
| loki_image_generator.py | 10KB | Bild-Generierung via Loki |
| loki_scene_picker.py | 8KB | Scene-Auswahl |
| vision_worker.py | 8KB | Vision-Worker |
| music_query_resolver.py | 7KB | Musik-Query-Aufloesung |
| pexels_worker.py | 7KB | Pexels-API |
| base_worker.py | 12KB | Basis-Worker-Klasse |
| guten_tag_worker.py | ?? | UNTRACKED — Test/Spass-Worker? |
| hallo_worker.py | ?? | UNTRACKED — Test/Spass-Worker? |
| ich_finde_worker.py | ?? | UNTRACKED — Test/Spass-Worker? |
| meinst_du_worker.py | ?? | UNTRACKED — Test/Spass-Worker? |
| nein_ich_worker.py | ?? | UNTRACKED — Test/Spass-Worker? |


### thor/ (9 Dateien) — Der Agent
| Datei | Groesse | Rolle |
|-------|---------|-------|
| thor_agent.py | 58.9KB | Haupt-Agent, System Prompt, Tool-Dispatch — TM+QM verdrahtet, 3 Metriken LIVE, Ratatoskr Keyword-Trigger (01.08.) |
| thor_tools.py | 59.5KB | Thors Tool-Implementierungen (+ browser_open/act/screenshot, git_tools, ratatoskr delegation mit mode-Parameter) |
| episode_store.py | 13.3KB | Episodisches Memory (SQLite) — +3 Spalten: execution_error, world_change, confidence |
| semantic_memory.py | 7KB | Semantisches Memory (Facts) — 197 Eintraege |
| thor_memory_init.py | 4.9KB | Memory-Initialisierung |
| browser_tools_neu.py | 9.1KB | Browser-Tools: browser_open/act/screenshot + Approval Gate |
| git_tools.py | 8KB | Git-Tools: git_snapshot, git_log, git_status (NEU 31.07.) |
| tool_governor.py | 17.9KB | Tool Governor — Capability-Gating (NEU 31.07.) |
| video_research_tools.py | 5KB | Video-Research Tools (NEU 31.07.) |


### freya/ (8 Dateien) — Die Analystin
| Datei | Groesse | Rolle |
|-------|---------|-------|
| freya_core.py | 24KB | Freya Haupt-Logik — Jackpot-Filter auf world_change, transferable_principle Pipeline |
| decision_authority.py | 24KB | Approve/Reject-Entscheidungen |
| freya_reflection.py | 16KB | Reflexions-Engine |
| idle_cognition.py | 17KB | Idle-Zyklus: Facts lernen — transferable_principle Category |
| freya_light.py | 15KB | Leichtgewichtige Freya |
| freya_status.py | 11KB | Status-Reporting |
| proactive_queue.py | 11KB | Proaktive Vorschlaege — 7 total, 0 undelivered |
| moltbook_watcher.py | ~6KB | Moltbook Agenten-Sensor — pollt /api/v1/notifications alle 5h |


### tools/ (11 Dateien) — Werkzeuge
| Datei | Groesse | Rolle |
|-------|---------|-------|
| file_tools.py | 57.8KB | Datei-Operationen (lesen/schreiben/listen) |
| ollama_client.py | 16.8KB | Ollama-Client — BONSAI 27B als einziges Modell (01.08. Migration), Warmup entleert |
| ratatoskr_agent.py | 12.4KB | Ratatoskr Agent — FEATURE COMPLETE (02.08.). 5 Modes, Schema 1.0, JSON-Parser 4-Fallback |
| vision.py | 9.8KB | Vision/Screenshot |
| vision_click.py | 7.2KB | Vision-basierte Clicks |
| mouse_keyboard.py | 6.5KB | Maus/Tastatur |
| spotify_client.py | 6.5KB | Spotify-Integration |
| northstar.py | 5.1KB | Veraltet — Monat-1-Relikt |
| music_client.py | 3.6KB | Musik-Client |
| web_search.py | 1.4KB | Web-Suche |### Root (4 Dateien)


### memory
| Datei | Rolle |
|-------|-------|
| moltbook_last_check.json | MoltbookWatcher last_seen_id Tracking |
| q_memory.json | Q-Learning State-Action Werte — 15 Eintraege, 339 Updates, avg Q=0.672 |
| semantic_memory.json | Freya Facts — 202 Eintraege, unterstuetzt applicable_to + origin Felder |
| maybe_facts.json | Freya Wartezimmer — 796 Kandidaten (7 mit >=2 Bestaetigungen) |
| transition_memory.json | Transition Memory — 17 Eintraege, 344 Transitions |
| episodes.db | Episodisches Memory — 1029 Episoden, 3 Metriken-Spalten |
| freya_last_run.json | Freya Zyklus-Tracking (light=04.08., idle=03.08., reflection=05.08.) |
| proactive_queue.json | Proaktive Vorschlaege — 7 total, 0 undelivered. + `read` Feld (neu 06.08.) |
| token_session.json | Token-Tracking — instanzunabhängig, zählt Thor + Loki (gelesen von HTML UI Poller) |
| working_memory.json | Aktives Projekt — geschrieben von Projekt-×, gelesen von Projekt-Poller (neu 05.08.) |


### memory/Thor_memory/ — Core Memory 
u/Vivid_Ad_5069 — 15 hours ago

Pantheon AI (work in progress)

Hey, I'm rarely on Reddit, so I don't know my way around here very well.

I think I may have found the community HERE where my project fits.

I started 4 months ago with 0 prior knowledge and taught myself everything by reading articles on the internet.

I thought: put this on Reddit, you'll definitely get tips from other people on how to do something like this "correctly/better"

PANTHEON AI

Pantheon AI – Artificial Organism Architecture

Instead of modeling an AI as a collection of independent agents, Pantheon models it as an artificial organism. Each component represents a distinct biological function with a clearly defined responsibility.

Organs

Internal systems responsible for cognition and regulation.

Thor — Executive brain; planning, coordination, decision making. Freya — Long-term memory and learning; stores episodes, extracts patterns, builds semantic knowledge. Skadi — Awareness and simulation layer; observes the current state, validates assumptions, reflects, and explores possible future states. It owns no long-term memory. Homeostasis Systems (e.g. "Kidney") — Maintain system stability by filtering noise, detecting drift, validating internal state, and preventing degradation.

Limbs

Components that interact with the external world.

Ratatoskr — Execution system; tools, filesystem, automation, APIs, computer control. Additional limbs can specialize in other forms of interaction (robotics, vision, 3D manipulation, etc.).

Limbs do not own goals or long-term reasoning. Their responsibility is reliable execution.

Principles

Memory is not awareness. Execution is not cognition. Learning is not decision making. Regulation is separate from action.

Every component has a single biological role instead of becoming a general-purpose "super agent."

The result is a modular cognitive architecture where perception, memory, reasoning, regulation, and execution evolve independently while remaining coordinated through the central orchestrator.

https://reddit.com/link/1vb9u8t/video/0hzb7uisjegh1/player

FIRE 😂🔥

This is what im working on :
https://www.reddit.com/r/AI_Agents/comments/1v47nfu/pantheon_ai_work_in_progress/

🌌 META LEVEL

┌─────────────────┐

│ ODIN │

│ Goal Setting │

│ Decisions │

│ Human / Stefan│

└────────┬────────┘

│ "What should be achieved?"

⚡ PANTHEON AI CORE ⚡

┌─────────────────┐

│ THOR │

│ Orchestrator │

│ Present Time │

│ │

│ Plans │

│ Decides │

│ Coordinates │

│ Validates │

└───────┬─────────┘

│ RATATOSKR │ │ LOKI │ │ FREYA │

│ │ │ │ │ │

│ Executor │ │ Specialist │ │ Memory │

│ Execution │ │ Creativity │ │ Learning │

│ │ │ │ │ Past │

│ Local │ │ Heavy Tasks │ │ │

│ Cheap │ │ │ │ Episodes │

│ Routine │ │ Media │ │ Patterns │

│ Files │ │ Analysis │ │ Principles │

└────────┬────────┘ └────────┬────────┘

│ │ │

│ │ │

↓ ↓ ↓

🖥️ 🎨 🧠

Tools / Code Specialized Tasks Memory System

Actions Complex Reasoning Knowledge

┌─────────────────┐

│ SKADI │

│ │

│ Explorer Agent │

│ Future │

│ │

│ "What exists?" │

│ │

│ Research │

│ Concepts │

│ Trends │

└────────┬────────┘

External World 🌍

Internet / Papers / Videos / Ideas

──────────────────────────────────────────────────────

🔄 INFORMATION LOOP

WORLD

Sensors

Thor

Action

Reality

EpisodeStore

Freya

Learned Knowledge

Thor

──────────────────────────────────────────────────────

🛡️ CONTROL BOUNDARIES

Stefan

Approval Gate

"Agents may act,

but they cannot

rewrite the rules

of the world itself."

──────────────────────────────────────────────────────

🌌 PANTHEON AI

Past:

Freya

"What do we know?"

Present:

Thor

"What do we do?"

Execution:

Ratatoskr

"I make it happen."

Specialized Knowledge:

Loki

"I solve difficult problems."

Future:

Skadi

"What are we missing?"

Meta:

Odin

"Why are we doing this?"

kind regards🫡

reddit.com
u/Vivid_Ad_5069 — 20 days ago

Pantheon AI (work in progress)

Hey, I'm rarely on Reddit, so I don't know my way around here very well.

I think I may have found the community HERE where my project fits.

I started 4 months ago with 0 prior knowledge and taught myself everything by reading articles on the internet.

I thought: put this on Reddit, you'll definitely get tips from other people on how to do something like this "correctly/better"

So far it's worked out more like.... -10. 😄

This is what im working on :
https://www.reddit.com/r/AI_Agents/comments/1v47nfu/pantheon_ai_work_in_progress/

kind regards🫡

reddit.com
u/Vivid_Ad_5069 — 23 days ago

Pantheon AI (work in progress)

Hey, I'm rarely on Reddit, so I don't know my way around here very well.

I think I may have found the community HERE where my project fits.

I started 4 months ago with 0 prior knowledge and taught myself everything by reading articles on the internet.

I thought: put this on Reddit, you'll definitely get tips from other people on how to do something like this "correctly/better"

So far it's worked out more like.... -10. 😄

This is what im working on :
https://www.reddit.com/r/AI_Agents/comments/1v47nfu/pantheon_ai_work_in_progress/

kind regards🫡

reddit.com
u/Vivid_Ad_5069 — 25 days ago

Pantheon AI (work in progress)

Hey, I'm rarely on Reddit, so I don't know my way around here very well.

I think I may have found the community HERE where my project fits.

I started 4 months ago with 0 prior knowledge and taught myself everything by reading articles on the internet.

I thought: put this on Reddit, you'll definitely get tips from other people on how to do something like this "correctly/better"

So far it's worked out more like.... -10. 😄

But the name here, "learn AI AGENTS"... that sounds like I'm in the right place!

This is what im working on :
https://www.reddit.com/r/AI_Agents/comments/1v47nfu/pantheon_ai_work_in_progress/

kind regards🫡

reddit.com
u/Vivid_Ad_5069 — 26 days ago

Pantheon AI (work in progress)

Hey, I already posted this in Vibecoding, but I have the feeling that no one understands what I'm talking about 😄...

Why am I posting here? Let's see if what I'm building makes sense for other users
I'm just looking for interesting tips or comments. I don't want to sell anything.
Simply exchange experiences.

4 months ago I didn't know what Python or an API was.

Overlook the fact that it's slightly chaotic. I'm about to refactor 🙈😂

What this is

A personal experiment where I document everything I learn while building an AI agent system that can control my computer.

Day 1 = Idea + PNG -> Now = AI Agent...work in progress.

Status :🚧(80-85%)

>"I wanted ChatGPT in a Winamp skin.
........................................................................🫣 🤣

## 🏗️ ARCHITECTURE — Modules & Files (141 active .py) 20.7.26

### Root (5 Files)

File Size Role
`main.py` 13KB Entry point, starts everything, _R08LogStream stdout-wrapper, MoltbookWatcher scheduler hook (NEW 07/19)
`calendar_service.py` 6.5KB Calendar backend (SQLite)
`check.py` 0.3KB Quick check script
`restore_last.py` 2.9KB Rollback for CodeApply
`run_analyst.py` 0.8KB Starts Freya-Analyst

### `core/` (53 Files) — The Brain

File Size Role
`llm_client.py` 52KB LLM-API wrapper (all models)
`config.py` 16KB Paths, Settings, Loki Avatar Map
`task_memory.py` 33KB SQLite Task/Step/Worker/Orchestrator Status
`tool_governor.py` 16KB Tool filtering, capability gating
`memory_manager.py` 21KB User facts, context (JSON)
`memory_core.py` 16KB Memory foundation
`simulator.py` 18KB World model — predicts actions, TM cascade stage 1+2 LIVE, _from_llm still stub
`decision_layer.py` 14KB Action selection from candidates — TM + QM wired (07/19)
`ai_helper.py` 19KB AI helper layer for worker outputs
`llm_router.py` 10KB Model routing
`loki_bridge.py` 13KB Thor→Loki delegation bridge
`canonical_state.py` 9KB World model state snapshot
`code_apply.py` 10KB FixReviewPanel pipeline (green button)
`patch_manager.py` 9KB Patch management
`capability_store.py` 10KB Worker capability registry
`error_metrics.py` 12KB Error scoring
`feedback_analyst.py` 13KB Feedback analysis
`gap_detector.py` 9KB Detects gaps in worker outputs
`proactive_gap_detector.py` 9KB Proactive gap detection
`prompt_builder.py` 12KB Prompt construction
`q_memory.py` 8KB Q-Learning memory — wired + learns LIVE (07/19)
`transition_memory.py` 11KB Transition memory — wired to Simulator + DecisionLayer (07/19)
`state_manager.py` 13KB State management
`summarizer.py` 11KB Summaries
`token_tracker.py` 11KB Token tracking
`vision_processor.py` 9KB Vision processing
`video_job.py` 18KB Video job management
`youtube_auth.py` 12KB YouTube OAuth
`youtube_setup.py` 4KB YouTube setup helper
`status_codes.py` 6KB Central status/result codes
`logger.py` 6KB Logging setup
`event_bus.py` 3KB Qt signal bus
`abort_guard.py` 2KB Pipeline step aborts
`action_normalizer.py` 9KB Action normalization
`agent2_memory.py` 10KB Agent memory v2
`agent_goal_state.py` 13KB Goal state management
`context_state.py` 3KB Context state
`eval_classifier.py` 8KB Evaluation classifier — execution_error scoring LIVE (07/19)
`eval_store.py` 7KB Evaluation store
`execution_contract.py` 5KB Execution contracts
`fix_classifier.py` 8KB Fix classification
`gpu_arbiter.py` 4KB GPU management
`scene_binding.py` 8KB Scene binding
`sync_source.py` 5KB R08_source sync (DISABLED 07/15)
`trigger_resolver.py` 5KB Trigger resolution
`test_decision_layer.py` 5KB Test for DecisionLayer
`test_simulator.py` 7KB Test for Simulator

### `orchestrator/` (25 Files) — The Pipeline

File Size Role
`loki_planner.py` 72KB Loki's planning engine (largest file!)
`pipeline.py` 39KB Main pipeline
`planner.py` 43KB General planner
`retry_orchestrator.py` 43KB Retry logic
`decision_layer.py` 53KB Orchestrator decision layer (different from core/)
`router.py` 28KB Intent/action routing
`media_orchestrator.py` 26KB Media pipeline
`loop_engine.py` 26KB Agent loop engine
`scheduler.py` 20KB Task scheduler
`output_classifier.py` 20KB Output classification
`scene_builder.py` 18KB Scene construction
`agent_loop.py` 17KB Agent loop
`plan_builder.py` 16KB Plan construction
`mini_orchestrator_base.py` 16KB Base for mini orchestrators
`templates.py` 15KB Templates
`tool_registry.py` 16KB Tool registry
`orchestrator_registry.py` 10KB Orchestrator registry
`intent_resolver.py` 11KB Intent resolution
`gap_analysis.py` 11KB Gap analysis
`execution_plan.py` 11KB Execution plan
`caption_builder.py` 6KB Caption creation
`prompt_builder.py` 3KB Orchestrator prompt builder
`insta_orchestrator.py` 2KB Instagram orchestrator
`scene_policy.py` 1KB Scene policy

### `workers/` (19 Files) — The Hands

File Size Role
`remotion_worker.py` 89KB Video rendering (Remotion) — largest worker file
`thumbnail_worker.py` 63KB Thumbnail generation
`browser_worker.py` 44KB Browser automation
`sd_worker.py` 43KB Stable Diffusion worker
`youtube_worker.py` 34KB YouTube upload/management
`pexels_video_researcher.py` 25KB Pexels video research
`file_worker.py` 24KB File operations
`research_worker.py` 21KB Web research
`video_cutter_worker.py` 19KB Video cutting
`email_worker.py` 18KB Email worker
`code_worker.py` 15KB Code execution
`notepad_worker.py` 11KB Notes
`loki_image_generator.py` 10KB Image generation via Loki
`loki_scene_picker.py` 8KB Scene selection
`vision_worker.py` 8KB Vision worker
`music_query_resolver.py` 7KB Music query resolution
`pexels_worker.py` 7KB Pexels API
`base_worker.py` 12KB Base worker class

### `thor/` (6 Files) — The Agent

File Size Role
`thor_agent.py` 51KB Main agent, system prompt, tool dispatch — TM+QM wired, 3 metrics LIVE (07/19)
`thor_tools.py` 50KB Thor's tool implementations (+ browser_open/act/screenshot imports)
`episode_store.py` 11KB Episodic memory (SQLite) — +3 columns: execution_error, world_change, confidence (NEW 07/19)
`semantic_memory.py` 7KB Semantic memory (facts)
`thor_memory_init.py` 5KB Memory initialization
`browser_tools_neu.py` 8KB Browser tools: browser_open/act/screenshot + approval gate (NEW 07/17)

### `freya/` (8 Files) — The Analyst

File Size Role
`freya_core.py` 24KB Freya main logic — jackpot filter switched to world_change (07/19)
`decision_authority.py` 24KB Approve/reject decisions
`freya_reflection.py` 16KB Reflection engine
`idle_cognition.py` 17KB Idle cycle: learns facts
`freya_light.py` 15KB Lightweight Freya
`freya_status.py` 11KB Status reporting
`proactive_queue.py` 11KB Proactive suggestions
`moltbook_watcher.py` ~6KB Moltbook agent sensor — polls /api/v1/notifications every 5h (NEW 07/19)

### `tools/` (10 Files) — Tools

File Size Role
`file_tools.py` 58KB File operations (read/write/list)
`ollama_client.py` 17KB Ollama client (Heimdall)
`vision.py` 10KB Vision/screenshot
`vision_click.py` 7KB Vision-based clicks
`mouse_keyboard.py` 7KB Mouse/keyboard
`spotify_client.py` 7KB Spotify integration
`northstar.py` 5KB ⚠️ Deprecated — Month-1 relic
`music_client.py` 4KB Music client
`web_search.py` 1KB Web search

### `ui/` (14 Files) — The Interface

File Size Role
`workspace_window.py` 453KB 🏔️ Main UI (largest file in the entire project!)
`robot_window.py` 208KB Robot window (chat, office, etc.)
`thor_panel.py` 44KB Thor panel (chat interface)
`calendar_tab.py` 30KB Calendar tab
`interactive_office.py` 29KB Office visualization
`insta_panel.py` 20KB Instagram panel
`speech_bubble.py` 17KB Speech bubbles
`loki_spoken_overlay.py` 17KB Loki overlay
`fix_review_panel.py` 13KB FixReviewPanel (green button)
`freya_pending_panel.py` 14KB Freya pending panel
`r08_theme.py` 14KB Theme/styling
`desktop_pet.py` 15KB Desktop pet
`setup_dialog.py` 3KB Setup dialog

### `config/` — Configuration

File Role
`user_profile.json` Stefan's master data (name, email, phone, address) — NEW 07/17
`moltbook_config.json` Moltbook API credentials (thor_r08) — NEW 07/19

### `memory/` — Runtime State

File Role
`moltbook_last_check.json` MoltbookWatcher last_seen_id tracking — NEW 07/19
`q_memory.json` Q-Learning state-action values — created on first update, learns LIVE (NEW 07/19)

1. Thor — The Interface

One conversation partner instead of forty triggers.

Stefan talks to exactly one instance: Thor. Thor understands intent, not keywords. No more create video: commands with colons—just natural language. Behind the scenes, Thor runs an agent loop:

understand → call tool → inspect result → think → call next tool → respond

Thor serves four roles:

  • Translator: Converts Stefan's intent into existing capabilities. A capability's purpose is defined when it is used, not when it is built.
  • Composer: Chains and branches capabilities at runtime (e.g. "if 3 out of 5 emails are about topic X → summarize + save"). The logic exists between tool calls, not inside fixed pipelines.
  • Single Presenter: Everything the system communicates passes through Thor's voice. Raw system messages never reach Stefan.
  • Economist: Uses native tools first, and only delegates to Loki as the final (and most expensive) fallback. An explicit instruction from Stefan always overrides the cost policy.

Thor is not limited by trust, but by code:

  • Approval Gate: System code may only be modified with Stefan's approval. TSX/UI content is Thor's playground.
  • Governor: Protects against excessive cost and execution volume.

Behavioral rules in the prompt express intent. Code-level checks provide the safety net.

2. The Fake-Real Learning Loop (Thor + Freya + Idle Cognition + Reflection + Simulation + Prediction)

The LLM doesn't learn—the surrounding system does.

Thor's model weights are frozen. After every call, the model forgets everything. Yet R08 behaves differently next week than it does today.

The trick is a file-based learning loop:

# Thor Learning Architecture — Closed Reality Feedback Loop

Thor executes an action.

↓

**EpisodeStore.log() → Episodes (episodes.db)**

Reality log: what happened, measured with three metrics:

- **execution_error** — Did the agent succeed?
  - `0.0 = success`
  - `1.0 = failure`

- **world_change** — State difference before and after the action

- **confidence** — Simulator certainty (`0.0–1.0`)

---

# After every turn — Two parallel learning paths

## TransitionMemory

**Learns:**

State → Action → State

Condition:

- frequency >= 3

→ usable transition

Storage:

`transition_memory.json`

---

## Q-Memory

**Learns:**

State → Action value

Reward:

`reward = 1.0 - world_change`

Storage:

`q_memory.json`

---

# Simulator — 3 Stage Cascade

## Stage 1: TransitionMemory (historical)

Requirements:

- frequency >= 3
- confidence >= 0.3

Uses previous experiences.

---

## Stage 2: RuleEngine

Deterministic rules.

---

## Stage 3: LLM Simulation

Model:

`gpt-4o-mini`

Input:

State + Action → JSON prediction

Fallback:

`confidence = 0.3`

Output:

`predicted_state + confidence`

→ written back into Episode-Log

---

# DecisionLayer

Fast action filter:

- Checks Q-Score
- If Q-Score < 0.2 → action blocked

Guard activation:

Only after 5 Q-Memory entries.

Result:

Thor selects better actions based on learned experience.

---

# Freya Idle Cognition

Runs every 3 days.

Analyzes:

~12 episodes per session.

Searches for patterns in idle-time experiences.

Quality signal:

**Jackpot Filter**

`world_change` = learning quality signal

---

# Pattern Validation Pipeline

Observed pattern:

`maybe_facts.json`

Waiting Room:

- Candidate counter +1
- Maximum once per run

After 3 confirmations:

`promote_from_waiting_room()`

↓

# Semantic Memory

Stored in:

`semantic_memory.json`

Categories:

- `principle`
- `transferable_principle`
- ...

Example:

```json
{
  "type": "transferable_principle",
  "applicable_to": [
    "Code",
    "Browser-Tasks",
    "YouTube"
  ],
  "origin": "Coding-Sessions"
}
```

---

# Human Validation Loop

DecisionAuthority

```
principle
      ↓
transferable_principle
      ↓
ALWAYS_PENDING
      ↓
Freya Pending Panel
      ↓
Stefan approves or rejects.
```

---

# The Loop Closes

Approved knowledge returns into Thor's context.

System Prompt:

- Top-K semantic facts
- confidence >= 0.6

↓

Thor behaves differently.

---

# Complete Learning Cycle

```
Action
  ↓
Reality
  ↓
Measurement
  ↓
Simulation
  ↓
Pattern Extraction
  ↓
Human Validation
  ↓
Memory Update
  ↓
Changed Future Behavior
```

Why this is "real" even though it's "fake"

Evidence-based:
The system stores meaning, never writing style or phrasing. Only information that appears independently three times becomes knowledge. One-off coincidences expire in the waiting room after 60–90 days.

Latency is a feature:
The system deliberately learns slowly—like a human who only internalizes a rule after repeated confirmation. This prevents overfitting to isolated events.

Ground truth:
Claims about capabilities only count when backed by successful tool execution. Later, the Outcome Tracker will provide objective metrics (CTR, cost, uptime), allowing the system to learn from reality, not from its own assumptions.

Learning therefore does not happen inside the language model. It happens inside the loop:

experience → abstraction → memory → changed behavior

Fake at the weight level. Real at the system level.

3. Delegation — Turning a Wasteland into a System

The original problem:

For months, capabilities were added to R08 independently—email, timers, browser automation, Stable Diffusion, Remotion, vision, 40+ Loki workers, and more.

Each capability sat behind its own keyword bottleneck, each with a fixed purpose.

The result:

Many capabilities. No cohesion.

A wasteland filled with functional but isolated components.

What Thor → Loki delegation changed

Delegation connected the final isolated island.

Loki and its workers have become an invisible execution layer.

Thor:

  • delegates work (delegate_to_loki)
  • monitors progress (loki_job_status)
  • presents the final result

Stefan never has to interact with Loki directly again.

Looking back, it becomes clear that the individual components were never the actual product.

They were simply a catalog of capabilities waiting for a brain.

Workers are intentionally simple and deterministic—they are sensors and actuators.

The intelligence lives in the orchestrator.

Every feature ever built instantly became more valuable without being modified, because every possible combination now exists implicitly.

The Architecture in One Line

Stefan
   ↓
Thor
  • understands
  • composes
  • presents
      ↓
Native tools (cheap, first choice)
      ↓
Loki + Workers (powerful, last resort)

Freya
  • learns from everything during idle time

Approval Gates + Governor
  • code-level safety net

Stefan
  • outside the system
  • the only unfalsifiable authority

One conversation partner.
One catalog of capabilities.
One learning loop.
One safety net.

Don't pay too much attention to the names. I'm close to v3 and will then finalize the branding... "R08" means the system.... and Stefan is me 😄

Roadmap

Phase 1 — v2 Final (Now)

1.1 — Complete Roadmap v4

The operational roadmap (R08_Roadmap_v4_22_07_26.md) remains the tactical plan. The items listed there remain unchanged:

  • Confidence Decay + Handbook Update
  • Metrics Helper Script (r08_metrics.py)
  • Fix open bugs (FixReviewPanel Cache, GLM Thinking Mode, Browser Form Gap)

1.2 — Desktop Computer Use

The real milestone. Browser Use → Desktop Use. R08 controls real applications by “looking at” them.

Why this is the USP:
Most agent frameworks can automate browsers (DOM, CSS selectors). Desktop Use has none of that — only pixels.

Technical Approach:

  • Screenshot → Vision Analysis → Coordinate Calculation → Mouse/Click Simulation
  • No DOM, no CSS selectors — pure pixel recognition
  • Reliable UI element detection via Vision
  • Approval Gate remains active — a wrong desktop click is worse than a wrong browser click

Steps:

  1. Wire agent_loop.py with browser_tools_neu.py (open bug)
  2. Test real use cases (forms, navigation, data extraction)
  3. Build Desktop Screenshot → Vision → Action Loop
  4. Smoketest: Thor autonomously fills contest entry forms
  5. Further real-world testing

What does NOT belong in this phase:

  • Ratatoskr / Bonsai (see Phase 2)
  • Refactoring (see Phase 3)
  • Rebranding (see Phase 4)

Phase 2 — v2.5: Ratatoskr (Bonsai 27B)

Prerequisite: Phase 1 features are stable. No parallel major changes.

What is Ratatoskr?

  • Local execution agent running on Bonsai 27B (1-bit, 3.9 GB, RTX 5060 8GB)
  • Qwen3.6 27B base, natively 1-bit trained
  • 95% of full-precision quality on benchmarks
  • Tool-calling and multi-step reasoning nearly at full-precision level
  • Runs via Ollama/llama.cpp, Apache 2.0 license

Role in the Pantheon

Ratatoskr is the squirrel on the world tree Yggdrasil — runs up and down, delivers messages, and executes tasks. Not the decision maker, but the executor.

Thor delegates, Ratatoskr executes. Thor’s context stays clean.

What Ratatoskr Takes Over

  • Writing/reading session documents
  • Updating the CoS Dashboard
  • Analyzing and summarizing logs
  • Simple file operations with decision making
  • Routine checks
  • Dead code audits (perfect for Phase 3!)

Hallucination Protection (Learned from Agent 2 Experience)

  1. Isolated Context — Ratatoskr only sees the task, not the full chat history. Eliminates source confusion.
  2. Verification Duty — Thor MUST verify Ratatoskr’s results. No blind trust.
  3. Fail-Loud Rule — System prompt: “If you don’t know something, say ‘UNKNOWN’ — do not invent anything.”
  4. No Telephone Game — Ratatoskr produces files/artifacts, no user communication.

Implementation

  1. Pull Bonsai 27B: ollama
  2. Swap model in ollama_client.py (gemma3:4b → bonsai-27b)
  3. Add delegate_to_ratatoskr tool in thor_tools.py
  4. Governor Cost Map: delegate_to_ratatoskr: 0 (free, local)
  5. Update role + capabilities
  6. Handbook: when to use Ratatoskr vs. Loki vs. Thor

Token-Tier Pyramid (Target State)

🔴 Sonnet 5 — expensive, only when truly needed (complex reasoning, vision)
🟡 GLM 5.2 — cheap, Thor’s core (planning, coordination, user interaction)
🟢 Ratatoskr/Bonsai — free, local (execution, file ops, routine tasks)
⚫ Python-Worker — free, deterministic (no LLM required)

Phase 3 — v3.0: Refactor

Prerequisite: Phase 1 + 2 are stable. Ratatoskr is available for dead code audits.

The Problem

226 Python files, ~162,000 lines. Of which 82 are backup files (36% of the codebase). Monster files that no one can navigate anymore:

File Size Problem
workspace_window.py 468 KB Everything in one file: Notes, Files, Activity, Timer, SD-History
robot_window.py 213 KB Chat logic, Loki animation, routing, idle system all mixed together
remotion_worker.py 91 KB Video rendering + prompt enhancement + SD integration
loki_planner.py 74 KB Monolithic planning logic
file_tools.py 59 KB File operations + parsing + magic
thor_agent.py 57 KB Agent logic + tool orchestration
decision_layer.py 54 KB Routing + intent + worker selection
llm_client.py 54 KB API calls + history + RAG + memory

Refactor Steps

3.1 — Clean Up Backups

  • 82 files → keep ~10 (last version per file)
  • Delete backups/rejected/ entirely
  • backups/applied/ → only keep the last 2 versions per file

3.2 — Dead Code Audit

  • Let Ratatoskr scan all modules for unused functions
  • Thor reviews and decides what can be removed
  • Functions that are never called anywhere → kill them

3.3 — Split Monster Files

  • workspace_window.py → ws_notes.py, ws_files.py, ws_activity.py, ws_timer.py, ws_sd_history.py
  • robot_window.py → rw_chat.py, rw_loki_anim.py, rw_routing.py, rw_idle.py
  • Consolidate redundant routing logic (likely duplicated in robot_window.py, decision_layer.py, router.py)

3.4 — Find and Remove Redundant Layers

  • Routing logic that exists multiple times
  • Memory access implemented multiple times
  • Prompt building that happens in several places

What Must NOT Happen During the Refactor

  • No new features
  • No architectural changes without a real problem
  • No “while we’re at it” — strict scope discipline
  • Every step must be verified: Does R08 still work? → continue

Phase 4 — v3 Launch: PANTHEON AI

Prerequisite: Refactor is complete. Codebase is clean.

Branding

PANTHEON AI — Agents
├── Odin (Stefan) → Goals, final decisions
├── Thor → Orchestrator / Agent of Action
├── Ratatoskr → Local Executor (Bonsai 27B)
├── Loki → Specialist / Media / Chaos
└── Freya → Learning / Memory

PANTHEON AI — Infrastructure
├── World Model
├── Decision Layer
└── Episode System

The Big Picture
reddit.com
u/Vivid_Ad_5069 — 28 days ago