<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tomer Barak</title>
    <description>The latest articles on DEV Community by Tomer Barak (@tomer_barak).</description>
    <link>https://dev.to/tomer_barak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3000446%2Ff7e4e950-115a-48c7-bf3c-4be64c0eecba.png</url>
      <title>DEV Community: Tomer Barak</title>
      <link>https://dev.to/tomer_barak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tomer_barak"/>
    <language>en</language>
    <item>
      <title>BarakBot</title>
      <dc:creator>Tomer Barak</dc:creator>
      <pubDate>Tue, 01 Apr 2025 04:15:57 +0000</pubDate>
      <link>https://dev.to/tomer_barak/barakbot-91k</link>
      <guid>https://dev.to/tomer_barak/barakbot-91k</guid>
      <description>&lt;p&gt;BarakBot (ברק בוט) is an advanced multi-agent system where users interact with specialized Language Learning Models (LLMs) via a Telegram bot interface. Originally designed for family communication in both Hebrew and English, the project has evolved into a comprehensive personal assistant capable of handling various tasks through different specialized agents, each with specific roles and capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Multi-Agent Architecture
&lt;/h3&gt;

&lt;p&gt;BarakBot utilizes a self-referential agent architecture where specialized LLM agents collaborate to handle different tasks. Rather than using a complex "agent hub," each agent can request assistance from other agents by communicating with the bot itself—the same way a human user would. This creates a more natural interaction flow and simplifies system architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tasker Agent with Obsidian Integration
&lt;/h3&gt;

&lt;p&gt;The newest addition to BarakBot is a dedicated Tasker Agent that helps users manage their tasks, projects, and information using an integrated Obsidian vault:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates, reads, updates, and deletes notes in an organized structure&lt;/li&gt;
&lt;li&gt;Maintains a working memory to track user preferences and ongoing tasks&lt;/li&gt;
&lt;li&gt;Implements a comprehensive priority system for tasks:

&lt;ul&gt;
&lt;li&gt;🔺 Highest priority (critical and time-sensitive)&lt;/li&gt;
&lt;li&gt;⏫ High priority (important but not critical)&lt;/li&gt;
&lt;li&gt;🔼 Medium priority (should be done soon)&lt;/li&gt;
&lt;li&gt;🔽 Low priority (can wait if needed)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Adds due dates to time-sensitive tasks with 📅 format&lt;/li&gt;

&lt;li&gt;Tracks task completion status ([ ] vs [x])&lt;/li&gt;

&lt;li&gt;Organizes information in a logical folder structure&lt;/li&gt;

&lt;li&gt;Presents information naturally without exposing the underlying note-taking system to users&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  General Agent &amp;amp; Session Management
&lt;/h3&gt;

&lt;p&gt;A general agent serves as the primary interface, managing conversation flows and deciding when to invoke specialized agents. It maintains context-aware conversations in sessions, with prompts and responses handled appropriately based on whether the interaction is in a private chat or group setting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scheduler Integration
&lt;/h3&gt;

&lt;p&gt;The scheduler agent manages notifications and reminders based on triggers defined in a JSON file. It can handle both recurring schedules (using cron syntax) and one-time events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users can set up reminders for specific times or days&lt;/li&gt;
&lt;li&gt;The scheduler can trigger other agents automatically&lt;/li&gt;
&lt;li&gt;Cross-chat communication is supported, allowing messages to be sent between different chats&lt;/li&gt;
&lt;li&gt;Reminders can be modified or rescheduled as needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Photo Handling
&lt;/h3&gt;

&lt;p&gt;The photo agent manages image sharing and captioning. Users can request photos from specific time periods or with particular family members, and the agent will retrieve and caption appropriate images. This creates an interactive photo-sharing experience that feels natural and contextual.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web UI
&lt;/h3&gt;

&lt;p&gt;A web interface provides tools for prompting and testing the LLMs, making it easier to develop and refine prompts without going through the Telegram interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Self-Referential Design
&lt;/h3&gt;

&lt;p&gt;The self-referential agent architecture allows BarakBot to function as a cohesive system while maintaining specialized capabilities. When an agent needs functionality outside its domain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It identifies the need for another agent's capabilities&lt;/li&gt;
&lt;li&gt;Rather than using a dedicated communication channel, it simply sends a message to the bot itself&lt;/li&gt;
&lt;li&gt;The bot routes the message to the appropriate specialized agent&lt;/li&gt;
&lt;li&gt;The response is returned through the same channel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach simplifies agent coordination without requiring additional infrastructure, creating a more natural and coherent experience for both users and the system itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Action-Based Communication
&lt;/h3&gt;

