Skip to content

Autonomous loop: think-act-schedule cycle with planning prompt #557

@kovtcharov

Description

@kovtcharov

Summary

Implement the core autonomous execution loop — the agent periodically wakes up, evaluates context, decides what to do, executes, and optionally schedules a follow-up. Driven by an autonomous planning prompt.

Parent issue: #555 (Autonomous mode)

Architecture

Agent wakes up (timer fires or session starts)
    |
    v
Recall context (memory, recent tasks, scheduled results)
    |
    v
Autonomous planning prompt evaluates and decides
    |
    +-- Nothing actionable -> idle (check again at next interval)
    |
    +-- Action needed -> execute -> store results -> schedule follow-up if needed

Planning Prompt

You are running in autonomous mode. Review your current context:
- Recent memory: {recalled_context}
- Pending scheduled results: {pending_results}
- User goals and preferences: {preferences}
- Available tools: {tool_list}

Decide what action would be most helpful right now. Options:
1. Surface information the user would want to know
2. Follow up on a previous task
3. Discover something new about the environment
4. Ask the user a question to learn their preferences
5. Do nothing - everything is up to date

Prioritize actions the user explicitly asked for, then things related to
their stated goals, then general discovery.

Preemption

User messages always preempt autonomous actions. The cycle yields immediately when a user message arrives.

Limits and Cool-Down

Setting Default Scope
Max actions per cycle 20 Per autonomous wake-up
Max actions per hour 50 Rolling window
Minimum cool-down between cycles 5 min Prevents one-shot storms
Proactive check interval 1h Default wake-up interval
Quiet hours None Optional suppression window

Settings

  • Autonomous mode toggle (on by default)
  • Configurable check interval, limits, quiet hours
  • Kill switch in settings

Acceptance Criteria

  • Agent wakes up on interval and runs planning prompt
  • Planning prompt correctly evaluates context and decides action vs idle
  • Results stored to KnowledgeDB and agent activity timeline
  • Follow-ups scheduled via one-shot delayed execution
  • User messages always preempt autonomous cycles
  • Per-cycle, per-hour limits enforced
  • 5-min minimum cool-down between cycles
  • Kill switch immediately stops all autonomous activity
  • Works via WebUI and CLI (gaia chat --autonomous)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentchatChat SDK changesdomain:automationScheduler, autonomy, RAG, web search, watchers, researchenhancementNew feature or requestp0high prioritytrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions