MCPcopy Create free account
hub / github.com/PhialsBasement/Chain-of-Recursive-Thoughts

github.com/PhialsBasement/Chain-of-Recursive-Thoughts @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
64 symbols 151 edges 12 files ⚖ MIT 13 documented · 20% updated 16mo ago★ 2,3281 open issues

Browse by type

Functions 54 Types & classes 4 Endpoints 6
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CoRT (Chain of Recursive Thoughts) 🧠🔄

TL;DR: I made my AI think harder by making it argue with itself repeatedly. It works stupidly well.

What is this?

CoRT makes AI models recursively think about their responses, generate alternatives, and pick the best one. It's like giving the AI the ability to doubt itself and try again... and again... and again.

Does it actually work?

YES. I tested it with Mistral 3.1 24B and it went from "meh" to "holy crap", especially for such a small model, at programming tasks.

How it works

  1. AI generates initial response
  2. AI decides how many "thinking rounds" it needs
  3. For each round:
  4. Generates 3 alternative responses
  5. Evaluates all responses
  6. Picks the best one
  7. Final response is the survivor of this AI battle royale

How to use the Web UI(still early dev)

  1. Open start_recthink.bat
  2. wait for a bit as it installs dependencies
  3. profit??

If running on linux:

pip install -r requirements.txt
cd frontend && npm install
cd ..
python ./recthink_web.py

(open a new shell)

cd frontend
npm start

Examples

Mistral 3.1 24B + CoRT rec

Mistral 3.1 24B non CoRT non-rec

Try it yourself

pip install -r requirements.txt
export OPENROUTER_API_KEY="your-key-here"
python recursive-thinking-ai.py

The Secret Sauce

The magic is in:

  • Self-evaluation
  • Competitive alternative generation
  • Iterative refinement
  • Dynamic thinking depth

Star History(THANK YOU SO MUCH)

Star History Chart

Contributing

Found a way to make it even better? PR's welcome!

License

MIT - Go wild with it

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 46
Method 8
Route 6
Class 4

Languages

Python66%
TypeScript34%

Modules by API surface

recthink_web.py19 symbols
recursive_thinking_ai.py10 symbols
demos/rec-tic-tac.py9 symbols
frontend/src/context/RecThinkContext.js7 symbols
frontend/src/components/RecursiveThinkingInterface.jsx7 symbols
frontend/src/api.js6 symbols
demos/tic-tac.py4 symbols
frontend/src/reportWebVitals.js1 symbols
frontend/src/App.js1 symbols

For agents

$ claude mcp add Chain-of-Recursive-Thoughts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page