Skip to content

Commit f4c0f12

Browse files
FradSercodex
andcommitted
feat!: enforce full_exploration workflow
- enforce full_exploration as the only routing strategy - return structured loop controls from sequentialthinking - add learning resources, token metrics events, and tests This aligns routing, workflow orchestration, and tool contract metadata around one deterministic multi-step path, with updated documentation for looped client integration and reflection steps. BREAKING CHANGE: remove single/double/triple routing modes. Co-Authored-By: Codex <codex@openai.com>
1 parent 09753ad commit f4c0f12

31 files changed

+1890
-1178
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- LearningMachine-backed agent learning with culture updates and reasoning tools for synthesis agents
12+
- Event-driven token usage tracking from model request events
13+
14+
### Changed
15+
- Upgraded Agno dependency to >=2.4.7
16+
- **BREAKING**: Routing simplified to mandatory `full_exploration` (legacy single/double/triple strategy modes removed)
17+
- Workflow now runs complexity analysis + full sequence only (condition-based simple/full branching removed)
18+
- Forced strategy validation now rejects legacy strategy keys and accepts only `full_exploration`
19+
- `sequentialthinking` tool contract now documents multi-step loop orchestration in tool description and input schema metadata
20+
- `sequentialthinking` now publishes `outputSchema` and returns `structuredContent` control fields (`should_continue`, `next_thought_number`, `stop_reason`, and parameter guidance)
21+
- Tool description and usage guidance now explicitly require active reflection (`isRevision=true` when correcting prior steps)
22+
1023
## [0.7.0] - 2025-09-24
1124

1225
### Added
@@ -152,4 +165,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
152165
[0.2.1]: https://github.com/FradSer/mcp-server-mas-sequential-thinking/compare/v0.2.0...v0.2.1
153166
[0.2.0]: https://github.com/FradSer/mcp-server-mas-sequential-thinking/compare/v0.1.3...v0.2.0
154167
[0.1.3]: https://github.com/FradSer/mcp-server-mas-sequential-thinking/compare/v0.1.0...v0.1.3
155-
[0.1.0]: https://github.com/FradSer/mcp-server-mas-sequential-thinking/releases/tag/v0.1.0
168+
[0.1.0]: https://github.com/FradSer/mcp-server-mas-sequential-thinking/releases/tag/v0.1.0

README.md

Lines changed: 56 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -75,112 +75,34 @@ The system employs **6 specialized thinking agents**, each focused on a distinct
7575

7676
The system uses **AI-driven complexity analysis** to determine the optimal thinking sequence:
7777

78-
### Processing Strategies:
79-
1. **Single Agent** (Simple questions)
80-
- Direct factual or emotional response
81-
- Fastest processing for straightforward queries
78+
### Processing Strategy:
79+
- **Single fixed strategy**: `full_exploration` is mandatory for all requests
80+
- **No legacy modes**: single/double/triple routing paths are removed
81+
- **Complexity analysis retained**: metrics are still generated for observability
8282

83-
2. **Double Agent** (Moderate complexity)
84-
- Two-step sequences (e.g., Optimistic → Critical)
85-
- Balanced perspectives for evaluation tasks
86-
87-
3. **Triple Agent** (Core thinking)
88-
- Factual → Creative → Synthesis
89-
- Philosophical and analytical problems
90-
91-
4. **Full Sequence** (Complex problems)
92-
- All 6 agents orchestrated together
93-
- Comprehensive multi-perspective analysis
94-
95-
The AI analyzer evaluates:
83+
The AI analyzer still evaluates:
9684
- Problem complexity and semantic depth
9785
- Primary problem type (factual, emotional, creative, philosophical, etc.)
98-
- Required thinking modes for optimal solution
99-
- Appropriate model selection (Enhanced vs Standard)
86+
- Required thinking modes for observability and diagnostics
87+
- Model behavior metadata (Enhanced vs Standard usage)
10088

10189
### AI Routing Flow Diagram
10290

