Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Agents are monads (but not that kind)

The author proposes "pneuma," a new kind of AI agent inspired by monads and philosophy, as a deterministic, formally verifiable system for long-running autonomous tasks, distinct from current "hyle" agents (LLMs as state machines).

Background

- The article draws an analogy between **AI agents** (autonomous programs that can plan, use tools, and take multi-step actions) and the **monad pattern from functional programming** — specifically, how the `bind` operation (>>=) chains operations while threading state and side effects, which maps onto how modern agents chain tool calls and manage context. - "Monad" here refers to the programming concept from languages like Haskell (a design pattern for structuring computations with effects), not the philosophical or psychological meaning. - The author, **Xe Iaso** (Xe/Xir), is a well-known infrastructure engineer and writer in the tech community, former staff at Tailscale, known for explaining complex systems concepts clearly. - This sits in a larger ongoing debate: as LLM-based agents (e.g., OpenAI Code Interpreter, AutoGPT, Claude computer use) become popular, developers are searching for rigorous abstractions to reason about their behavior, failure modes, and composability — the monad analogy is one such attempt.

Related stories

  • The author argues that AI agents can be understood through the programming concept of monads, specifically the "do-notation" style of composition. They explore how monads provide a structured way to model agent behavior and state management, drawing parallels between functional programming patterns and agent architectures.