← All Projects
AI / ML ★ Featured

Multi-Agent Stance
Detection Framework

An agentic AI pipeline that classifies political stance using tool-augmented multi-agent architectures with collaborative reasoning loops — going beyond single-model inference.

🤖
Add project screenshot or architecture diagram here

01 Overview

Political stance detection — classifying whether a text leans for, against, or is neutral toward a given topic — is a fundamentally ambiguous task. Single-model classifiers struggle with nuance, irony, and domain-specific context that requires cross-referencing multiple knowledge sources.

This project builds a multi-agent framework where specialised agents collaborate to reach a stance classification. One agent retrieves contextual evidence, another performs logical reasoning, and a final arbiter synthesises the conclusion — mimicking how a human analyst might cross-check sources before forming a verdict.

02 Technical Architecture

The system is built around three specialised agents operating in an orchestrated pipeline:

# Multi-Agent Stance Detection Pipeline INPUT: Article text + Target topic │ ▼ [Agent 1: Retriever] │ Tool: Web search + knowledge base lookup │ Output: Relevant context passages ▼ [Agent 2: Reasoner] │ Tool: Chain-of-thought reasoning engine │ Input: Article + retrieved context │ Output: Structured reasoning trace ▼ [Agent 3: Arbiter] │ Tool: Confidence scoring + fallback logic │ Input: Reasoning trace + evidence │ Output: Final stance label + confidence OUTPUT: { label: "FAVOR|AGAINST|NONE", confidence: 0.87 }

Each agent is backed by a fine-tuned language model with access to specific tools — the retriever uses a vector store and search API, the reasoner implements structured chain-of-thought prompting, and the arbiter applies a learned confidence calibration layer.

03 Key Challenges

Agent coordination overhead: Multi-agent pipelines introduce latency. Optimised by running retrieval in parallel with initial reasoning and caching frequent context patterns.

Conflicting agent outputs: Agents sometimes reached contradictory stances. Resolved using an explicit disagreement protocol where the arbiter requests additional evidence before committing to a label.

Domain shift: Political language varies drastically by region, platform, and time period. Applied domain-adaptive fine-tuning with data augmentation to improve cross-domain generalisation.

04 Results

87% F1 Score
+12% vs Single Model
3 Specialised Agents

The multi-agent approach outperformed a single fine-tuned transformer baseline by 12 percentage points on F1, with the most significant gains on ambiguous and ironic texts where contextual reasoning is critical.

05 Tech Stack

Python 3.11 PyTorch Hugging Face Transformers LangChain FAISS (Vector Store) OpenAI API SemEval Dataset Pandas / NumPy scikit-learn Jupyter