c

cortex-plugin-chain-of-thought

ESM
v1.0.0MIT

Pluggable reasoning strategies (CoT, Tree-of-Thoughts, ReAct, Plan-and-Execute) for Cortex agents

0.013CortexPrism
agent-strategyaicortex-plugindevelopmentesmreasoning

Install Command

$ cortex plugin install marketplace:cortexprism.io/plugins/cortex-plugin-chain-of-thought
Website RepositoryLicense: MITEntry: mod.ts

Configuration

Plugin Type
ESM
Entry Point
mod.ts
License
MIT

Capabilities

toolsmiddleware:premiddleware:post

Tags

agent-strategyaicortex-plugindevelopmentesmreasoning

Statistics

Downloads
13
Rating
0.0
/ 5.0
Version
v1.0.0
Published
June 15, 2026

Reviews (0)

No reviews yet. Be the first to rate this plugin!

README

CortexPrism Chain-of-Thought Agent Strategy

Pluggable reasoning strategies that Cortex agents can dynamically select per-task for smarter, more structured problem-solving. Includes Chain-of-Thought, Tree-of-Thoughts, ReAct, and Plan-and-Execute strategies.

Installation

cortex plugin install cortex-plugin-chain-of-thought

Or install from local development:

git clone https://github.com/CortexPrism/cortex-plugin-chain-of-thought.git
cd cortex-plugin-chain-of-thought
cortex plugin install .

Reasoning Strategies

StrategyBest ForDescription
Chain-of-Thought (CoT)Math, Logic, DebuggingLinear step-by-step reasoning through a problem
Tree-of-Thoughts (ToT)Planning, Creative, DecisionBranching exploration of multiple reasoning paths with pruning
ReActCoding, Debugging, DecisionInterleaved reasoning and action with observation cycles
Plan-and-ExecutePlanning, Coding, AnalysisTwo-phase: create detailed plan, then execute in dependency order

Configuration

SettingTypeDefaultDescription
defaultStrategystringautoDefault strategy when none specified (cot, tot, react, plan_execute, auto)
maxTreeDepthnumber5Maximum depth for Tree-of-Thoughts branching
treeBreadthnumber3Number of branches per node in Tree-of-Thoughts
reactMaxIterationsnumber15Maximum thought-action-observation cycles for ReAct

Tools

reason

Execute a reasoning strategy on a given problem.

{
  "problem": "How do I optimize this database query that's taking 5 seconds?",
  "strategy": "react",
  "context": "SELECT * FROM users JOIN orders ON ...",
  "max_steps": 10
}

list_strategies

List all available reasoning strategies with descriptions and recommendations.

{}

select_strategy

Auto-select the best strategy for a task.

{
  "task_description": "Debug a failing CI pipeline",
  "task_type": "debugging"
}

evaluate_reasoning

Evaluate the quality of a reasoning trace for logical gaps and coherence.

{
  "reasoning_trace": "Step 1: ... Step 2: ...",
  "criteria": "logic,completeness,clarity"
}

Usage Example

> I need to solve a complex architecture decision

1. select_strategy → { task_type: "decision" }
→ Selected: Tree-of-Thoughts

2. reason → { strategy: "tot", problem: "Monolith vs Microservices for our app..." }
→ Explores 3 branches, prunes 2, identifies best path with 0.82 confidence

How It Works

This plugin operates as a middleware layer in the Cortex agent loop:

  1. Pre-middleware: Before each agent turn, the plugin can inject the selected strategy's system prompt
  2. Tool execution: The reason tool simulates running the strategy (in production, this delegates to the LLM with strategy-specific prompting)
  3. Post-middleware: After each agent turn, the plugin can evaluate reasoning quality and suggest strategy adjustments

Development

deno task test
deno fmt && deno lint

# Test reasoning
cortex plugin call cortex-plugin-chain-of-thought reason '{"problem":"What is 2+2?","strategy":"cot"}'

License

MIT

Published June 15, 2026 · Updated June 16, 2026