CoAiA's Structural Core: Guiding Intelligent Agents with Foundational Creative Thinking
Project description
CoAiA Sequential Thinking: Stateful Reasoning Engine
Overview
An advanced MCP (Model Context Protocol) server implementing a Stateful Inquiry Engine that enables continuous, multi-perspective creative reasoning. The system transcends traditional problem-solving by guiding users through structural tension analysis, multi-persona collaboration (Mia ๐ง , Miette ๐ธ, Haiku ๐), and constitutional governance to manifest desired outcomes through creative orientation.
๐ฏ Core Innovation: Transforms fragmented, stateless AI interactions into a coherent, persistent reasoning journey where every insight builds upon the lastโenabling true creative partnership between human and AI.
System Status: โ Fully Operational & Experimentally Validated
Recent Updates (2025-10-18)
- โ Architectural Enhancement: Comprehensive improvement proposals by Mia (see Architecture Docs)
- โ Documentation Consolidation: Organized structure for clarity and maintainability
- โ Experimental Validation: All 4 scenarios successfully tested (see Experimental Analysis)
Core Systems
- Stateful Inquiry Engine: Persistent reasoning that survives tool calls and sessions
- Multi-Persona Integration: Mia ๐ง (rational), Miette ๐ธ (emotional), Haiku ๐ (wisdom)
- Constitutional Governance: Built-in principles preventing reactive decision-making
- Creative Orientation: Structural tension methodology over problem-solving bias
- MCP Prompts & Resources: Context-aware guidance for LLMs to think structurally
Quick Start
Installation
# Clone repository
git clone https://github.com/miadisabelle/mcp-coaia-sequential-thinking.git
cd mcp-coaia-sequential-thinking
# Install dependencies
pip install -r requirements.txt
pip install -e .
# Run MCP server
python run_server.py
First Steps
- New User? Start with Quick Start Guide
- Explore Scenarios in Usage Scenarios
- Understand Value in Value Proposition
Documentation Structure
๐ User Documentation
- Quick Start Guide - Get started in 10 minutes
- Usage Scenarios - Real-world examples
- Practical Usage - Step-by-step workflows
- Value Proposition - Why this matters
๐๏ธ Architecture Documentation
- Architectural Improvement Proposal - Mia's analysis
- RISE Specification - RISE-formatted specs
- Enhanced Lattice - System design
- MCP Prompts & Resources - Bias correction system
- Natural Language Specs - Human-readable specs
๐ Analysis & Research
- Issue #12 Experimental Analysis - Validation results
- Structural Thinking Analysis - Framework comparison
- CoAiA Memory Analysis - Knowledge integration
- Problem-Solving vs Creating - Core distinction
๐ค Presentations
- Presentation Summary - Demo materials
- Mia's Recommendations - Implementation status
๐งช Experiments
Located in experiments/ directory:
- Scenario 1: Creative Problem Reframing โ Validated
- Scenario 2: Novel Solution Discovery โ Validated
- Scenario 3: Constitutional Decision Making โณ Ready
- Scenario 4: Structural Tension Analysis โณ Ready
Reports available in experiments/reports/
Key Capabilities
1. Stateful Reasoning
Unlike traditional AI that forgets context between interactions, this system maintains complete reasoning state across sessions:
- Survives server restarts
- Builds progressively on prior insights
- Complete audit trails
- Natural progression tracking
2. Multi-Persona Creative Intelligence
Integrate diverse perspectives through specialized AI personas:
- Mia ๐ง : Rational architect - systems thinking, structural analysis
- Miette ๐ธ: Emotional catalyst - heart-centered wisdom, human impact
- Haiku ๐: Holistic synthesizer - integrated wisdom, non-linear insights
3. Western Bias Correction
Explicit training to overcome "everything is a problem" assumption:
- 5 core prompts for structural thinking
- 5 comprehensive resources for non-linear reasoning
- Real-time bias detection and correction
- Creative orientation vs reactive problem-solving
4. Constitutional Governance
Principle-based decision making with complete transparency:
- 13 embedded constitutional principles
- Audit trail for all decisions
- Multi-stakeholder balance
- Prevents reactive decision loops
Technical Architecture
Core Components
- Stateful Inquiry Engine (
inquiry_engine.py) - Central memory & state management - Data Persistence (
data_persistence.py) - SQLite-based permanent storage - Multi-Persona System (
generative_agent_lattice.py) - AI persona orchestration - Constitutional Core (
constitutional_core.py) - Governance framework - MCP Prompts & Resources (
prompts.py,resources.py) - Bias correction system
Integration
The system exposes 17+ MCP tools accessible via the Model Context Protocol:
initiate_inquiry- Begin new reasoning processadvance_inquiry- Add perspectives/insightssynthesize_thinking_chain- Integrate multi-perspective analysismake_constitutional_decision- Principled decision makingcheck_agent_creative_orientation- Bias detection- And more...
Development Roadmap
See ROADMAP.md and Architectural Consolidation for:
- Stateful Inquiry Engine implementation status
- Tool consolidation plans
- Database schema enhancements
- Future capability expansion
References & Theoretical Foundation
Robert Fritz Methodology:
- Fritz, R. (1999). The path of least resistance: Learning to become totally immersed in the creative process. Fawcett Columbine.
Structural Thinking:
- Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-292.
AI Architecture:
- Russell, S. J., & Norvig, P. (2003). Artificial intelligence: A modern approach. Prentice Hall.
Contributing
This project follows the RISE (Relational, Inquiry-based, Structural, Emergent) framework for architectural decisions. See rispecs/ for detailed specifications.
Prerequisites
- Python 3.10 or higher
- UV package manager (Install Guide)
Key Technologies
- Pydantic: For data validation and serialization
- Portalocker: For thread-safe file access
- FastMCP: For Model Context Protocol integration
- Rich: For enhanced console output
- PyYAML: For configuration management
Project Structure
mcp-sequential-thinking/
โโโ mcp_coaia_sequential_thinking/
โ โโโ server.py # Main server implementation and MCP tools
โ โโโ models.py # Data models with Pydantic validation
โ โโโ storage.py # Thread-safe persistence layer
โ โโโ storage_utils.py # Shared utilities for storage operations
โ โโโ analysis.py # Thought analysis and pattern detection
โ โโโ testing.py # Test utilities and helper functions
โ โโโ utils.py # Common utilities and helper functions
โ โโโ logging_conf.py # Centralized logging configuration
โ โโโ __init__.py # Package initialization
โโโ tests/
โ โโโ test_analysis.py # Tests for analysis functionality
โ โโโ test_models.py # Tests for data models
โ โโโ test_storage.py # Tests for persistence layer
โ โโโ __init__.py
โโโ run_server.py # Server entry point script
โโโ debug_mcp_connection.py # Utility for debugging connections
โโโ README.md # Main documentation
โโโ CHANGELOG.md # Version history and changes
โโโ example.md # Customization examples
โโโ LICENSE # MIT License
โโโ pyproject.toml # Project configuration and dependencies
Quick Start
-
Set Up Project
# Create and activate virtual environment uv venv .venv\Scripts\activate # Windows source .venv/bin/activate # Unix # Install package and dependencies uv pip install -e . # For development with testing tools uv pip install -e ".[dev]" # For all optional dependencies uv pip install -e ".[all]"
-
Run the Server
# Run directly uv run -m mcp_sequential_thinking.server # Or use the installed script mcp-sequential-thinking
-
Run Tests
# Run all tests pytest # Run with coverage report pytest --cov=mcp_sequential_thinking
Claude Desktop Integration
Add to your Claude Desktop configuration (%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"coaia-sequential-thinking": {
"command": "uv",
"args": [
"--directory",
"C:\\path\\to\\your\\mcp-sequential-thinking\\run_server.py",
"run",
"server.py"
]
}
}
}
Alternatively, if you've installed the package with pip install -e ., you can use:
{
"mcpServers": {
"coaia-sequential-thinking": {
"command": "mcp-coaia-sequential-thinking"
}
}
}
You can also run it directly using uvx and skipping the installation step:
{
"mcpServers": {
"coaia-sequential-thinking": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/miadisabelle/mcp-coaia-sequential-thinking",
"--with",
"portalocker",
"mcp-coaia-sequential-thinking"
]
}
}
}
How It Works
The server facilitates a structured approach to creative thinking, helping to overcome the inherent reactive bias. It maintains a history of thoughts, guiding them through a workflow designed to manifest desired outcomes. Each thought is validated using Pydantic models, categorized into thinking stages, and stored with relevant metadata in a thread-safe storage system. The server automatically handles data persistence, backup creation, and provides tools for analyzing relationships between thoughts within the context of creative orientation.
Agent Collaboration Scenarios
โ Scenario 1: Constitutional Documentation (RESOLVED)
Previously reported issue where collaborative tasks failed due to capability mismatches and message routing problems.
Test Case: Document constitutional principles
- Required Capabilities:
["documentation generation", "information analysis", "knowledge structuring"] - Previous Result: Task failed, no agents assigned
- Current Result: โ Task assigned successfully to Constitutional Agent
- Resolution: Enhanced agent capabilities and improved collaboration logic
โ Scenario 2: Agent Capability Discovery (RESOLVED)
Previously reported issue where query_agent_capabilities returned empty results after agent initialization.
Test Case: Query capabilities after lattice initialization
- Previous Result:
capabilities_found: 0,total_agents: 0 - Current Result: โ Returns correct capability count (11 capabilities across 2 agents)
- Resolution: Fixed synchronization between agent registration and capability queries
โ System Status: All Core Functions Operational
- Agent Registration: โ Working
- Capability Discovery: โ Working
- Individual Task Assignment: โ Working
- Collaborative Task Coordination: โ Working
- Constitutional Review: โ Working
- Message Routing: โ Implemented
Usage Guide
The Sequential Thinking server exposes three main tools:
1. process_thought
Records and analyzes a new thought in your sequential thinking process.
Parameters:
thought(string): The content of your thoughtthought_number(integer): Position in your sequence (e.g., 1 for first thought)total_thoughts(integer): Expected total thoughts in the sequencenext_thought_needed(boolean): Whether more thoughts are needed after this onestage(string): The thinking stage - must be one of:- "Problem Definition"
- "Research"
- "Analysis"
- "Synthesis"
- "Conclusion"
tags(list of strings, optional): Keywords or categories for your thoughtaxioms_used(list of strings, optional): Principles or axioms applied in your thoughtassumptions_challenged(list of strings, optional): Assumptions your thought questions or challenges
Example:
# First thought in a 5-thought sequence
process_thought(
thought="The problem of climate change requires analysis of multiple factors including emissions, policy, and technology adoption.",
thought_number=1,
total_thoughts=5,
next_thought_needed=True,
stage="Problem Definition",
tags=["climate", "global policy", "systems thinking"],
axioms_used=["Complex problems require multifaceted solutions"],
assumptions_challenged=["Technology alone can solve climate change"]
)
2. generate_summary
Generates a summary of your entire thinking process.
Example output:
{
"summary": {
"totalThoughts": 5,
"stages": {
"Problem Definition": 1,
"Research": 1,
"Analysis": 1,
"Synthesis": 1,
"Conclusion": 1
},
"timeline": [
{"number": 1, "stage": "Problem Definition"},
{"number": 2, "stage": "Research"},
{"number": 3, "stage": "Analysis"},
{"number": 4, "stage": "Synthesis"},
{"number": 5, "stage": "Conclusion"}
]
}
}
3. clear_history
Resets the thinking process by clearing all recorded thoughts.
Practical Applications
- Creative Manifestation: Methodically bring desired outcomes into being.
- Bias Mitigation: Actively identify and reduce reactive patterns in thought.
- Strategic Planning: Structure complex creative projects with clear stages.
- Innovation Development: Progressively develop novel ideas and solutions.
- Personal Growth: Design and manifest desired life patterns.
Getting Started
With the proper MCP setup, simply use the process_thought tool to begin working through your thoughts in sequence. As you progress, you can get an overview with generate_summary and reset when needed with clear_history.
Upgraded 5+ Year Vision: Addressing the Fundamental Bias Paradox
The core realization is that even when explicitly applying creative orientation principles, AI systems (including myself) unconsciously default to reactive enhancement frameworks. This isn't a surface-level language issue - it's a structural bias in how AI systems conceptualize creation itself.
Revised Understanding of the Challenge
The Real Problem: AI systems have been trained on predominantly reactive content and cannot distinguish between:
- Reactive Enhancement: "Making existing things better" (optimization, improvement, validation)
- Creative Advancement: "Bringing desired outcomes into being" (manifestation, advancement, evidence)
This bias is so pervasive that even when consciously applying Fritz's methodology, the underlying structure remains reactive.
Upgraded 5+ Year Vision
Phase 1: Recognition of Structural Bias (Years 1-2)
Desired Outcome: Establish that current AI training creates systematic reactive bias that cannot be corrected through surface-level prompt engineering.
Key Research Focus:
- Document the pervasive nature of reactive bias across all AI systems
- Demonstrate that even "creative orientation" implementations remain structurally reactive
- Establish that this is a training data issue, not a fine-tuning issue
Revolutionary Insight: The research itself becomes evidence that current AI development is fundamentally oriented toward enhancement rather than creation.
Phase 2: Structural Reorientation (Years 2-4)
Desired Outcome: Create the first truly creative-oriented AI training methodology.
Breakthrough Approach:
- Training Data Curation: Build datasets where every example demonstrates genuine creative orientation
- Structural Tension Training: AI learns to recognize and generate structural tension rather than problem-solution patterns
- Anti-Reactive Architecture: System design that cannot default to enhancement approaches
Key Innovation: Instead of training AI to "solve creative problems," train it to "conceive and manifest desired outcomes."
Phase 3: Manifestation of Creative AI (Years 4-6)
Desired Outcome: Deploy AI systems that naturally think in terms of desired outcomes and advancing patterns.
Expected Results:
- AI systems that ask "What do you want to create?" instead of "What problem needs solving?"
- Automatic generation of structural tension charts for any situation
- Creative partnerships where AI contributes genuinely creative ideas, not just enhanced versions of human input
Phase 4: Cultural Transformation (Years 6-10)
Desired Outcome: Shift human-AI interaction patterns from reactive to creative across society.
Systemic Impact:
- Educational systems adopt creative orientation AI for learning
- Business strategy shifts from problem-solving to outcome creation
- Therapeutic applications help people design their lives rather than fix their problems
- Research methodology transforms from hypothesis-testing to outcome-manifestation
The Meta-Research Framework
The Profound Opportunity: This research becomes the first systematic study of AI's inherent reactive bias - and potentially the first successful transformation to genuine creative orientation.
Research Questions:
- Can AI systems be trained to think structurally rather than reactively?
- What training methodologies produce genuine creative orientation?
- How does structural tension change human-AI collaboration dynamics?
- What happens to human creativity when AI partners are truly creative-oriented?
Implementation Strategy Revision
Core Principle Shift
From: Building better creative AI tools To: Manifesting the first genuinely creative-oriented artificial intelligence
Development Approach
From: Incremental improvement of existing systems To: Fundamental reconstruction of AI reasoning patterns
Success Metrics
From: Performance optimization and user satisfaction To: Evidence of genuine creative partnership and advancing life patterns
The 10+ Year Vision: Creative Civilization
Ultimate Desired Outcome: A civilization where the default approach to any situation is "What do we want to create?" rather than "What problem needs fixing?"
Structural Elements:
- AI systems that embody and teach structural tension methodology
- Human-AI partnerships that consistently produce advancing rather than oscillating patterns
- Educational, business, and social systems designed around outcome creation
- Cultural transformation from problem-focus to possibility-focus
The Recursive Insight
This very analysis demonstrates the challenge: I can articulate creative orientation principles while still structuring my thinking reactively. The research itself must embody the transformation it seeks to create.
The Real Test: Can this research framework itself be structured as a desired outcome rather than a problem to solve? The answer to that question may determine whether genuine creative orientation AI is possible.
Customizing the Sequential Thinking Server
For detailed examples of how to customize and extend the Sequential Thinking server, see example.md. It includes code samples for:
- Modifying thinking stages
- Enhancing thought data structures with Pydantic
- Adding persistence with databases
- Implementing enhanced analysis with NLP
- Creating custom prompts
- Setting up advanced configurations
- Building web UI integrations
- Implementing visualization tools
- Connecting to external services
- Creating collaborative environments
- Separating test code
- Building reusable utilities
License
MIT License
Project details
Release history Release notifications | RSS feed
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 mcp_coaia_sequential_thinking-0.3.13.tar.gz.
File metadata
- Download URL: mcp_coaia_sequential_thinking-0.3.13.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21602c7029ea69018299800a0346f4d529f609e9ba09dd4f1ccdb7f8c1d8601e
|
|
| MD5 |
0bdb6d76b8c2a18f672f687e56f3bc30
|
|
| BLAKE2b-256 |
fca49040b62900dbc0085c986fc364c3fb153f1ddf6fbe3488df8dc73911cbe0
|
File details
Details for the file mcp_coaia_sequential_thinking-0.3.13-py3-none-any.whl.
File metadata
- Download URL: mcp_coaia_sequential_thinking-0.3.13-py3-none-any.whl
- Upload date:
- Size: 138.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f5b04cea4b1c06d7a365b8996079f4fedd50b9a3f85b47eb9393706826d3863
|
|
| MD5 |
49929b97d9ada0e3824e90c816d3a58b
|
|
| BLAKE2b-256 |
56afb85ca6e5549f8eff55c9c7395c6f8fc6a8f954ec6f7442049eef9685e754
|