10391
```mermaid
10492
flowchart TD
10593
A[Input Thought] --> B[AI Complexity Analyzer]
106-
107-
B --> C{Problem Analysis}
108-
C --> C1[Complexity Score<br/>0-100]
109-
C --> C2[Problem Type<br/>FACTUAL/EMOTIONAL/<br/>CREATIVE/PHILOSOPHICAL]
110-
C --> C3[Required Thinking Modes]
111-
112-
C1 --> D{Routing Decision}
113-
C2 --> D
114-
C3 --> D
115-
116-
D -->|Score: 0-25<br/>Simple| E1[Single Agent Strategy]
117-
D -->|Score: 26-50<br/>Moderate| E2[Double Agent Strategy]
118-
D -->|Score: 51-75<br/>Complex| E3[Triple Agent Strategy]
119-
D -->|Score: 76-100<br/>Highly Complex| E4[Full Sequence Strategy]
120-
121-
%% Single Agent Flow
122-
E1 --> F1[Factual Agent<br/>120s + ExaTools]
123-
F1 --> G1[Direct Response]
124-
125-
%% Double Agent Flow (Full Parallel)
126-
E2 --> DA1[Both Agents Run in Parallel]
127-
DA1 --> DA2["Agent 1 e.g. Optimistic<br/>120s + ExaTools"]
128-
DA1 --> DA3["Agent 2 e.g. Critical<br/>120s + ExaTools"]
129-
DA2 --> G2[Programmatic Synthesis<br/>Combines both parallel results]
130-
DA3 --> G2
131-
132-
%% Triple Agent Flow (Full Parallel)
133-
E3 --> TA1[All 3 Agents Run in Parallel]
134-
TA1 --> TA2[Factual Agent<br/>120s + ExaTools]
135-
TA1 --> TA3[Creative Agent<br/>240s + ExaTools]
136-
TA1 --> TA4[Critical Agent<br/>120s + ExaTools]
137-
TA2 --> G3[Programmatic Synthesis<br/>Integrates all 3 results]
138-
TA3 --> G3
139-
TA4 --> G3
140-
141-
%% Full Sequence Flow (3-Step Process)
142-
E4 --> FS1[Step 1: Initial Synthesis<br/>60s Enhanced Model<br/>Initial orchestration]
143-
FS1 --> FS2[Step 2: Parallel Execution<br/>5 Agents Run Simultaneously]
144-
145-
FS2 --> FS2A[Factual Agent<br/>120s + ExaTools]
146-
FS2 --> FS2B[Emotional Agent<br/>30s Quick Response]
147-
FS2 --> FS2C[Optimistic Agent<br/>120s + ExaTools]
148-
FS2 --> FS2D[Critical Agent<br/>120s + ExaTools]
149-
FS2 --> FS2E[Creative Agent<br/>240s + ExaTools]
150-
151-
FS2A --> FS3[Step 3: Final Synthesis<br/>60s Enhanced Model<br/>Integrates all parallel results]
152-
FS2B --> FS3
153-
FS2C --> FS3
154-
FS2D --> FS3
155-
FS2E --> FS3
156-
157-
FS3 --> G4[Final Synthesis Output<br/>Comprehensive integrated result]
158-
159-
G1 --> H[Next Iteration or<br/>Final Answer]
160-
G2 --> H
161-
G3 --> H
162-
G4 --> H
163-
164-
style A fill:#e1f5fe
165-
style B fill:#f3e5f5
166-
style C fill:#fff3e0
167-
style D fill:#e8f5e8
168-
style TA1 fill:#ffecb3
169-
style FS2 fill:#ffecb3
170-
style G1 fill:#fce4ec
171-
style G2 fill:#fce4ec
172-
style G3 fill:#fce4ec
173-
style G4 fill:#fce4ec
174-
style H fill:#f1f8e9
94+
B --> C[Complexity Metadata Stored]
95+
C --> D[Fixed Strategy: full_exploration]
96+
D --> E[Step 1: Initial Synthesis]
97+
E --> F[Step 2: Parallel Specialist Agents]
98+
F --> G[Step 3: Final Synthesis]
99+
G --> H[Unified Response]
175100
```
176101

177102
**Key Insights:**
178-
- **Parallel Execution**: Non-synthesis agents run simultaneously for maximum efficiency
179-
- **Synthesis Integration**: Synthesis agents process parallel results sequentially
180-
- **Two Processing Types**:
181-
- **Synthesis Agent**: Real AI agent using Enhanced Model for integration
182-
- **Programmatic Synthesis**: Code-based combination when no Synthesis Agent
183-
- **Performance**: Parallel processing optimizes both speed and quality
103+
- **Deterministic behavior**: every request runs the same full multi-step path
104+
- **Parallel execution**: non-synthesis agents still run simultaneously
105+
- **Synthesis integration**: orchestration and final answer are both synthesis-driven
184106

185107
## Research Capabilities (ExaTools Integration)
186108

@@ -231,8 +153,8 @@ In essence, the system evolved from a passive thought *recorder* to an active th
231153

