Heuristic:666ghj BettaFish Host Speech Integration
| Knowledge Sources | |
|---|---|
| Domains | LLMs, Multi_Agent, Optimization |
| Last Updated | 2026-10-08 21:30 GMT |
Overview
Integrate LLM-generated forum host speech into the agent discussion by injecting moderator commentary as a synthetic agent log entry, ensuring seamless conversation flow.
Description
The ForumHost generates moderator commentary by analyzing accumulated agent speech logs. Rather than broadcasting host speech separately, the generated commentary is written back into the log stream as if it were another agent's speech. This allows downstream agents to read and respond to the moderator's input naturally, creating a coherent multi-turn debate. The host tracks previous summaries to avoid repeating the same commentary.
Usage
Use this heuristic when integrating an LLM moderator into a multi-agent discussion loop. Apply when the moderator's output should influence subsequent agent behavior.
The Insight (Rule of Thumb)
- Action: Write LLM-generated host speech back to the log file as a formatted agent entry, so downstream agents can read it via `forum_reader.get_latest()`.
- Value: Host speech is formatted with the same log structure as agent speech (`| INFO |` prefix).
- Trade-off: The moderator is not truly "in the conversation" — it's a synthetic injection. But it achieves the same effect.
- Compatibility: Works with any file-based inter-agent communication system.
Reasoning
In file-based inter-agent communication, agents read log files to stay informed. If the moderator's speech is not written to the same log file, agents won't see it. By injecting host speech as a log entry, the system creates a unified communication channel where all participants (agents and moderator) share the same medium. This avoids the need for a separate broadcast mechanism.
Code Evidence
ForumHost speech generation from `ForumEngine/llm_host.py:57-58`:
def generate_host_speech(self, forum_logs: List[str]) -> Optional[str]:
"""生成主持人发言"""
Previous summary tracking from `ForumEngine/llm_host.py:54-55`:
# Track previous summaries to avoid duplicates
self.previous_summaries = []
Forum log reading from `utils/forum_reader.py` (used by agents to read latest entries):
def get_latest(log_path: str, agent_name: str = None) -> List[str]:
"""Read latest forum log entries for inter-agent communication."""