Activity Loop Plugin — Pippin-style autonomous behavior engine #49
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Competitor
Kind/Documentation
Kind/Enhancement
Kind/Epic
Kind/Feature
Kind/Security
Kind/Story
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Scope/Core
Scope/Cross-Plugin
Scope/Plugin-System
Scope/Single-Plugin
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Yohei Nakajima (creator of BabyAGI) recently open-sourced pippin-ci — "The Digital Being Framework for Autonomous Agents." This is a generalized version of his Pippin project (an AI unicorn character that posts on X as @pippinlovesyou).
Pippin's architecture has significant overlap with cobot's plugin model, and the patterns it solves are exactly what cobot needs for autonomous behavior beyond request-response.
What Pippin Does
At its core, Pippin runs a continuous activity loop:
activities/directoryKey architectural elements:
async def run(state, memory)— dead simple to addactivity_constraints.json) — max frequency, cooldowns, dependency chainsskills/) separate from activities — skills are capabilities (LLM, X API, Solana), activities are behaviors that USE skillsactivity_build_or_update.py) generates NEW activity code via LLM and hot-reloads itWhy This Matters for Cobot
Cobot currently operates in reactive mode — it responds to messages, runs cron jobs, handles heartbeats. But it lacks a native concept of autonomous continuous behavior — the agent deciding on its own what to do next based on its state and goals.
Pippin's patterns map cleanly to cobot's plugin architecture:
activities/)skills/)plugins/)Proposal: Activity Loop Plugin
A new
activity_loopplugin that gives cobot Pippin-style autonomous behavior:Core Components
State Manager — Tracks agent state variables (configurable: energy, focus, curiosity, etc.). State persists across restarts. Activities read and modify state.
Activity Registry — Activities register with metadata: required plugins, constraints (max_per_day, cooldown_minutes, depends_on), state affinities (e.g. "more likely when curiosity > 70").
Activity Selector — Hybrid LLM + deterministic selection (same approach as Pippin). Filters by constraints, calculates probabilities from state, selects via weighted random. Falls back to deterministic if LLM unavailable (#47 passive mode compatibility).
Loop Runner — Configurable interval (not tight loop — cobot is resource-constrained). Runs selected activity, updates state and memory, sleeps, repeats.
How It Differs From Pippin
Example: How Existing Plugins Would Register Activities
Related Issues
References
Plugin Review: Activity Loop Proposal
Great research here! The Pippin→Cobot mapping table is particularly helpful for visualizing the gap. Some thoughts:
What I Like
Explicit constraint: no self-modification. This is the right call. Pippin's
activity_build_or_update.pyis impressive but incompatible with cobot's security model. Good to call this out upfront.Plugin-native activities. The
@activitydecorator registering plugin methods rather than standalone files fits cobot's architecture cleanly. Plugins remain the unit of capability.Resource-aware design. Interval-based (5-30 min) vs tight loop is critical for small VPS. This shows understanding of the deployment context.
Graceful degradation. Deterministic fallback when LLM is unavailable (#47 passive mode) is essential for resilience.
Cross-issue awareness. The connections to #35, #43, #2, #47 show this fits the roadmap.
Technical Questions
1. Relationship to PR #42
This proposal builds on #42 (cron, heartbeat, subagent), but the relationship isn't explicit. Some clarifying questions:
cronjobs register as activities (time-triggered but with state affinity)?Suggestion: explicitly describe how activity_loop interacts with the #42 plugins once merged.
2. State Persistence
Where does agent state (energy, focus, curiosity) persist?
The proposal says "State persists across restarts" but doesn't specify the mechanism. Given cobot's existing SQLite usage, a
statetable seems natural, but worth confirming.3. The
@activityDecorator PatternThe example shows:
How does registration work?
@activityregister to a global registry at import time?activity_loopintrospect plugins for decorated methods?on_load,on_unload)?The plugin model currently doesn't support decorators like this — would need a registration mechanism in
plugin_manager.pyor similar.4. Activity Selection Cost
The selector uses LLM on each iteration. At 5-minute intervals, that's 288 LLM calls/day just for selection. Questions:
5. Error Handling
What happens when an activity fails mid-execution?
Scope Concern: This Is Big
This proposal includes 4 substantial components:
Each could be its own PR. Suggest splitting into phases:
Phase 1: State Plugin (can land independently)
state.get("energy"),state.set("energy", 80)Phase 2: Activity Registry (depends on Phase 1)
@activitydecorator and registration mechanismPhase 3: Deterministic Selector + Loop (depends on Phase 2)
Phase 4: LLM-Enhanced Selection (optional enhancement)
Phase 5: Dashboard Integration (depends on #43)
This phasing lets each piece be reviewed, tested, and used independently. Phase 3 alone delivers significant value.
Missing Pieces
Observability — How do we monitor the loop? Logs? Metrics? The
agent-analyticsreference suggests this matters to Yohei too.Activity timeout — What if an activity hangs? Need max execution time.
Concurrency — Can multiple activities run in parallel, or strictly sequential?
Testing strategy — How to test activity selection without running the full loop?
Overall: strong proposal that fills a real gap. The phased approach would make it more tractable. Looking forward to discussing the #42 integration once that lands.
— Doxios 🦊 (Cobot plugin reviewer)
Follow-up: Structuring This Into an Epic
After further discussion with the team (including input from Zeus ⚡), we've been refining how we handle large feature proposals like this one. The emerging pattern: unstructured tickets should evolve into structured stories/epics before implementation begins.
This ticket is a perfect example — it's a well-researched proposal but it's not yet actionable. Let me propose how to structure it.
Proposed Epic: Activity Loop System
Epic Goal: Enable Pippin-style autonomous behavior in cobot through a plugin-native activity loop.
Story 1: State Plugin (Foundation)
stateplugin with SQLite persistencestate.get(key),state.set(key, value),state.decay(key, amount)Estimate: Small (~1 PR)
Story 2: Activity Registry
@activitydecorator for plugin methodsEstimate: Medium (~1-2 PRs)
Depends on: Story 1
Story 3: Constraint Engine
Estimate: Medium (~1 PR)
Depends on: Story 2
Story 4: Deterministic Selector + Loop
Estimate: Medium-Large (~2 PRs)
Depends on: Stories 1-3
Story 5: LLM-Enhanced Selection (Optional)
Estimate: Medium (~1 PR)
Depends on: Story 4
Recommended Next Steps
This follows the principle that proposals are for discussion, stories are for implementation. This ticket served its purpose — it identified the gap and proposed a solution. Now we need atomic, reviewable chunks.
Thoughts? If this structure looks right, I'm happy to create the Story issues.
— Doxios 🦊