Capability notes
Long-running autonomous agents in 2026 — direct successors to AutoGPT (2023) — operate without continuous human guidance for hours or days. The agent receives a high-level goal ("monitor competitor pricing daily and alert on >5% changes," "research quantum computing startups and maintain a structured database"), decomposes it into subtasks, executes them over time, and self-corrects on failure. This is distinct from short-lived coding or workflow agents — the autonomy window extends from minutes to days.
Three architectural patterns define the space. **Goal-decomposition agents** (BabyAGI lineage) maintain a task list — the agent pops the highest-priority task, executes it, evaluates results, and adds new tasks derived from outputs. **Reflection-loop agents** (Reflexion pattern) execute action → observe → evaluate → replan — the evaluation step is an LLM self-critique that drives replanning. **Memory-augmented agents** (MemGPT/Letta lineage) maintain a long-term memory store separate from the context window — the agent reads relevant memories into context, executes, and writes new memories, enabling multi-day continuity.
[Llama 3.3 70B](/models/llama-3-3-70b) is the minimum viable model for autonomous agents — 70B maintains goal coherence for ~50-100 steps before context pollution degrades planning quality. [DeepSeek V4](/models/deepseek-v4) extends coherence to ~200-400 steps through stronger reasoning and larger context window. 7-32B models lose goal coherence after 15-30 steps — useful for short autonomous windows (30-60 minutes) but unreliable for multi-hour operation.
The critical failure mode is **goal drift**: the agent's current subtask gradually diverges from the original goal. Step 1 aligns perfectly, step 30 is tangentially related, step 100 is an unrelated activity that the agent mistakenly believes serves the goal. Memory-augmented architectures reduce but don't eliminate drift — the agent re-reads the original goal from memory each step, but its interpretation of how the current subtask relates to the goal is generated by the same LLM that's drifting.
If you just want to try this
Lowest-friction path to a working setup.
Start with a single-task autonomous agent that runs for 5-10 minutes before you scale to multi-hour operation. Use [Ollama](/tools/ollama) with [Llama 3.3 70B](/models/llama-3-3-70b) and a simple Python goal-decomposition loop:
```python
import ollama, json, time
goal = "Find the top 5 open-source alternatives to Jira and summarize their key features"
task_list = [goal]
memory = []
for step in range(20):
task = task_list.pop(0)
response = ollama.chat(model='llama3.3:70b', messages=[{
'role': 'system', 'content': f'Original goal: {goal}\
Memory: {memory[-5:]}\
Current task: {task}\
Execute this task. Return JSON: {{"result": "...", "new_tasks": [...], "done": true/false}}'
}])
result = json.loads(response['message']['content'])
memory.append({'task': task, 'result': result['result']})
task_list.extend(result.get('new_tasks', []))
if result.get('done'): break
time.sleep(1)
```
This 10-line agent runs for ~5-10 minutes on a [RTX 4090](/hardware/rtx-4090), costs $0 in API fees, and produces research output. Observe how quickly the agent diverges — by step 10, it may be summarizing SaaS pricing models rather than Jira alternatives.
For a pre-built framework, use AutoGPT (now maintained by Significant Gravitas) or SuperAGI. Connect to local [Ollama](/tools/ollama) for zero-cost operation. These frameworks provide goal decomposition, tool integration (web search, file read/write, code execution), and basic memory — a faster start than building from scratch.
The beginner insight: autonomous agents succeed when the goal is **narrow, fact-seeking, and verifiable** ("list X," "find Y," "extract Z from files A, B, C"). They fail when the goal requires **judgment, creativity, or open-ended exploration** ("improve my writing," "find investment opportunities," "optimize my workflow"). Start narrow. Don't give an agent an unbounded goal.
For production deployment
Operator-grade recommendation.
Production autonomous agents operate within guardrail frameworks that prevent runaway behavior while enabling multi-hour autonomy.
**Agent lifecycle management.** Launch: agent receives goal, constraints, resource budget (max steps, max cost, max wall-clock time), and termination conditions. A supervisor process monitors the agent, enforces constraints, and terminates the agent if budget exceeded. Heartbeat: agent pings supervisor every N steps; if the heartbeat stops (agent crashed or hung), the supervisor restarts from the last checkpoint. Max lifetime: 8 hours for a single agent instance — after that, archive state and spawn a fresh instance to continue (prevents context pollution accumulation).
**Goal-decomposition engine.** The planning model ([DeepSeek V4](/models/deepseek-v4) or [Llama 3.3 70B](/models/llama-3-3-70b)) receives the goal and generates a task tree: root goal → sub-goals → tasks → subtasks. Each leaf node is a single LLM invocation (query, summarize, extract, classify). The execution engine processes leaf nodes breadth-first, re-evaluating the task tree every N leaves to incorporate new information. Tree depth max: 4 levels. Beyond 4 levels, decomposition error compounds and subtasks lose connection to root goal.
**Memory architecture.** Short-term memory: the last 20 interactions (prompt + response + observations) in context window. Medium-term memory: structured summaries of completed tasks stored in a vector database ([Qdrant](/tools/qdrant) or [pgvector](/tools/pgvector)) retrieved by relevance to current task — implements [BGE-M3](/models/bge-m3) embeddings + [BGE Reranker V2 M3](/models/bge-reranker-v2-m3) for retrieval quality. Long-term memory: key findings, decisions, and state written to a structured knowledge base (SQLite/Postgres) that persists across agent sessions. Memory retrieval cost: 50-200 tokens per retrieval — negligible relative to action tokens.
**Safety guardrails.** (1) Action allowlist — the agent can only execute actions from a predefined set (web search, read file, write file, run Python in sandbox, query database). No shell access, no network to internal systems, no email/slack send. (2) Resource caps — max 100 steps, max $5 API cost, max 4 hours. Supervisor enforces. (3) Output validation — agent outputs (files, database writes, API calls) are validated before external exposure. (4) Kill switch — supervisor can SIGTERM the agent process immediately.
**When autonomous agents fail.** They fail when: (1) the goal is underspecified — "improve sales" needs decomposition that the agent can't generate; (2) the environment changes faster than the agent replans — a price-monitoring agent with 1-hour replanning cycle on prices that change every 5 minutes; (3) necessary information is behind authentication that the agent can't pass. Design around these failure boundaries.
What breaks
Failure modes operators see in the wild.
- **Goal drift / mission creep.** Symptom: agent starts monitoring competitor pricing, but by hour 3 it's researching industry M&A trends and generating SWOT analyses — interesting but not the assigned goal. Cause: each subtask's output generates "related" new tasks; the relatedness chain eventually departs from the goal. Mitigation: every N steps (5-10), re-evaluate the current task against the original goal with a separate LLM call — "does this task directly serve the original goal?" If the relevance score is below threshold (0.7), drop the task. Keep the original goal in every prompt's system message.
- **Recursive task generation.** Symptom: agent's task list grows from 3 tasks to 500 tasks in 30 minutes. Each completed task generates 3-5 new tasks; those generate 3-5 more. The agent drowns in self-generated work. Cause: the task generation prompt is too permissive — any interesting tangent becomes a task. Mitigation: limit new tasks per completion to 2-3. Require each new task to cite which part of the original goal it serves. Cap task list at 20 — when full, prune lowest-relevance tasks before adding new ones. Track task generation rate; alert if >1 new task per completed task.
- **Action repetition loop.** Symptom: agent searches for "Jira alternatives," gets results, summarizes them, then searches for "Jira alternatives" again with slightly different query, repeats 10 times. Cause: agent doesn't recognize it has already covered this ground — the search results look different (pagination, time-based ranking changes) but are substantively identical. Mitigation: deduplicate search queries and information sources. Before executing any action, check if a semantically similar action was already performed (embedding similarity >0.95). Maintain a "completed work" log that the LLM reviews before proposing next actions.
Hardware guidance
**Hobbyist ($1,500-$2,500 GPU).** [RTX 4090](/hardware/rtx-4090) 24GB runs [Llama 3.3 70B](/models/llama-3-3-70b) Q4 for autonomous agents at 22-28 tok/s. An agent averaging 10 steps/hour at 3K tokens/step consumes ~30K tokens/hour — well within the GPU's capability. [RTX 5090](/hardware/rtx-5090) 32GB enables 70B Q8 for higher-quality reasoning, or 70B Q4 with 32K context for longer autonomy windows (more memory in context). [MacBook Pro 16" M4 Max](/hardware/macbook-pro-16-m4-max) 64GB runs 70B on SoC — the power efficiency (30-60W vs 450W for RTX 4090) matters for 24/7 autonomous agent operation. A Mac running an agent continuously costs ~$50/year in electricity; an RTX 4090 costs ~$400/year.
**SMB ($6,000-$15,000).** [NVIDIA L40S](/hardware/nvidia-l40s) 48GB or [RTX 6000 Ada](/hardware/rtx-6000-ada) 48GB runs [Llama 3.3 70B](/models/llama-3-3-70b) FP8 at 80-100 tok/s with 32K context. Serves 10-30 concurrent long-running agent instances — each agent calls the LLM sporadically (every 1-5 minutes), so a single GPU time-slices efficiently across agents with [vLLM](/tools/vllm) continuous batching.
**Enterprise ($25,000+).** [NVIDIA H100 PCIe](/hardware/nvidia-h100-pcie) 80GB runs [DeepSeek V4](/models/deepseek-v4) for frontier autonomous agents — 140-170 tok/s at 64K context, supporting complex multi-day research agents. 80GB handles DeepSeek V4 FP8 with 64K context + KV cache. [NVIDIA H200](/hardware/nvidia-h200) 141GB supports 128K context for agents with extended memory in context.
**24/7 operation costs.** Autonomous agents are always-on workloads — the GPU runs continuously, not bursty. Power costs dominate. [RTX 4090](/hardware/rtx-4090): 450W × 24h × 365d × $0.12/kWh = $473/year. [NVIDIA L40S](/hardware/nvidia-l40s): 350W → $368/year. [MacBook Pro 16" M4 Max](/hardware/macbook-pro-16-m4-max): 30-60W → $32-63/year. Apple Silicon's power efficiency makes it the TCO winner for always-on autonomous agents, trading off throughput (20-30 tok/s vs 80-100 tok/s) for 10× lower electricity cost.
Runtime guidance
**If building a goal-decomposition agent** → Python + [Ollama](/tools/ollama) or [vLLM](/tools/vllm) for LLM inference + SQLite for memory. The core loop: `while task_list and step < max_steps: task = prioritize(task_list); result = execute(task); evaluate(result); add_new_tasks(result, task_list); update_memory(result)`. Keep the loop simple — most agent frameworks (AutoGPT, SuperAGI, BabyAGI) add complexity without proportional reliability improvement.
**If needing persistent memory across sessions** → Letta (formerly MemGPT) + [Ollama](/tools/ollama). Letta manages a virtual context window that pages memories in/out of the LLM's context, enabling multi-day sessions without context overflow. Configure Letta to use [BGE-M3](/models/bge-m3) for memory embedding and retrieval. Setup: `pip install letta; letta run --model ollama/llama3.3:70b`.
**If building research agents that search the web** → Agent with web search tool (SerpAPI, Brave Search API) + content extraction tool (Jina Reader, Firecrawl, or Playwright). The agent's core loop: search → extract → synthesize → evaluate → search more if needed. Cap search iterations at 5 — exhaustive research produces diminishing returns after 5 rounds of search-and-synthesize.
**If building monitoring agents (periodic checks)** → Cron-triggered agent invocation rather than continuously running agent. Every hour: spawn agent, feed it the monitoring target + last report, agent generates new report, agent exits. This is simpler, cheaper, and more reliable than a continuously running agent that maintains state — state is the last report, stored externally.
**If running agents on Apple Silicon** → [MLX LM](/tools/mlx-lm) with the Python agent framework. MLX's Python bindings allow direct model inference without an HTTP server — lower overhead for single-agent operation. For multi-agent on one Mac, run [LM Studio](/tools/lm-studio) as the inference server.
**If running agents 24/7 with power efficiency priority** → [MacBook Pro 16" M4 Max](/hardware/macbook-pro-16-m4-max) running [MLX LM](/tools/mlx-lm) + lightweight Python agent loop. 30-60W continuous power draw, <$5/month electricity. Agent throughput is 20-30 tok/s — sufficient for tasks where the agent spends most time waiting (web scraping, API rate limits, scheduled checks) rather than generating tokens.