A framework for parallel, isolated multi-agent reasoning.
Project description
Octochains
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."
Scientifically Validated Performance
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) |
Why Octochains?
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 Anathomy
Quickstart
Octochains is designed to be developer-first and model-agnostic.
1. Install
pip install octochains
2. Define an Agent
from 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}"
3. Define an Aggregator
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."
4. Run the Parallel Engine
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}")
Architecture & Strategy
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.
Repository Structure
/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.).
Future Roadmap
We are expanding Octochains from a library into a comprehensive ecosystem for high-stakes reasoning:
- Community-driven marketplace for pre-tuned specialists Agents.
License
Octochains is Fair-code, distributed under the Business Source License 1.1.
- Individuals & Internal Use: Free to use for personal projects, research, and internal business workflows.
- Commercial Providers: You cannot offer Octochains as a managed SaaS or sell a commercial wrapper of the engine without a license.
- The Guarantee: On May 10, 2030, this version automatically becomes Apache 2.0 (Open Source).
To access the Enterprise Reasoning Features, contact: ahmad.vh7@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file octochains-0.1.1.tar.gz.
File metadata
- Download URL: octochains-0.1.1.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4e93e7028a039f264d8a049fdbf28f4252e3e177b7a4ff7bff66fa61459cc67
|
|
| MD5 |
1659f7439725f48c8e18f5e3db4e9b00
|
|
| BLAKE2b-256 |
76cb638c7b893f57113fb5d394d9b72ba823cbfd534c861f0668f425f639c0c0
|
File details
Details for the file octochains-0.1.1-py3-none-any.whl.
File metadata
- Download URL: octochains-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2035b34dd7087b2d59d272ee6362834b1b900a4afe59ccbd3dbed16479f6a28
|
|
| MD5 |
2e6e2c78f7fbff33368072f36399619d
|
|
| BLAKE2b-256 |
ea01c502d9000c7787d8065cfb375552dd887523500344246dd4929da1386bc9
|