232154
1. **Initiation:** An external LLM uses the `sequentialthinking` tool to define the problem and initiate the process.
233155
2. **Tool Call:** The LLM calls the `sequentialthinking` tool with the current thought, structured according to the `ThoughtData` model.
234-
3. **AI Complexity Analysis:** The system uses AI-powered analysis to determine the optimal thinking sequence based on problem complexity and type.
235-
4. **Agent Routing:** Based on the analysis, the system routes the thought to the appropriate thinking agents (single, double, triple, or full sequence).
156+
3. **AI Complexity Analysis:** The system still performs AI-powered analysis to capture complexity metadata and diagnostic signals.
157+
4. **Fixed Strategy Execution:** The system always runs the mandatory `full_exploration` multi-step sequence.
236158
5. **Parallel Processing:** Multiple thinking agents process the thought simultaneously from their specialized perspectives:
237159
- Factual agents gather objective data (with optional web research)
238160
- Critical agents identify risks and problems
@@ -257,23 +179,45 @@ The server exposes a single MCP tool that processes sequential thoughts:
257179
### Parameters:
258180
```typescript
259181
{
260-
thought: string, // Current thinking step content
261-
thoughtNumber: number, // Sequence number (≥1)
262-
totalThoughts: number, // Estimated total steps
263-
nextThoughtNeeded: boolean, // Is another step required?
264-
isRevision: boolean, // Revising previous thought?
265-
branchFromThought?: number, // Branch point (for exploration)
266-
branchId?: string, // Branch identifier
267-
needsMoreThoughts: boolean // Need to extend sequence?
182+
thought: string, // One focused reasoning step
183+
thoughtNumber: number, // 1-based step index; increment each call
184+
totalThoughts: number, // Planned number of steps
185+
nextThoughtNeeded: boolean, // true for intermediate steps, false on final step
186+
isRevision: boolean, // true only when revising earlier conclusions
187+
branchFromThought?: number, // Set with branchId to branch from a prior step
188+
branchId?: string, // Branch identifier (required when branching)
189+
needsMoreThoughts: boolean // true only when extending beyond totalThoughts
268190
}
269191
```
270192

271193
### Response:
272-
Returns synthesized analysis from the multi-agent system with:
273-
- Processed thought analysis
274-
- Guidance for next steps
275-
- Branch and revision tracking
276-
- Status and metadata
194+
The tool returns both:
195+
- `content`: human-readable synthesis text
196+
- `structuredContent`: machine-readable loop control fields
197+
198+
```typescript
199+
{
200+
should_continue: boolean, // Canonical continuation signal
201+
next_thought_number: number?, // Recommended next thoughtNumber
202+
stop_reason: string, // Why to continue/stop/retry
203+
current_thought_number: number,
204+
total_thoughts: number,
205+
next_call_arguments?: { // Suggested next-call arguments when applicable
206+
thoughtNumber: number,
207+
totalThoughts: number,
208+
nextThoughtNeeded: boolean,
209+
needsMoreThoughts: boolean
210+
},
211+
parameter_usage: Record<string, string>
212+
}
213+
```
214+
215+
### Call Contract (Important)
216+
- Use this tool as a **multi-step loop**, not a one-shot call.
217+
- After every response, read `structuredContent.should_continue`.
218+
- Continue calling `sequentialthinking` until `should_continue` is `false`.
219+
- Actively use reflection: when a step is weak or incorrect, send a revision step with `isRevision=true`.
220+
- Prefer `structuredContent.next_thought_number` and `next_call_arguments` when building the next request.
277221

278222
## Installation
279223

@@ -436,9 +380,9 @@ Open http://127.0.0.1:6274/ and test the `sequentialthinking` tool.
436380

437381
### Strengths:
438382
- **Multi-perspective analysis**: 6 different cognitive approaches
439-
- **AI-powered routing**: Intelligent complexity analysis
383+
- **AI-powered analysis**: Complexity metrics for observability
440384
- **Research capabilities**: 4 agents with web search (optional)
441-
- **Flexible processing**: Single to full sequence strategies
385+
- **Deterministic processing**: Fixed full multi-step sequence
442386
- **Model optimization**: Enhanced/Standard model selection
443387
- **Provider agnostic**: Works with multiple LLM providers
444388

@@ -503,4 +447,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
503447

504448
---
505449

506-
**Note**: This is an MCP server, designed to work with MCP-compatible clients like Claude Desktop. It is not a standalone chat application.
450+
**Note**: This is an MCP server, designed to work with MCP-compatible clients like Claude Desktop. It is not a standalone chat application.

0 commit comments

Comments
 (0)