This project implements a multi-agent debate system where three distinct personas — Commander, Rationalist, and Dramatist — engage in structured debates to collaboratively reason about complex queries. Their discussion concludes with a Synthesizer Agent, which merges all viewpoints into a single, unified insight.
The goal is to simulate realistic collaborative reasoning between agents with different cognitive biases and conversational styles. Each agent retrieves evidence from its persona-specific knowledge base, debates in multiple rounds, and contributes to the final synthesis.
The system is built using:
- LangGraph — for orchestration
- FAISS — for retrieval
- Sentence-Transformers (SBERT) — for embeddings
- Streamlit — for user interaction
The three personas were designed from patterns discovered in movie dialogues using data-driven persona discovery.
- Dataset: Cornell Movie-Dialogs Corpus
- Contains extracted dialogues from films
- Each line includes the character, movie, and dialogue text
-
Preprocessing
- Lowercasing, punctuation removal, token filtering
- Removed non-dialogue noise and duplicates
- Filtered sentences between 5 and 220 characters
-
Topic Modeling & Clustering
- Used SentenceTransformer (all-MiniLM-L6-v2) embeddings
- Clustered utterances by semantic similarity
- Manually labeled clusters based on tone and reasoning patterns
-
Final Personas
| Persona | Description | Traits |
|---|---|---|
| 🧭 Commander | Tactical and action-oriented | Decisive, structured, direct |
| 🧠 Rationalist | Analytical, logic-based thinker | Data-driven, hypothesis-testing |
| 🎭 Dramatist | Emotionally expressive | Reflective, metaphorical, humanistic |
- Synthesizer Agent
- Combines all three perspectives
- Produces a balanced, human-readable unified insight
To regenerate persona clusters and persona_analysis.json:
python src/persona_discovery.pyThe system uses LangGraph to model agent interactions as a state machine of connected nodes.
| Phase | Description | Node Function |
|---|---|---|
| Init | Initializes agents, state, and dialogue | init_state_node |
| Round 1 | Each persona gives their independent viewpoint | round1_node |
| Dialogue | Agents converse & reference each other | dialogue_node |
| Challenge | Cross-critiques and rebuttals | challenges_node |
| Synthesis | Unified summary of insights | synthesis_node |
The router function manages transitions between phases based on conversation state.
GraphState tracks queries, dialogue history, and agent responses.
We intentionally do not commit large artifacts. Rebuild locally:
- Place a dialog dataset under
data/raw/movie_data/(e.g., Cornell Movie-Dialogs Corpus). - Preprocess & discover personas:
PYTHONPATH=. python src/preprocessing.py PYTHONPATH=. python src/persona_discovery.py
- Build persona indices:
PYTHONPATH=. python src/build_indices.py
This generates:
data/processed/personas/<agent>/
├─ <agent>.meta.jsonl
└─ <agent>.faiss
git clone https://github.com/eashita11/vectorial-multiagent.git
cd vectorial-multiagentpython -m venv .venv
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windowspip install -r requirements.txtStart the Ollama Llama3 server locally:
brew install ollama # macOS
ollama serve
ollama pull llama3Then launch Streamlit:
streamlit run app.pyAll test files are located in /tests/.
Quick subset:
PYTHONPATH=. pytest -q -k "retriever or citations"Full suite (can be slow on CPU):
PYTHONPATH=. pytest -q --maxfail=1Note: FAISS and model initialization can slow tests down.
Processed dataset files are large, so they are not included in the repository.
To recreate them:
python src/preprocessing.py
python src/persona_discovery.pyYou may alternatively use an open-source dataset such as the Cornell Movie Dialogs Corpus.
- Launch the Streamlit app.
- Ask any question (e.g., “How can I rebuild trust in a failing team?”).
- Observe:
- Round 1: Individual viewpoints
- Dialogue: Agents build on each other
- Challenges: Cross-critiques
- Synthesis: Unified insight
- “We missed our Q3 retention target; CS says it’s product bugs, PM says onboarding. What should we do this sprint to stabilize churn?”
- “Marketing wants to launch in 4 weeks; infra warns cost blow-up at 3× traffic. How do we decide, and what’s the minimum we ship safely?”
Each agent uses a retriever backed by FAISS and SBERT embeddings:
- Each persona retrieves snippets aligned with its reasoning style.
- Citations appear in the UI (e.g.,
🔗 HAIG · line L421488 · movie m150). - The Synthesizer Agent only reuses citations provided by personas — it never invents new ones.
A Streamlit app (app.py) provides a chat-based interface:
- Type your question into the input box.
- Watch color-coded persona responses:
- 🧭 Commander → Blue border
- 🧠 Rationalist → Green border
- 🎭 Dramatist → Purple border
- 🧩 Synthesis → Teal border
- Smooth typing animation simulates a live debate.
├── app.py
├── data/
│ ├── raw/
│ └── processed/
│ ├── persona_analysis.json
│ └── personas/
├── requirements.txt
├── src/
│ ├── agents/
│ ├── graph/
│ ├── preprocessing.py
│ ├── persona_discovery.py
│ ├── retriever.py
│ ├── orchestrator.py
│ └── llm.py
└── tests/
| Area | Current Limitation | Future Improvement |
|---|---|---|
| Dialogue Depth | Some agents dominate or repeat | Add memory balancing & attention control |
| Persona Contrast | Commander and Rationalist occasionally overlap | Refine prompts for stronger stylistic contrast |
| Speed | Local LLM inference is slow | Enable async calls or caching |
| Retrieval | Static FAISS indices | Add dynamic persona-specific retraining |
Below is a glimpse of the Multi-Agent Debate in action:
| Stage | Screenshot |
|---|---|
| 🗣️ Round 1 — Individual Perspectives | ![]() |
| 💬 Dialogue — Agents Build on Each Other | ![]() |
| ⚖️ Challenge Round — Rebuttals | ![]() |
| 🧩 Consensus Summary — Unified Insight | ![]() |
Developed by Eashita Dhillon




