DEV Community

ammorick
ammorick

Posted on

From a Sketch to a Working Multi‑Brain Dialogue Module — Design, Iteration, and Lessons Learned

  1. Background

I've been building a multi‑expert AI Q&A system. The core logic is straightforward: when a user asks a question, the system calls multiple domain experts (medical, legal, strategy, etc.) in parallel, collects their responses, and synthesizes a final answer.

But there's a longer‑term direction I've been thinking about: if a large number of expert brains engage in random dialogue, it might generate knowledge beyond what we currently know. That's what I decided to think through today.

I drew a sketch to capture the idea at that moment.

  1. Module Design

I called it the "random brain" module.

The core flow works like this:

Select participants: Randomly pick 2–3 experts from a roster. Either fully random, or user‑specified.

Generate entry point: The system auto‑generates an open topic — no user input needed.

Multi‑round dialogue: Experts discuss the topic across multiple rounds. Each round, they can see the full conversation history.

Separate storage: Discussion records are saved independently, not mixed with normal user conversation history.

Mode switching is handled via command line:

/random — pure random selection

/random medical strategy — specify a particular combination

/normal — switch back to normal dialogue mode

This module doesn't depend on user input — it runs as a system‑initiated behavior, outside of the user's view.

  1. Testing and Iteration

Getting this right took three distinct iterations.

First test: each expert just listed their own directions

Two experts were randomly selected and asked to speak on an open topic.

The output was stable — but nothing unexpected. Both experts basically listed five directions from their own fields. The medical expert listed medical cross‑domain ideas; the strategy expert listed strategic ones. No interaction, no response to each other's points.

First revision: added context summaries

In later rounds, each expert received a summary of what other experts had said in previous rounds.

This improved things slightly, but not enough. Occasionally there were light references — "thanks for the previous expert's perspective" — but overall it still felt like parallel monologues.

Second revision: layered prompts

First round stayed open. From the second round onward, experts were explicitly asked to respond to other experts' points.

This finally produced what I was looking for. The two experts started referencing each other's ideas and building on them.

One expert picked up a direction from the other and added a concrete concept. The other took the first expert's idea and expanded it with more detailed proposals.

Instead of each producing a separate list, they actually formed a structured discussion. This was the first time I saw "dialogue" rather than "parallel output" from this module.

  1. Current Status

The core mechanism works, but there's still a long way to go before it's stable enough to ship.

What works:

Multi‑round dialogue framework

Random or specified expert combinations

Separate storage for discussion records

Command‑line mode switching

Known limitations:

Prompts are still hard‑coded — needs to be externalized for future expansion

Valuable content from round 2 can sometimes get diluted or overwritten in round 3 — a risk of reverse optimization

Response time is slow — waiting for all API calls across multiple rounds creates noticeable latency

Safety monitoring isn't wired in yet — random discussions don't pass through the safety filter

Output quality varies across different expert combinations — consistency still needs work

The thread pool is created per call — works fine for 2‑3 experts, but needs refactoring for scaling

Discussion records are saved with timestamps but not indexed — retrieval will become harder over time

All of these are fixable. They don't invalidate the core functionality — they just mean there's more work ahead.

  1. Some Thoughts

The value of this module isn't in solving a specific problem — it's in exploring possibilities that aren't already in the expected range. When the system doesn't rely on user input and doesn't have a fixed direction, it can generate intersections you wouldn't have thought of yourself.

This direction is still early. The next challenge is stability and consistency. If I can get that right, potential use cases include cross‑industry exploration, inspiration for academic research, or a component in a larger exploratory system.

  1. Technical Details

Layered prompt design: round 1 stays open; round 2 and later include summaries of other experts' points as context

Each round calls expert APIs concurrently using ThreadPoolExecutor

Discussion records are saved as JSON with full conversation history

File naming pattern: random_discussion_{timestamp}_{expert_combo}.json

Mode switching is handled via command line

Repo: https://github.com/ammorick/ai-learning-journey

The public repository currently keeps the design sketch and module structure visible, but the full implementation is private for now.

  1. Open Question

If you've worked on multi‑agent collaboration or exploratory modules, what challenges did you run into with stability and consistency? How did you handle them?

Feel free to share your experiences — I'd love to hear how others are approaching similar problems.

Postscript

This article is a record of the development process for the random brain module. It's still an experimental feature — not a finished product, not a productized feature. If you're working on something similar, I'd be curious to hear about your approach.

Top comments (1)

Collapse
 
ammorick profile image
ammorick

I tried everything — local upload, Imgur links, different formats, even incognito mode. The images just won't show up in the published post. They work in the editor preview, but as soon as I hit publish, they disappear.

If anyone else has run into this and figured out a fix, I'm all ears. For now, you'll have to imagine the sketch and the terminal output — they're real, I promise 😅

Help? 🙏