You should write an agent

What an “Agent” Is and Why Build One

  • Consensus that an agent is: an LLM called in a loop, with tools it can invoke to act on the world (files, shell, APIs, browsers, etc.).
  • Several people stress this is higher-level than “just calling an LLM” and more like building a web service around a model.
  • Main argument for writing one: to demystify how coding assistants and “AI products” work and to gain intuition about capabilities and limits, not necessarily to ship production systems.

Architecture, Patterns, and Context Management

  • Common mental models: finite state machines, DAGs driven by an event loop, or a very simple while loop that runs tool calls until a stop condition.
  • Biggest practical problem is context management, not control flow:
    • Dealing with small context windows via sub-agents with specialized context.
    • Summarization, “lobotomizing”/purging large tool outputs, and explicit rules for what to keep.
    • Caching, context compaction, and history truncation for long sessions.
  • Several note that “design patterns” are emergent and domain-specific; the hard part is deciding what to do, not wiring the loop.

Tools vs MCP vs CLIs

  • Strong current in favor of “just use APIs/CLIs”: give the LLM Unix-like tools (ping, ps, curl, jq, playwright, etc.) and describe them via JSON schema or help text.
  • Multiple commenters see MCP as overhyped “plugin plumbing” tied to specific IDEs; others argue MCP (JSON-RPC plus schemas) is the only promising interoperability layer for multi-agent, multi-language systems.
  • Tool calling is described as structured-output over JSON Schema with constrained decoding; you can also implement it yourself with ReAct-style text markers.

Use Cases and Experiences

  • Reported successes: personal coding agents, network diagnostics, log viewers with UIs, memory-backed personal assistants, semi-automated testing, and home-automation-style orchestration.
  • Many use agents mainly as “fuzzy glue”: command discovery, config editing, pretty-printing, and orchestration around deterministic code.

Skepticism, Safety, and Economics

  • Concerns: non-determinism, debugging multi-step failures, hallucinated tool use, and cascading errors across sub-agents.
  • Security worries about letting LLMs run shell; mitigations include strict whitelisting, sandboxing (Docker, VMs, micro-sandboxes), and limited file/network scopes.
  • Debate over whether inference is profitable and whether building businesses atop third-party APIs is sustainable.
  • Some see agents as “token-burning CGI scripts of the 2020s”; others say even toy agents are already indispensable in their workflows.

Local Models and Cost

  • Multiple suggestions to experiment with local models (Qwen variants, etc.) via Ollama/llama.cpp for cheap learning, accepting reduced capability and smaller context.
  • Cloud options (OpenRouter, Gemini, free tiers) are mentioned as inexpensive ways to experiment with small agents.