sequential thinking multi-agent system.com
sequential thinking multi-agent system.com logo

Sequential Thinking Multi-Agent System

Orchestrates a team of specialized agents working in parallel to break down complex problems through structured thinking...

Created byApr 22, 2025

Sequential Thinking Multi-Agent System (MAS) ![](https://img.shields.io/badge/A%20FRAD%20PRODUCT-WIP-yellow)

English |
This project implements an advanced sequential thinking process using a Multi-Agent System (MAS) built with the Agno framework and served via MCP. It represents a significant evolution from simpler state-tracking approaches by leveraging coordinated, specialized agents for deeper analysis and problem decomposition.

Overview

This server provides a sophisticated sequentialthinking tool designed for complex problem-solving. Unlike its predecessor, this version utilizes a true Multi-Agent System (MAS) architecture where:
  • A Coordinating Agent (the Team object in coordinate mode) manages the workflow.
  • Specialized Agents (Planner, Researcher, Analyzer, Critic, Synthesizer) handle specific sub-tasks based on their defined roles and expertise.
  • Incoming thoughts are actively processed, analyzed, and synthesized by the agent team, not just logged.
  • The system supports complex thought patterns, including revisions of previous steps and branching to explore alternative paths.
  • Integration with external tools like Exa (via the Researcher agent) allows for dynamic information gathering.
  • Robust Pydantic validation ensures data integrity for thought steps.
  • Detailed logging tracks the process, including agent interactions (handled by the coordinator).
The goal is to achieve a higher quality of analysis and a more nuanced thinking process than possible with a single agent or simple state tracking by harnessing the power of specialized roles working collaboratively.

Key Differences from Original Version (TypeScript)

This Python/Agno implementation marks a fundamental shift from the original TypeScript version:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
In essence, the system evolved from a passive thought recorder to an active thought processor powered by a collaborative team of AI agents.

How it Works (Coordinate Mode)

  1. Initiation: An external LLM uses the sequential-thinking-starter prompt to define the problem and initiate the process.
  1. Tool Call: The LLM calls the sequentialthinking tool with the first (or subsequent) thought, structured according to the ThoughtData Pydantic model.
  1. Validation & Logging: The tool receives the call, validates the input using Pydantic, logs the incoming thought, and updates the history/branch state via AppContext.
  1. Coordinator Invocation: The core thought content (along with context about revisions/branches) is passed to the SequentialThinkingTeam's arun method.
  1. Coordinator Analysis & Delegation: The Team (acting as Coordinator) analyzes the input thought, breaks it down into sub-tasks, and delegates these sub-tasks to the most relevant specialist agents (e.g., Analyzer for analysis tasks, Researcher for information needs).
  1. Specialist Execution: Delegated agents execute their specific sub-tasks using their instructions, models, and tools (like ThinkingTools or ExaTools).
  1. Response Collection: Specialists return their results to the Coordinator.
  1. Synthesis & Guidance: The Coordinator synthesizes the specialists' responses into a single, cohesive output. This output may include recommendations for revision or branching based on the specialists' findings (especially from the Critic and Analyzer). It also provides guidance for the LLM on formulating the next thought.
  1. Return Value: The tool returns a JSON string containing the Coordinator's synthesized response, status, and updated context (branches, history length).
  1. Iteration: The calling LLM uses the Coordinator's response and guidance to formulate the next sequentialthinking tool call, potentially triggering revisions or branches as suggested.

Token Consumption Warning

High Token Usage: Due to the Multi-Agent System architecture, this tool consumes significantly more tokens than single-agent alternatives or the previous TypeScript version. Each sequentialthinking call invokes:
  • The Coordinator agent (the Team itself).
  • Multiple specialist agents (potentially Planner, Researcher, Analyzer, Critic, Synthesizer, depending on the Coordinator's delegation).
This parallel processing leads to substantially higher token usage (potentially 3-6x or more per thought step) compared to single-agent or state-tracking approaches. Budget and plan accordingly. This tool prioritizes analysis depth and quality over token efficiency.

Prerequisites

  • Python 3.10+
  • Access to a compatible LLM API (configured for agno). The system currently supports:
  • Exa API Key (required only if using the Researcher agent's capabilities)
  • uv package manager (recommended) or pip.

MCP Server Configuration (Client-Side)

This server runs as a standard executable script that communicates via stdio, as expected by MCP. The exact configuration method depends on your specific MCP client implementation. Consult your client's documentation for details on integrating external tool servers.
The env section within your MCP client configuration should include the API key for your chosen LLM_PROVIDER.

Installation & Setup

  1. Clone the repository:
  1. Set Environment Variables: Create a .env file in the project root directory or export the variables directly into your environment:Note on Model Selection:
  1. Install Dependencies: It's highly recommended to use a virtual environment.

Usage

Ensure your environment variables are set and the virtual environment (if used) is active.
Run the server. Choose one of the following methods:

Sequential Thinking Multi-Agent System (MAS) ![](https://img.shields.io/badge/A%20FRAD%20PRODUCT-WIP-yellow)

English |
This project implements an advanced sequential thinking process using a Multi-Agent System (MAS) built with the Agno framework and served via MCP. It represents a significant evolution from simpler state-tracking approaches by leveraging coordinated, specialized agents for deeper analysis and problem decomposition.

Overview

This server provides a sophisticated sequentialthinking tool designed for complex problem-solving. Unlike its predecessor, this version utilizes a true Multi-Agent System (MAS) architecture where:
  • A Coordinating Agent (the Team object in coordinate mode) manages the workflow.
  • Specialized Agents (Planner, Researcher, Analyzer, Critic, Synthesizer) handle specific sub-tasks based on their defined roles and expertise.
  • Incoming thoughts are actively processed, analyzed, and synthesized by the agent team, not just logged.
  • The system supports complex thought patterns, including revisions of previous steps and branching to explore alternative paths.
  • Integration with external tools like Exa (via the Researcher agent) allows for dynamic information gathering.
  • Robust Pydantic validation ensures data integrity for thought steps.
  • Detailed logging tracks the process, including agent interactions (handled by the coordinator).
The goal is to achieve a higher quality of analysis and a more nuanced thinking process than possible with a single agent or simple state tracking by harnessing the power of specialized roles working collaboratively.

Key Differences from Original Version (TypeScript)

This Python/Agno implementation marks a fundamental shift from the original TypeScript version:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
In essence, the system evolved from a passive thought recorder to an active thought processor powered by a collaborative team of AI agents.

How it Works (Coordinate Mode)

  1. Initiation: An external LLM uses the sequential-thinking-starter prompt to define the problem and initiate the process.
  1. Tool Call: The LLM calls the sequentialthinking tool with the first (or subsequent) thought, structured according to the ThoughtData Pydantic model.
  1. Validation & Logging: The tool receives the call, validates the input using Pydantic, logs the incoming thought, and updates the history/branch state via AppContext.
  1. Coordinator Invocation: The core thought content (along with context about revisions/branches) is passed to the SequentialThinkingTeam's arun method.
  1. Coordinator Analysis & Delegation: The Team (acting as Coordinator) analyzes the input thought, breaks it down into sub-tasks, and delegates these sub-tasks to the most relevant specialist agents (e.g., Analyzer for analysis tasks, Researcher for information needs).
  1. Specialist Execution: Delegated agents execute their specific sub-tasks using their instructions, models, and tools (like ThinkingTools or ExaTools).
  1. Response Collection: Specialists return their results to the Coordinator.
  1. Synthesis & Guidance: The Coordinator synthesizes the specialists' responses into a single, cohesive output. This output may include recommendations for revision or branching based on the specialists' findings (especially from the Critic and Analyzer). It also provides guidance for the LLM on formulating the next thought.
  1. Return Value: The tool returns a JSON string containing the Coordinator's synthesized response, status, and updated context (branches, history length).
  1. Iteration: The calling LLM uses the Coordinator's response and guidance to formulate the next sequentialthinking tool call, potentially triggering revisions or branches as suggested.

Token Consumption Warning

High Token Usage: Due to the Multi-Agent System architecture, this tool consumes significantly more tokens than single-agent alternatives or the previous TypeScript version. Each sequentialthinking call invokes:
  • The Coordinator agent (the Team itself).
  • Multiple specialist agents (potentially Planner, Researcher, Analyzer, Critic, Synthesizer, depending on the Coordinator's delegation).
This parallel processing leads to substantially higher token usage (potentially 3-6x or more per thought step) compared to single-agent or state-tracking approaches. Budget and plan accordingly. This tool prioritizes analysis depth and quality over token efficiency.

Prerequisites

  • Python 3.10+
  • Access to a compatible LLM API (configured for agno). The system currently supports:
  • Exa API Key (required only if using the Researcher agent's capabilities)
  • uv package manager (recommended) or pip.

MCP Server Configuration (Client-Side)

This server runs as a standard executable script that communicates via stdio, as expected by MCP. The exact configuration method depends on your specific MCP client implementation. Consult your client's documentation for details on integrating external tool servers.
The env section within your MCP client configuration should include the API key for your chosen LLM_PROVIDER.

Installation & Setup

  1. Clone the repository:
  1. Set Environment Variables: Create a .env file in the project root directory or export the variables directly into your environment:Note on Model Selection:
  1. Install Dependencies: It's highly recommended to use a virtual environment.

Usage

Ensure your environment variables are set and the virtual environment (if used) is active.
Run the server. Choose one of the following methods:
  1. Using `uv run` (Recommended):
  1. Directly using Python:
The server will start and listen for requests via stdio, making the sequentialthinking tool available to compatible MCP clients configured to use it.

`sequentialthinking` Tool Parameters

The tool expects arguments matching the ThoughtData Pydantic model:

Interacting with the Tool (Conceptual Example)

An LLM would interact with this tool iteratively:
  1. LLM: Uses a starter prompt (like sequential-thinking-starter) with the problem definition.
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 1, the initial thought (e.g., "Plan the analysis..."), an estimated totalThoughts, and nextThoughtNeeded: True.
  1. Server: MAS processes the thought. The Coordinator synthesizes responses from specialists and provides guidance (e.g., "Analysis plan complete. Suggest researching X next. No revisions recommended yet.").
  1. LLM: Receives the JSON response containing coordinatorResponse.
  1. LLM: Formulates the next thought based on the coordinatorResponse (e.g., "Research X using available tools...").
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 2, the new thought, potentially updated totalThoughts, nextThoughtNeeded: True.
  1. Server: MAS processes. The Coordinator synthesizes (e.g., "Research complete. Findings suggest a flaw in thought #1's assumption. RECOMMENDATION: Revise thought #1...").
  1. LLM: Receives the response, notes the recommendation.
  1. LLM: Formulates a revision thought.
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 3, the revision thought, isRevision: True, revisesThought: 1, nextThoughtNeeded: True.
  1. ... and so on, potentially branching or extending the process as needed.

Tool Response Format

The tool returns a JSON string containing:

Logging

  • Logs are written to ~/.sequential_thinking/logs/sequential_thinking.log by default. (Configuration might be adjustable in the logging setup code).
  • Uses Python's standard logging module.
  • Includes a rotating file handler (e.g., 10MB limit, 5 backups) and a console handler (typically INFO level).
  • Logs include timestamps, levels, logger names, and messages, including structured representations of thoughts being processed.

Development

  1. Clone the repository: (As in Installation)
  1. Set up Virtual Environment: (Recommended)
  1. Install Dependencies (including dev): Ensure your requirements-dev.txt or pyproject.toml specifies development tools (like pytest, ruff, black, mypy).
  1. Run Checks: Execute linters, formatters, and tests (adjust commands based on your project setup).
  1. Contribution: (Consider adding contribution guidelines: branching strategy, pull request process, code style).

License

MIT

Sequential Thinking Multi-Agent System (MAS) ![](https://img.shields.io/badge/A%20FRAD%20PRODUCT-WIP-yellow)

English |
This project implements an advanced sequential thinking process using a Multi-Agent System (MAS) built with the Agno framework and served via MCP. It represents a significant evolution from simpler state-tracking approaches by leveraging coordinated, specialized agents for deeper analysis and problem decomposition.

Overview

This server provides a sophisticated sequentialthinking tool designed for complex problem-solving. Unlike its predecessor, this version utilizes a true Multi-Agent System (MAS) architecture where:
  • A Coordinating Agent (the Team object in coordinate mode) manages the workflow.
  • Specialized Agents (Planner, Researcher, Analyzer, Critic, Synthesizer) handle specific sub-tasks based on their defined roles and expertise.
  • Incoming thoughts are actively processed, analyzed, and synthesized by the agent team, not just logged.
  • The system supports complex thought patterns, including revisions of previous steps and branching to explore alternative paths.
  • Integration with external tools like Exa (via the Researcher agent) allows for dynamic information gathering.
  • Robust Pydantic validation ensures data integrity for thought steps.
  • Detailed logging tracks the process, including agent interactions (handled by the coordinator).
The goal is to achieve a higher quality of analysis and a more nuanced thinking process than possible with a single agent or simple state tracking by harnessing the power of specialized roles working collaboratively.

Key Differences from Original Version (TypeScript)

This Python/Agno implementation marks a fundamental shift from the original TypeScript version:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
In essence, the system evolved from a passive thought recorder to an active thought processor powered by a collaborative team of AI agents.

How it Works (Coordinate Mode)

  1. Initiation: An external LLM uses the sequential-thinking-starter prompt to define the problem and initiate the process.
  1. Tool Call: The LLM calls the sequentialthinking tool with the first (or subsequent) thought, structured according to the ThoughtData Pydantic model.
  1. Validation & Logging: The tool receives the call, validates the input using Pydantic, logs the incoming thought, and updates the history/branch state via AppContext.
  1. Coordinator Invocation: The core thought content (along with context about revisions/branches) is passed to the SequentialThinkingTeam's arun method.
  1. Coordinator Analysis & Delegation: The Team (acting as Coordinator) analyzes the input thought, breaks it down into sub-tasks, and delegates these sub-tasks to the most relevant specialist agents (e.g., Analyzer for analysis tasks, Researcher for information needs).
  1. Specialist Execution: Delegated agents execute their specific sub-tasks using their instructions, models, and tools (like ThinkingTools or ExaTools).
  1. Response Collection: Specialists return their results to the Coordinator.
  1. Synthesis & Guidance: The Coordinator synthesizes the specialists' responses into a single, cohesive output. This output may include recommendations for revision or branching based on the specialists' findings (especially from the Critic and Analyzer). It also provides guidance for the LLM on formulating the next thought.
  1. Return Value: The tool returns a JSON string containing the Coordinator's synthesized response, status, and updated context (branches, history length).
  1. Iteration: The calling LLM uses the Coordinator's response and guidance to formulate the next sequentialthinking tool call, potentially triggering revisions or branches as suggested.

Token Consumption Warning

High Token Usage: Due to the Multi-Agent System architecture, this tool consumes significantly more tokens than single-agent alternatives or the previous TypeScript version. Each sequentialthinking call invokes:
  • The Coordinator agent (the Team itself).
  • Multiple specialist agents (potentially Planner, Researcher, Analyzer, Critic, Synthesizer, depending on the Coordinator's delegation).
This parallel processing leads to substantially higher token usage (potentially 3-6x or more per thought step) compared to single-agent or state-tracking approaches. Budget and plan accordingly. This tool prioritizes analysis depth and quality over token efficiency.

Prerequisites

  • Python 3.10+
  • Access to a compatible LLM API (configured for agno). The system currently supports:
  • Exa API Key (required only if using the Researcher agent's capabilities)
  • uv package manager (recommended) or pip.

MCP Server Configuration (Client-Side)

This server runs as a standard executable script that communicates via stdio, as expected by MCP. The exact configuration method depends on your specific MCP client implementation. Consult your client's documentation for details on integrating external tool servers.
The env section within your MCP client configuration should include the API key for your chosen LLM_PROVIDER.

Installation & Setup

  1. Clone the repository:
  1. Set Environment Variables: Create a .env file in the project root directory or export the variables directly into your environment:Note on Model Selection:
  1. Install Dependencies: It's highly recommended to use a virtual environment.

Usage

Ensure your environment variables are set and the virtual environment (if used) is active.
Run the server. Choose one of the following methods:
  1. Using `uv run` (Recommended):
  1. Directly using Python:
The server will start and listen for requests via stdio, making the sequentialthinking tool available to compatible MCP clients configured to use it.

`sequentialthinking` Tool Parameters

The tool expects arguments matching the ThoughtData Pydantic model:

Interacting with the Tool (Conceptual Example)

An LLM would interact with this tool iteratively:
  1. LLM: Uses a starter prompt (like sequential-thinking-starter) with the problem definition.
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 1, the initial thought (e.g., "Plan the analysis..."), an estimated totalThoughts, and nextThoughtNeeded: True.
  1. Server: MAS processes the thought. The Coordinator synthesizes responses from specialists and provides guidance (e.g., "Analysis plan complete. Suggest researching X next. No revisions recommended yet.").
  1. LLM: Receives the JSON response containing coordinatorResponse.
  1. LLM: Formulates the next thought based on the coordinatorResponse (e.g., "Research X using available tools...").
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 2, the new thought, potentially updated totalThoughts, nextThoughtNeeded: True.
  1. Server: MAS processes. The Coordinator synthesizes (e.g., "Research complete. Findings suggest a flaw in thought #1's assumption. RECOMMENDATION: Revise thought #1...").
  1. LLM: Receives the response, notes the recommendation.
  1. LLM: Formulates a revision thought.
  1. LLM: Calls sequentialthinking tool with thoughtNumber: 3, the revision thought, isRevision: True, revisesThought: 1, nextThoughtNeeded: True.
  1. ... and so on, potentially branching or extending the process as needed.

Tool Response Format

The tool returns a JSON string containing:

Logging

  • Logs are written to ~/.sequential_thinking/logs/sequential_thinking.log by default. (Configuration might be adjustable in the logging setup code).
  • Uses Python's standard logging module.
  • Includes a rotating file handler (e.g., 10MB limit, 5 backups) and a console handler (typically INFO level).
  • Logs include timestamps, levels, logger names, and messages, including structured representations of thoughts being processed.

Development

  1. Clone the repository: (As in Installation)
  1. Set up Virtual Environment: (Recommended)
  1. Install Dependencies (including dev): Ensure your requirements-dev.txt or pyproject.toml specifies development tools (like pytest, ruff, black, mypy).
  1. Run Checks: Execute linters, formatters, and tests (adjust commands based on your project setup).
  1. Contribution: (Consider adding contribution guidelines: branching strategy, pull request process, code style).

License

MIT