Conceptual Framework — This page describes a theoretical architecture synthesized from published research, not a single proven technique. The building blocks are real; the overall design is a blueprint for how they could fit together.

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 Reflexion

The 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

1

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 Prompting
2

Retrieve

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-Thought
3

Reason

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-Most
4

Plan

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 • LLMCompiler
5

Act

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 Thoughts
6

Verify

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 Work
↓ (on failure)
7

Reflect

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.

Reflexion

See It in Action

A developer asks: "Fix the bug in my authentication code."

1
Perceive
Task analysis
Task type: debugging. Domain: code. Implicit needs: understand the codebase, identify the bug, propose and test a fix.
2
Retrieve
Context gathered
Found similar past auth issues in memory. Retrieved auth.py source code. Pulled JWT best practices documentation.
3
Reason
Least-to-Most selected (decomposable problem)
Hypothesis: "Token expiration is not being handled." Confidence: 0.8. Sub-problems: (1) find token validation code, (2) check expiration logic, (3) add refresh mechanism.
4
Plan → Act
ReAct execution
Read auth.py → found missing expiration check → added token expiration validation → added refresh mechanism → wrote tests → ran tests.
5
Verify
Verification result
Tests pass, but deeper check catches that the login flow is now broken — token format changed without updating login.py. FAIL
↓ Loop back with reflection
6
Reflect → Retry
Self-critique stored in memory
"Changed token format without updating login. Lesson: always trace token usage across the entire auth flow." Re-entered Reason stage with enriched context → fixed login.py too → all tests pass. PASS

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

When to Skip This

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.