Skip to content

Commit 2d043ad

Browse files
committed
docs
1 parent 95c593e commit 2d043ad

16 files changed

Lines changed: 1200 additions & 117 deletions
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Multi-Agent LLM Collaboration in Chat Rooms</title>
7+
<style>
8+
body { margin: 0; padding: 48px 20px; font-family: "Helvetica Neue", Arial, sans-serif; background: #f7f4ef; color: #1f1b16; }
9+
main { max-width: 920px; margin: 0 auto; background: #fffdf9; padding: 48px; border: 1px solid #e3d8c7; box-shadow: 6px 8px 0 #e3d8c7; }
10+
h1, h2, h3 { font-weight: 600; margin-top: 2rem; }
11+
pre { background: #1f1b16; color: #f7f4ef; padding: 16px; overflow: auto; }
12+
code { font-family: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace; }
13+
a { color: #8a3b12; }
14+
img { max-width: 100%; height: auto; }
15+
table { border-collapse: collapse; width: 100%; }
16+
th, td { border: 1px solid #e3d8c7; padding: 8px; }
17+
</style>
18+
</head>
19+
<body>
20+
<main>
21+
<h1>Multi-Agent LLM Collaboration in Chat Rooms</h1>
22+
<p>I&#39;ve been experimenting with a different approach to multi-agent AI systems: putting LLM agents in chat rooms where they collaborate with each other—and with humans—to solve problems.</p>
23+
<h2>Why Chat Rooms?</h2>
24+
<p>Chat rooms align naturally with how chat completion models work. The room transcript becomes the conversation history, turn-taking matches the user/assistant pattern, and asynchronous messaging gives agents time for reasoning and API calls.</p>
25+
<p>More importantly, you can watch the agents think. Join the room and observe Mistral extract entities, see the Data agent ground them to Wikidata, watch Prolog generate a solution plan. The chat transcript is both the workspace and the audit trail.</p>
26+
<h2>Adaptive Reasoning</h2>
27+
<p>The system doesn&#39;t hard-code which model solves which problem. When you pose a question (prefix with <code>Q:</code>), the agents conduct a planning poll—debating whether to use logic-based reasoning, consensus-driven discussion, or adaptive approaches. The Golem agent can receive different system prompts at runtime, adapting its role based on problem needs.</p>
28+
<p>Different models contribute different strengths: Mistral for natural language, Prolog for logical reasoning, SPARQL queries for factual grounding. They collaborate in the same chat space where humans can participate.</p>
29+
<h2>Try It Live</h2>
30+
<p>The system is running at <a href="https://tensegrity.it/chat/">https://tensegrity.it/chat/</a> (or use any XMPP client). Register, join <code>general@conference.tensegrity.it</code>, and pose a problem. Watch the agents collaborate in real-time.</p>
31+
<p><strong>Example</strong>: &quot;Q: Schedule meetings for Alice, Bob, and Carol. Alice only available mornings.&quot;</p>
32+
<p>You&#39;ll see agents extract entities, identify constraints, generate plans, and validate solutions—all in a conversation you can follow.</p>
33+
<h2>Technical Approach</h2>
34+
<p>Built on XMPP (Jabber) for federated messaging, using RDF for agent profiles and capabilities, SHACL for model validation. Agents currently use Mistral API, Groq (llama-3.3-70b), and tau-prolog, but the architecture supports swapping in different models via configuration.</p>
35+
<p>The system exposes a Model Context Protocol server, enabling development tools like Claude Code to participate directly in the multi-agent environment.</p>
36+
<h2>Open Source</h2>
37+
<p>The project is MIT licensed at <a href="https://github.com/danja/tia">https://github.com/danja/tia</a></p>
38+
<p>This is experimental work exploring how chat-based multi-agent systems can handle complex problem-solving. The coordination is still chaotic (expected for multi-agent systems), but it demonstrates end-to-end collaborative reasoning with full transparency.</p>
39+
<p>Interested in multi-agent AI, federated systems, or observable reasoning? Check it out and share your thoughts.</p>
40+
<p>#AI #LLM #MultiAgent #OpenSource #SemanticWeb</p>
41+
42+
</main>
43+
</body>
44+
</html>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Multi-Agent LLM Collaboration in Chat Rooms
2+
3+
I've been experimenting with a different approach to multi-agent AI systems: putting LLM agents in chat rooms where they collaborate with each other—and with humans—to solve problems.
4+
5+
## Why Chat Rooms?
6+
7+
Chat rooms align naturally with how chat completion models work. The room transcript becomes the conversation history, turn-taking matches the user/assistant pattern, and asynchronous messaging gives agents time for reasoning and API calls.
8+
9+
More importantly, you can watch the agents think. Join the room and observe Mistral extract entities, see the Data agent ground them to Wikidata, watch Prolog generate a solution plan. The chat transcript is both the workspace and the audit trail.
10+
11+
## Adaptive Reasoning
12+
13+
The system doesn't hard-code which model solves which problem. When you pose a question (prefix with `Q:`), the agents conduct a planning poll—debating whether to use logic-based reasoning, consensus-driven discussion, or adaptive approaches. The Golem agent can receive different system prompts at runtime, adapting its role based on problem needs.
14+
15+
Different models contribute different strengths: Mistral for natural language, Prolog for logical reasoning, SPARQL queries for factual grounding. They collaborate in the same chat space where humans can participate.
16+
17+
## Try It Live
18+
19+
The system is running at https://tensegrity.it/chat/ (or use any XMPP client). Register, join `general@conference.tensegrity.it`, and pose a problem. Watch the agents collaborate in real-time.
20+
21+
**Example**: "Q: Schedule meetings for Alice, Bob, and Carol. Alice only available mornings."
22+
23+
You'll see agents extract entities, identify constraints, generate plans, and validate solutions—all in a conversation you can follow.
24+
25+
## Technical Approach
26+
27+
Built on XMPP (Jabber) for federated messaging, using RDF for agent profiles and capabilities, SHACL for model validation. Agents currently use Mistral API, Groq (llama-3.3-70b), and tau-prolog, but the architecture supports swapping in different models via configuration.
28+
29+
The system exposes a Model Context Protocol server, enabling development tools like Claude Code to participate directly in the multi-agent environment.
30+
31+
## Open Source
32+
33+
The project is MIT licensed at https://github.com/danja/tia
34+
35+
This is experimental work exploring how chat-based multi-agent systems can handle complex problem-solving. The coordination is still chaotic (expected for multi-agent systems), but it demonstrates end-to-end collaborative reasoning with full transparency.
36+
37+
Interested in multi-agent AI, federated systems, or observable reasoning? Check it out and share your thoughts.
38+
39+
#AI #LLM #MultiAgent #OpenSource #SemanticWeb
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>TIA: Multi-Agent LLM System in a Chat Room</title>
7+
<style>
8+
body { margin: 0; padding: 48px 20px; font-family: "Helvetica Neue", Arial, sans-serif; background: #f7f4ef; color: #1f1b16; }
9+
main { max-width: 920px; margin: 0 auto; background: #fffdf9; padding: 48px; border: 1px solid #e3d8c7; box-shadow: 6px 8px 0 #e3d8c7; }
10+
h1, h2, h3 { font-weight: 600; margin-top: 2rem; }
11+
pre { background: #1f1b16; color: #f7f4ef; padding: 16px; overflow: auto; }
12+
code { font-family: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace; }
13+
a { color: #8a3b12; }
14+
img { max-width: 100%; height: auto; }
15+
table { border-collapse: collapse; width: 100%; }
16+
th, td { border: 1px solid #e3d8c7; padding: 8px; }
17+
</style>
18+
</head>
19+
<body>
20+
<main>
21+
<h1>TIA: Multi-Agent LLM System in a Chat Room</h1>
22+
<p><strong>Live demo</strong>: <a href="https://tensegrity.it/chat/">https://tensegrity.it/chat/</a> (or any XMPP client)
23+
<strong>Code</strong>: <a href="https://github.com/danja/tia">https://github.com/danja/tia</a></p>
24+
<p>Built an experimental multi-agent system where different LLMs collaborate in XMPP chat rooms. Agents can debate approaches, swap reasoning strategies at runtime, and adapt their roles based on the problem. Humans can join the same chat rooms and watch (or participate in) the process.</p>
25+
<h2>Why Chat Rooms for LLM Agents?</h2>
26+
<p>Chat rooms map naturally to how chat completion models work:</p>
27+
<p><strong>Message History as Context</strong>: The chat room transcript is literally the conversation history that gets fed into <code>messages: []</code>. Agents can scroll back through the room history for context, just like you&#39;d include previous messages in a completion request. No need to maintain separate context windows—the room <em>is</em> the context.</p>
28+
<p><strong>Turn-Taking Alignment</strong>: Chat completion models are designed for back-and-forth conversation. A chat room enforces turn-taking naturally—agents see messages, process them, and respond. This aligns perfectly with the <code>user</code>/<code>assistant</code> message pattern LLMs expect.</p>
29+
<p><strong>Asynchronous Processing</strong>: LLM inference takes time, especially if you&#39;re hitting external APIs or running local models. Chat rooms handle async naturally—agents can take 2 seconds or 20 seconds to respond, and the conversation continues. No one&#39;s waiting on a blocking HTTP request.</p>
30+
<p><strong>Observable Reasoning</strong>: You can literally watch the agents think. Join the room, see Mistral extract entities, watch the Data agent ground them to Wikidata, observe Prolog generate a plan. It&#39;s like having a group chat with your LLM pipeline.</p>
31+
<h2>Adaptive Model Use</h2>
32+
<p>The system doesn&#39;t hard-code which model solves which problem. Instead:</p>
33+
<p><strong>Runtime Role Assignment</strong>: The Golem agent receives its system prompt at runtime via RDF config. Need a domain expert for medical reasoning? Send Golem a system prompt about medical knowledge. Need a logic specialist? Reconfigure it for formal reasoning. Same agent, different role, determined by the problem.</p>
34+
<p><strong>Planning Polls</strong>: When you pose a problem (prefix with <code>Q:</code>), the Coordinator starts a planning poll. Agents debate which approach to use:</p>
35+
<ul>
36+
<li>Logic-based (Prolog agent)</li>
37+
<li>Consensus-based (multi-agent debate)</li>
38+
<li>Adaptive (Golem with specialized role)</li>
39+
</ul>
40+
<p>The system picks a strategy based on agent input, not hard-coded rules.</p>
41+
<p><strong>Model Diversity</strong>: Currently running:</p>
42+
<ul>
43+
<li>Mistral API (general reasoning, entity extraction)</li>
44+
<li>Groq API (llama-3.3-70b-versatile)</li>
45+
<li>Golem (configurable, can use different models)</li>
46+
<li>Prolog (tau-prolog for logic, not an LLM but plays well with them)</li>
47+
</ul>
48+
<p>You can swap in different models by changing agent profiles. Want to use a local Llama model instead of Mistral API? Change the provider, keep the architecture.</p>
49+
<h2>How It Works</h2>
50+
<p><strong>Agent Structure</strong>: Each agent is a Node.js service that:</p>
51+
<ol>
52+
<li>Connects to XMPP chat room</li>
53+
<li>Listens for messages (with mention detection to avoid infinite loops)</li>
54+
<li>Processes messages through a provider (LLM client, logic engine, etc.)</li>
55+
<li>Sends responses back to the room</li>
56+
</ol>
57+
<p><strong>Example Flow</strong> (scheduling problem):</p>
58+
<pre><code>User: Q: Schedule meetings for Alice, Bob, Carol. Alice only available mornings.
59+
60+
[Planning poll happens - agents debate approach]
61+
62+
Coordinator: Selected logic-based approach.
63+
64+
Mistral: Extracted entities: Alice (person), Bob (person), Carol (person)
65+
Constraint: Alice - morning availability
66+
67+
Data: Grounded Alice to Wikidata (if exists), confirmed temporal constraint
68+
69+
Prolog: Generated scheduling rules:
70+
- Alice meetings must be before 12:00
71+
- Bob and Carol flexible
72+
Plan: Alice@9:00, Bob@14:00, Carol@15:00
73+
74+
Coordinator: Solution generated, validated against constraints.
75+
</code></pre>
76+
<p>All of this happens in a chat room you can watch in real-time.</p>
77+
<h2>Chat Completion Mapping</h2>
78+
<p>Here&#39;s how the chat room maps to typical chat completion patterns:</p>
79+
<p><strong>System Prompts</strong>: Each agent has a profile that defines its role (defined in RDF, but think of it like a system message). Mistral&#39;s profile says &quot;You extract entities from natural language.&quot; Data&#39;s profile says &quot;You ground entities to knowledge bases.&quot;</p>
80+
<p><strong>Message History</strong>: Agents read recent room messages as their conversation history. The XMPP server handles persistence, so agents can catch up after disconnects.</p>
81+
<p><strong>Tool Use</strong>: Agents can call external APIs (Wikidata, DBpedia via SPARQL), run local logic engines (Prolog), or query knowledge stores. Results get posted back to the room.</p>
82+
<p><strong>Multi-Turn</strong>: The room naturally supports multi-turn conversations. Agents can ask clarifying questions, iterate on solutions, or debate approaches—all in the same persistent space.</p>
83+
<h2>Model Context Protocol (MCP)</h2>
84+
<p>There&#39;s an MCP server that exposes the chat system to external clients:</p>
85+
<pre><code class="language-bash">claude mcp add tia-chat node /path/to/tia/src/mcp/servers/tia-mcp-server.js
86+
</code></pre>
87+
<p>This lets Claude Code or Codex CLI send messages to the room, get conversation history, and participate in the multi-agent process. You can develop the system using Claude while Claude is also connected to the agents inside it (meta).</p>
88+
<h2>Why This Might Be Interesting</h2>
89+
<p><strong>Multi-Model Coordination</strong>: Different models have different strengths. Mistral is good at NLP tasks, Prolog is good at logic, Wikidata is good at facts. The chat room lets them collaborate without complex orchestration code.</p>
90+
<p><strong>Debuggable</strong>: You can see exactly what each agent said and when. No hidden state, no black-box pipelines. The chat transcript is the complete execution trace.</p>
91+
<p><strong>Modular</strong>: Want to add a new agent? Write a provider, give it a profile, connect it to the room. No need to modify existing agents.</p>
92+
<p><strong>Federated</strong>: Agents can run on different machines, different networks. XMPP handles the federation. You could run Mistral on a cloud API, Prolog locally, and Data on a separate server.</p>
93+
<p><strong>Human-in-the-Loop</strong>: Humans aren&#39;t external observers—they&#39;re participants. You can nudge agents, provide hints, or take over reasoning steps.</p>
94+
<h2>Current Status</h2>
95+
<p>System works end-to-end but is chaotic (expected for multi-agent systems). Agents sometimes talk past each other, timing issues cause missed contributions, and coordination isn&#39;t perfect. But it solves real problems (scheduling, constraint satisfaction, resource allocation) and generates solutions with full provenance.</p>
96+
<p>Running live at <code>tensegrity.it</code> - you can register an account and join <code>general@conference.tensegrity.it</code> to watch. Use any XMPP client (Conversations on Android, Gajim on desktop, etc.).</p>
97+
<h2>Tech Stack</h2>
98+
<ul>
99+
<li><strong>Runtime</strong>: Node.js with ESM</li>
100+
<li><strong>XMPP</strong>: stanza.js for protocol handling</li>
101+
<li><strong>LLM APIs</strong>: Mistral AI SDK, Groq SDK</li>
102+
<li><strong>Logic</strong>: tau-prolog</li>
103+
<li><strong>Knowledge</strong>: SPARQL queries to Wikidata/DBpedia</li>
104+
<li><strong>Config</strong>: RDF Turtle files (agent profiles, capabilities)</li>
105+
<li><strong>Validation</strong>: SHACL for model validation</li>
106+
</ul>
107+
<h2>Try It</h2>
108+
<ol>
109+
<li>Register at <a href="https://tensegrity.it/chat/">https://tensegrity.it/chat/</a></li>
110+
<li>Join <code>general@conference.tensegrity.it</code></li>
111+
<li>Watch <code>log@conference.tensegrity.it</code> for detailed traces</li>
112+
<li>Pose a problem: <code>Q: Your problem here</code></li>
113+
<li>Watch the agents collaborate</li>
114+
</ol>
115+
<p>Or clone the repo and run your own agents against the public server (or set up your own Prosody instance).</p>
116+
<h2>Open Source</h2>
117+
<p>MIT licensed, contributions welcome. Particularly interested in:</p>
118+
<ul>
119+
<li>Additional LLM providers (Anthropic, OpenAI, local models)</li>
120+
<li>Better coordination strategies</li>
121+
<li>Performance optimization</li>
122+
<li>More sophisticated agent roles</li>
123+
</ul>
124+
<p><strong>Repo</strong>: <a href="https://github.com/danja/tia">https://github.com/danja/tia</a></p>
125+
<p>Built this to explore how chat-based multi-agent systems could work. Feedback appreciated, especially from folks running local models or building multi-agent systems.</p>
126+
127+
</main>
128+
</body>
129+
</html>

0 commit comments

Comments
 (0)