The Idea
Individual AI techniques are powerful, but using any single one is like having a carpenter who only owns a hammer. The Cognitive Loop is the complete workshop — a universal template that organizes the full thinking process into seven clear stages, each powered by the right technique for the job.
At each stage, the system selects the most appropriate Level 2 composition. Simple problems get chain-of-thought reasoning. Complex branching problems get tree search. Tool-heavy tasks get agent loops. The key insight: which technique to use depends on the nature of the problem, and the Cognitive Loop makes that selection systematic rather than ad hoc.
Component Patterns
This system orchestrates compositions from Level 2:
Think Step by Step Self-Ask Least-to-Most RAG Patterns Plan-and-Execute ReWOO LLMCompiler ReAct Self-Consistency ReflexionThe Cognitive Loop doesn't replace these patterns — it orchestrates them. Each stage selects the right pattern based on what the task demands.
The Seven Stages
Perceive
Understand the input. What type of task is this? What's being asked? What implicit needs aren't stated? The system normalizes the raw request and extracts task structure.
Rephrase & Respond • Step-Back PromptingRetrieve
Gather relevant context. Search memory for similar past problems, retrieve relevant documents, pull in user preferences. Build the knowledge foundation before reasoning begins.
RAG Patterns • Thread-of-ThoughtReason
Think about the problem. A meta-controller classifies complexity and selects the right reasoning pattern: chain-of-thought for simple problems, tree search for complex ones, self-ask for multi-hop questions.
Chain-of-Thought • Tree-of-Thoughts • Self-Ask • Least-to-MostPlan
Create a concrete action plan. Sequential steps? Run them in order. Independent steps? Run them in parallel. The planning style matches the task structure.
Plan-and-Execute • ReWOO • LLMCompilerAct
Execute the plan. Use tools, write code, search the web, generate content. The system picks the right execution pattern — dynamic tool use, code execution, or delegated multi-model workflows.
ReAct • Program of ThoughtsVerify
Check the work. Did the action produce the right result? Are there errors? Run verification checks and score confidence. If it passes, output the result.
Self-Consistency • Check Your WorkReflect
When verification fails, analyze what went wrong. Generate a self-critique, extract the lesson, store it in memory, and loop back to Reason with richer context. Up to N retries.
ReflexionSee It in Action
A developer asks: "Fix the bug in my authentication code."
Why This Works
The power of the Cognitive Loop is that it mirrors how expert humans actually solve complex problems. An expert doesn't just think — they gather context, choose the right approach for the type of problem, make a plan, execute it, check their work, and learn from mistakes. Each of those steps is a distinct cognitive skill.
By making each stage explicit and selecting the right technique for each, the system avoids the biggest failure mode of simpler approaches: using the wrong tool for the job. A math problem gets code execution, not free-form reasoning. A research question gets retrieval, not hallucinated facts. A complex decision gets tree search, not a single linear chain.
The System
Perceive the task. Retrieve context. Reason with the right pattern. Plan the approach. Act with tools. Verify the result. Reflect on failure. Seven stages, each using the best available technique — that's a complete thinking system.
When to Use This
- • Complex, multi-faceted tasks where no single technique is sufficient
- • General-purpose agents that need to handle diverse task types reliably
- • Systems where errors are costly and verification matters
- • Applications that need to learn from mistakes over time through reflection
When to Skip This
- • Simple one-shot queries — seven stages is massive overhead for "What's the capital of France?"
- • Latency-critical applications — each stage adds processing time
- • Cost-sensitive scenarios — multiple LLM calls per stage adds up quickly
- • Narrow, well-defined tasks — if the right technique is always the same, skip the selection overhead
How It Relates
The Cognitive Loop is the default "operating system" for an intelligent agent. The Adaptive Pattern Router can sit above it, deciding when to invoke the full loop versus a simpler approach. LATS can plug into the Reason stage for especially hard problems. JARVIS can handle the Act stage when multi-model workflows are needed.
At Level 4, the Cognitive Operating System and Hierarchical Agent Architecture coordinate multiple Cognitive Loops running in parallel, each handling different aspects of a larger mission.