&lt;p&gt;All agents use a standardized action-based communication format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ACTIONS:
ACTION1_parameters_END_ACTION1
ACTION2_parameters_END_ACTION2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a consistent interface between components and allows for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal thinking processes (THINK action) that aren't shown to users&lt;/li&gt;
&lt;li&gt;Natural responses in the appropriate language (RESPOND action)&lt;/li&gt;
&lt;li&gt;Agent-to-agent communication (CHAT_AGENT action)&lt;/li&gt;
&lt;li&gt;Specialized actions for each agent type (e.g., GET_PHOTO, VAR_CIBUS_RUN)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technologies Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python for backend logic and agent coordination&lt;/li&gt;
&lt;li&gt;Telegram Bot API for messaging and user interactions&lt;/li&gt;
&lt;li&gt;OpenAI's GPT models for language understanding and natural responses&lt;/li&gt;
&lt;li&gt;Obsidian for structured information and task management&lt;/li&gt;
&lt;li&gt;Flask for the web testing interface&lt;/li&gt;
&lt;li&gt;JSON for configuration and scheduling data&lt;/li&gt;
&lt;li&gt;Web search capabilities for real-time information access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information, see my &lt;a href="https://tomer-barak.github.io" rel="noopener noreferrer"&gt;website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>assistant</category>
      <category>telegram</category>
    </item>
    <item>
      <title>Self-refernce in AI agents</title>
      <dc:creator>Tomer Barak</dc:creator>
      <pubDate>Tue, 01 Apr 2025 04:13:10 +0000</pubDate>
      <link>https://dev.to/tomer_barak/self-refernce-in-ai-agents-2nlh</link>
      <guid>https://dev.to/tomer_barak/self-refernce-in-ai-agents-2nlh</guid>
      <description>&lt;p&gt;BarakBot (ברק בוט) is an advanced multi-agent system where users interact with specialized Language Learning Models (LLMs) via a Telegram bot interface. Originally designed for family communication in both Hebrew and English, the project has evolved into a comprehensive personal assistant capable of handling various tasks through different specialized agents, each with specific roles and capabilities.&lt;/p&gt;

&lt;p&gt;In developing BarakBot, I encountered a fundamental challenge in multi-agent coordination. How should distinct AI agents communicate effectively while keeping the architecture simple and scalable? The solution turned out to be surprisingly intuitive: let them talk to themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Multi-Agent Challenge
&lt;/h2&gt;

&lt;p&gt;BarakBot consists of multiple specialized LLM agents operating within a Telegram bot interface:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;general agent&lt;/strong&gt; managing conversations and delegating tasks&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;photo agent&lt;/strong&gt; generating captions for images&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;scheduler agent&lt;/strong&gt; handling reminders and notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each agent performs well in isolation, but they often need to collaborate. For example, the photo agent might need the scheduler agent to remind a user about an analyzed image. The naive approach—hardcoding direct interactions—quickly becomes unmanageable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Conventional Approach: Centralized Agent Hub
&lt;/h2&gt;

&lt;p&gt;A typical solution is to implement an "agent hub," a structured interface where agents formally request services from each other. While common in multi-agent systems, this method introduces unnecessary complexity:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Requires additional infrastructure for agent communication&lt;/li&gt;
&lt;li&gt;Adds debugging challenges as the network of interactions expands&lt;/li&gt;
&lt;li&gt;Creates separate protocols for human-agent and agent-agent interactions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach felt artificial—unlike how humans coordinate thoughts and actions internally.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Self-Referential Solution
&lt;/h2&gt;

&lt;p&gt;The breakthrough came when I reframed the problem from an agent's perspective. If an agent needed another agent's help, what would be the most natural way to request it? The answer: do exactly what a human user does—send a message to the bot.&lt;/p&gt;

&lt;p&gt;This is related to an interesting observation: while the agents were switching behind the scenes, users didn't notice the transitions. From the human perspective, the bot remained a singular, coherent entity, even as it dynamically changed between specialized agents. This revealed a key insight: humans naturally maintain a unified mental model of the bot, regardless of its internal complexity.&lt;/p&gt;

&lt;p&gt;If the system was coherent enough for users to treat it as one entity, why not let the agents do the same? Instead of addressing specific subcomponents, each agent could simply refer to a single, overarching "assistant"—which, in reality, &lt;strong&gt;is just the bot itself&lt;/strong&gt;. When an agent requires a capability it lacks, it simply asks the bot, which routes the request appropriately—just as it does for human users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Works
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity:&lt;/strong&gt; No additional communication protocols or infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; The same mechanism handles human and agent interactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; New agents integrate seamlessly without modifying existing connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This approach simplifies multi-agent coordination without requiring additional infrastructure, allowing agents to leverage existing communication channels. By treating the bot as a unified entity, both users and agents interact with it in a way that feels natural and coherent.&lt;/p&gt;

&lt;p&gt;More broadly, this highlights an interesting parallel between AI coordination and human cognition. Just as people maintain a stable sense of identity despite shifting internal processes, AI agents can function cohesively within a larger system while operating independently behind the scenes.&lt;/p&gt;

&lt;p&gt;There is still much to explore, especially in understanding the implications of self-referential communication in AI systems. As BarakBot evolves, these insights will help refine its design and expand its capabilities. For more details, visit my &lt;a href="https://tomer-barak.github.io" rel="noopener noreferrer"&gt;website&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>llm</category>
      <category>cognition</category>
    </item>
  </channel>
</rss>
