This document outlines the system architecture and data flows for the Forenly AI Skill Agent, our entry for the Slack Agent Builder Challenge.
flowchart TD
subgraph "Humanoid Training Sandbox (Local or Cloud)"
Sim["MuJoCo Physics Engine<br>(Unitree G1 Simulation)"]
Daemon["Simulation Monitor Daemon<br>(Detects Anomaly / Collision)"]
RL_Loop["PyTorch RL Loop / Training Run<br>(Actor-Critic / LoRA Adaptors)"]
Sim <-->|Observation / Joint Actions| RL_Loop
RL_Loop <-->|Telemetry Metrics| Daemon
end
subgraph "Forenly Skill Layer Backend"
MCP["Model Context Protocol (MCP) Server<br>(Exposes skill registry & metrics)"]
SlackBackend["Slack App Backend<br>(Node.js/Python Express Listener)"]
Daemon -->|Post Anomaly Event| SlackBackend
MCP <-->|Expose MCP Tools| SlackBackend
RL_Loop <-->|Register Model Checkpoints| MCP
end
subgraph "Slack Workspace"
SlackApp["Forenly AI Skill Agent<br>(Slack Client)"]
Channel["#slack-agent Channel"]
SlackAI["Slack AI<br>(Conversational Queries)"]
RTS["Slack RTS API<br>(Inline Logs Search)"]
SlackBackend <-->|API / Webhooks / Block Kit| SlackApp
SlackApp <-->|Interactive Selection| Channel
SlackApp <-->|Search Logs| RTS
SlackApp <-->|Query Metrics| SlackAI
end
subgraph "Human-In-The-Loop (HITL)"
Operator["AI Researcher / Robot Operator"]
Channel -->|Renders 5s Video & Rating Buttons| Operator
Operator -->|Click Rate Star (1-5) / Apply LoRA| Channel
end
style Sim fill:#f9f,stroke:#333,stroke-width:2px
style RL_Loop fill:#bbf,stroke:#333,stroke-width:2px
style MCP fill:#bfb,stroke:#333,stroke-width:2px
style SlackBackend fill:#bfb,stroke:#333,stroke-width:2px
style SlackApp fill:#fbd,stroke:#333,stroke-width:2px
style Operator fill:#fdf,stroke:#333,stroke-width:2px
The Forenly AI Skill Agent connects raw humanoid physical simulation directly to human ML experts inside Slack:
- Simulation Anomaly or Run Completion:
- As the Unitree G1 robot trains walking/grasping in MuJoCo, the Simulation Monitor Daemon continuously checks reward gradients and joint forces.
- If an anomaly is detected (e.g., joint over-torque, reward collapse) or a training episode finishes, the simulation pauses.
- Telemetry Packet Transmission:
- The daemon sends a JSON payload containing joint coordinates, reward history, and a link to a rendered 5-second video clip to the Slack App Backend.
- Block Kit Card Rendering:
- The Slack backend processes the event and formats a rich interactive card posted to the
#slack-agentchannel. - This card features the video clip, a summary of training metrics, and interactive buttons: [Reset Checkpoint], [Inject Manual Reward], [Apply Grasp-v2 LoRA], and [Override Safety Policy].
- The Slack backend processes the event and formats a rich interactive card posted to the
- Human Interaction & RLHF Scoring:
- A researcher inspects the clip in Slack, clicks on a 1-to-5 star rating to express preference (RLHF), or selects a corrective LoRA adaptor.
- Execution of Corrective Action:
- The interactive selection fires a webhook back to the Slack App Backend, which makes a secure call to the MCP Server.
- The MCP server instructs the PyTorch RL Loop to:
- Update the neural model's reward function based on the star rating.
- Deploy the chosen LoRA adapter weights.
- Unpause and resume the MuJoCo simulation with the updated parameters.
- Model Context Protocol (MCP) Integration: Exposes ML endpoints like
list_active_skills,deploy_skill_adapter(sim_id, skill_id), andget_skill_performance(skill_id)directly to Slack AI. - Slack AI Capabilities: Allows natural-language querying of current training runs, checkpoints, and success rates (e.g., "Summarize G1_0's grasping success rate over the last hour").
- Real-Time Search (RTS) API: Permits instant search and indexing of historical simulation run logs and error messages directly from the channel interface.