This article examines the architectural implications of choosing between stateless and stateful designs when building agentic systems. It evaluates how an agent's approach to managing memory impacts deployment, horizontal scaling, and client-side complexity.
- Stateless agents allow for easy horizontal scaling since no user memory is stored on a backend server, but they require the client to send the full conversation history with every request, leading to increased token usage as conversations grow.
- Stateful agents manage their own context through a database layer using session identifiers, which simplifies client interactions and supports complex workflows, though it introduces challenges in distributed scaling and data persistence.
Tansu, an open-source, Apache Kafka-compatible messaging broker, challenges traditional approaches by prioritizing statelessness. Instead of replicating data like Kafka, Tansu delegates durability to external storage, allowing for brokers that are lightweight ("cattle," not "pets") and scale rapidly. It supports various storage backends like S3, SQLite, and Postgres, with a particular emphasis on Postgres integration for streamlined data pipelines. Tansu also offers broker-side schema validation and the ability to directly write validated data to open table formats like Iceberg, Delta Lake, or Parquet. The project is written in Rust and seeks contributors.