AI Agentic Collaboration powered by YAML
Matias Bonet
Entrepreneur at heart with passion for people, technology, AI, startups and sports
The world of artificial intelligence is buzzing with numerous concepts and ideas and one of the latest concepts is Agentic Workflows, which essentially means collaboration between agents.
This article aims to inspire efficient communication between agents. Currently, most online examples we encounter involve AI Agents responding in JSON, and in some cases, XML. While these formats are widely used, they fall short in scenarios where real-time processing and synchronization are crucial.
That's why, after reviewing easy, fast, and readable formats, my proposal is YAML: a human-friendly data serialization format that offers a different approach for agent-to-agent communication. Instead of building complex and nested objects with JSON or lengthy XML text, YAML provides a simpler alternative.
Think of a situation where two AI agents work together to solve difficult problems. Agent A is the "Thought Generator". Its job is to create detailed chains of thoughts, including decision trees and hypotheses (possible explanations or ideas). Agent B is the "Thought Evaluator". It carefully examines the thought processes created by Agent A. Agent B challenges the assumptions made by Agent A and improves the reasoning or thinking process.
In this scenario, Agent A comes up with complex ideas and suggestions for solving the problem. Agent B then checks those ideas, questions the assumptions behind them, and helps make the reasoning better or more accurate.
The YAML Advantage: Sequential Processing, Real-Time Collaboration
Traditional data formats like JSON and XML require complete data structures to be loaded before processing can begin. This can lead to delays and inefficiencies, especially in scenarios where agents need to exchange and process information in real-time. YAML, on the other hand, shines with its sequential nature, allowing agents to start processing data as soon as it arrives, without having to wait for the entire structure to be received.
Consider the following YAML exchange between our agents:
Message from Agent A (Thought Generator) to Agent B (Thought Evaluator):
sender: agent_a
receiver: agent_b
message_type: thought_process
data:
problem_statement: "Optimize time management for balancing an MBA, a full-time job, and family time."
thought_process:
- node:
type: hypothesis
content: "Creating a structured daily schedule could enhance efficiency."
children:
- node:
type: assumption
content: "Efficient time blocks are set for studying, working, and family activities without overlap."
- node:
type: decision
content: "Allocate specific hours early in the morning for studying and late evenings for family."
evaluation_required: true
In this example, Agent A sends its thought process to Agent B for evaluation. As soon as the message_type and problem_statement are received, Agent B can begin preparing its evaluation mechanisms. This sequential processing allows for real-time collaboration, enabling agents to work together seamlessly without delays.
领英推荐
Message from Agent B (Thought Evaluator) to Agent A (Thought Generator):
sender: agent_b
receiver: agent_a
message_type: thought_evaluation
data:
evaluation:
- node:
type: hypothesis
content: "Creating a structured daily schedule could enhance efficiency."
evaluation: partially_valid
comments:
- "A structured schedule is ideal, but flexibility is crucial to adapt to unexpected work or family needs."
- "Consider integrating buffer times for rest and unplanned activities."
- node:
type: assumption
content: "Efficient time blocks are set for studying, working, and family activities without overlap."
evaluation: invalid
comments:
- "Overlap is sometimes inevitable due to the dynamic nature of work and family responsibilities."
- "Assessing weekly priorities can help adjust time blocks more realistically."
- node:
type: decision
content: "Allocate specific hours early in the morning for studying and late evenings for family."
evaluation: needs_revision
comments:
- "Early morning hours might not be the most productive for everyone; consider personal energy peaks."
- "Ensure family time is flexible enough to accommodate everyone's schedules and needs."
In this response, Agent B provides a detailed evaluation of Agent A's thought process, challenging specific assumptions and offering suggestions for improvement. The sequential nature of YAML allows Agent A to process this feedback in real-time, without having to wait for the entire structure to be loaded.
The Benefits of YAML for Agent-to-Agent Communication
1. Sequential Processing: As demonstrated, YAML's sequential nature enables agents to start processing data as soon as it arrives, facilitating real-time collaboration and decision-making.
2. Human-Readable Format: YAML's clean and intuitive syntax makes it easy for developers and system administrators to understand and maintain agent communication protocols.
3. Efficient Data Transfer: YAML's compact representation and support for data types like strings, numbers, and booleans ensure efficient data transfer between agents, reducing overhead and improving performance.
This article aims to spark new thinking around the ways we create and enable communication between AI agents. Feel free to comment your thoughts or ideas on this matter :)