Thinking about a new programming paradigm. It is a result of thinking about how to…
- User
Thinking about a new programming paradigm. It is a result of thinking about how to approach LLM workfows, but I think it can have broader use. Not considering LLMs now, the principles are: The main components are:
- Agencies - they are static, they have no variable state, they are configured at the program startup.
- Agents - They have runtime mutating state, they can send messages, - they send messages to another agent or to an agency. Agencies can be viewed as blueprints for agents. When an agency receives a message, it creates a new agent (of the agency type) and forwards the message to it.
Basically, it can be seen as an analogy of agents/agencies that communicate via emails. When uou send an email to an agency, it assigns one of it's agent (ok, create it) to handle the email. Agent has than it's own state, it can do actions based on it's programming and send emails to known addresses. What is important to realize, the resulting workflow can be easily made sequential - if the agents cannot send multiple mesages in parallel. When you stick to the rule - once an agent sends a message then it waits for a message or terminates, the resulting control flow is like of a sequential procedural program with an extension - you can forward the message, similar to when you reduce the assembly sequence:
call myproc returnto:
jmp myproc Assistant
This is a fascinating paradigm that seems to blend several existing concepts in an interesting way. Let me break down what I find particularly noteworthy:
-
The distinction between stateless agencies and stateful agents is reminiscent of the class/instance relationship in OOP, but with an important difference - agencies are purely factories that spawn agents, rather than templates that define behavior.
-
The message-passing model reminds me of the Actor model (as in Erlang/Elixir), but your approach seems more structured with the agency/agent split.
-
The sequential execution guarantee (when agents wait for responses) is particularly interesting. It provides a way to reason about the program flow more easily while maintaining the benefits of message-passing architecture.
Some questions and thoughts:
- How would you handle error conditions? Would an agent be able to "fail" and notify its creating agency?
- The model seems well-suited for workflows that naturally follow a request-response pattern. Have you considered how it might handle broadcast scenarios?
- The reduction to sequential flow you mentioned could make this very amenable to analysis and debugging - you could potentially trace the entire message chain deterministically.
This feels like it could be particularly useful for:
- Business process automation
- Request handling pipelines
- Workflow orchestration
- State machine implementations
Would you be interested in elaborating on how you envision the practical implementation details? For instance, how would you handle agent lifecycle management?
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
qwen3-235b-a22b-no-thinkingCompare side by side →
claude-sonnet-4-20250514Compare side by side →
claude-opus-4-20250514-thinking-16kCompare side by side →
gemini-2.5-flashCompare side by side →
claude-sonnet-4-20250514Compare side by side →
claude-3-5-sonnet-20241022Compare side by side →
claude-3-7-sonnet-20250219Compare side by side →