Octochains is a lightweight, zero-dependency Python framework for Collaborative AI Reasoning.It is purpose-built for Decomposable Tasks, complex problems that require independent, multi-perspective analysis.
By shifting from monolithic responses to Parallel Isolated Reasoning, Octochains ensures that every angle of a decision, from clinical diagnostics to financial risk, is evaluated in threaded isolation, preventing logical contamination and "Expert Blindspots."
Octochains is built on the architectural principles validated in the 2026 study "Towards a Science of Scaling Agent Systems" (Google Research / MIT).
Research confirms that for analytical, decomposable tasks, a Parallel Isolated architecture (the core of Octochains) delivers a massive performance delta over standard sequential or single-agent models:
| Benchmark | Task Domain | Performance Gain vs. Single-Agent |
|---|---|---|
| Finance-Agent (FAB) | Decomposable Financial Reasoning | +80.8% 🚀 |
| Workbench | Structured Business Planning | +57.2% |
| PlanCraft | Sequential Automation | (Use Single-Agent Instead) |
Standard AI chains suffer from "Cognitive Tunnel Vision", where a model commits to a logical path too early. Octochains eliminates this via:
- Parallel Isolation: Expert nodes operate in private threads with zero awareness of peers, preventing "logical contamination."
- Centralized Verification: A specialized "Chief Justice" aggregator synthesizes reports, identifying conflicts and evidence gaps before delivering a verdict.
- Audit-First Design: Every decision generates a 100% traceable log of expert rationale, meeting EU AI Act requirements for monitorable AI.
Octochains is designed to be developer-first and model-agnostic.
pip install octochainsfrom octochains import Agent, tool
class Specialist(Agent):
def __init__(self):
super().__init__(
role="Legal Expert",
goal="Identify liability risks"
)
@tool
def check_compliance(self, text: str):
"""
Analyzes text for regulatory non-compliance.
"""
# Framework automatically generates JSON schema for this tool
return "Compliant"
def execute(self, data: str) -> str:
# Use any LLM here (OpenAI, Gemini, Ollama, etc.)
# The 'data' passed here is the full complex problem.
return f"Legal Analysis: {data}"from octochains import Aggregator
class ChiefConsensusOfficer(Aggregator):
def __init__(self):
super().__init__(
role="Chief Aggregator",
goal="Synthesize expert opinions into a final verdict"
)
def execute(self, agent_reports: dict[str, str]) -> str:
"""
Receives the a dictionary of reports.
Key: Agent Role, Value: Agent output string.
"""
# Here you can call a high-reasoning LLM to compare the reports
# or implement custom logic to resolve conflicts.
verdict = "APPROVED"
for role, report in agent_reports.items():
if "RISK" in report.upper():
verdict = "REJECTED"
return f"Final Decision: {verdict} based on {len(agent_reports)} expert inputs."from octochains import Engine
# Initialize your experts and the aggregator
engine = Engine(
agents=[legal_expert, finance_expert, tech_expert],
aggregator=ChiefConsensusOfficer()
)
# Broadcast the complex problem to all agents at once
report = engine.run("Full Project Alpha Investment Case File...")
print(f"Consensus: {report.consensus}")
print(f"Audit Trail: {report.traces}")Octochains is designed for high-stakes environments where "vibe-based" AI isn't enough. It excels in Medical Diagnostics, Legal Audits, and Strategic Business and Financial Analysis.
/src/octochains/engine.py: The high-performance parallel execution engine./src/octochains/agents/: A growing library of specialized experts (Finance, Legal, Medical and etc.)./src/octochains/aggregators/: Standardized synthesis logic (Majority Vote, Weighted Consensus, etc.).
We are expanding Octochains from a library into a comprehensive ecosystem for high-stakes reasoning:
- Community-driven marketplace for pre-tuned specialists Agents.

