reasoning-patterns

A guide to choosing patterns for building AI agents with tools. An agent is a program that can reason about a task and call tools; these patterns describe when to use one step, code, verification, or a structured multi-stage workflow.

In plain words
What is it for?
Use it when designing an agent’s reasoning workflow. It explains the default ReAct approach, a code-action approach for data work, verification, debate and research patterns, and custom graphs.
Why use it?
It helps avoid adding unnecessary stages that increase delay and token use. It clarifies which approach fits simple tasks, calculations over data, self-checking, or deliberate multi-step work.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/promptise-com/foundry/reasoning-patterns
Clone the repo
git clone --depth 1 https://github.com/promptise-com/Foundry
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03531
Opus 5 $0.00000 $0.01766
Sonnet 5 $0.00000 $0.00706
Haiku 4.5 $0.00000 $0.00353

Measured 2d ago against content hash 6c0f2d13cf1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reasoning-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/core/agents/reasoning-patterns.md · 384 lines

How it starts

The opening of the file, as written. The whole thing — 384 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reasoning Patterns

Every Promptise agent is powered by a Reasoning Graph. By default, build_agent() creates a ReAct graph (single node with tools) — and that default is smart by default: it manages context automatically (context_scope="auto"), so simple tasks are unchanged and deep tool loops stay token-efficient without you choosing anything.

!!! tip "Which one do I need? (most people: none)" - Just call build_agent(model, servers) — the default handles context and tools well for the overwhelming majority of agents. - Computing over data (sums, averages, multi-hop joins)? → code-action — write one program instead of chaining tool calls. - Want a cheap self-check on a weak/cheap model? → verify. - Need a specific multi-stage shape (debate, research pipeline, deep deliberation)? → the structured patterns below, or build your own graph.

The rest are specialized. Don't reach for a multi-stage pattern expecting more accuracy — on capable models they mostly add latency and tokens; the default plus `code-action` is the efficient path.

You can replace the default with any of the 10 built-in patterns, or build your own.

graph TD
    BA[build_agent] -->|'react'| R1[ReAct]
    BA -->|'verify'| R9[Verify]
    BA -->|'managed'| R10[Managed]
    BA -->|'code-action'| R11[Code-Action]
    BA -->|'peoatr'| R2[PEOATR]
    BA -->|'research'| R3[Research]
    BA -->|'autonomous'| R4[Autonomous]
    BA -->|'deliberate'| R5[Deliberate]
    BA -->|'debate'| R6[Debate]
    BA -->|'pipeline'| R7[Pipeline]
    BA -->|PromptGraph| R8[Custom]

    subgraph Agent Wrapper
        M[Memory] --- G[Guardrails] --- C[Cache]
        G --- O[Observability] --- E[Events]
    end

    R1 --> Agent Wrapper
    R4 --> Agent Wrapper
    R8 --> Agent Wrapper

    style BA fill:#1e3a5f,stroke:#60a5fa,color:#fff
    style R1 fill:#1a2e1a,stroke:#4ade80,color:#fff
    style R9 fill:#1a2e1a,stroke:#4ade80,color:#fff
    style R10 fill:#1a2e1a,stroke:#4ade80,color:#fff
    style R11 fill:#1a2e1a,stroke:#4ade80,color:#fff
    style R2 fill:#2d1b4e,stroke:#c084fc,color:#fff
    style R3 fill:#3a2a0a,stroke:#fbbf24,color:#fff
    style R4 fill:#3a1a1a,stroke:#f87171,color:#fff
    style R5 fill:#2d1b4e,stroke:#c084fc,color:#fff
    style R6 fill:#3a1a1a,stroke:#f87171,color:#fff
    style R7 fill:#1a2e1a,stroke:#4ade80,color:#fff
    style R8 fill:#3a2a0a,stroke:#fbbf24,color:#fff

The Reasoning Graph replaces only the inner loop. All other features (memory, guardrails, cache, observability, events, approval, streaming) stay the same regardless of pattern.

Read the full file on GitHub · 384 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 384 lines · 0 tokens per session scan A 6c0f2d13cf1b

Subscribe to this mod's changes

reasoning-patterns is an agent published in the GitHub repository promptise-com/Foundry (869 stars, last pushed 13d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,531 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

lg-react-named-services-config

Agent "lg-react-named-services-config" from kdcube/kdcube, covering lg-react: connecting named services — two config shapes, shape a — per-service connections, shape b — whole surface, choosing and keeping the three declarations honest.

kdcube/kdcube · 0 tokens

stack-auditor

Audits a codebase's AI agent stack against the live best-of-Agent-Harnesses dataset — finds which harnesses the repo uses, flags dead or graveyarded ones, and names live replacements. Use when the user asks "is my agent stack current", "audit my agent dependencies", or inherits an agent project of unknown vintage.

RyanAlberts/best-of-Agent-Harnesses · 73 tokens

harness-radar

Weekly movement briefing on the AI agent harness space — what climbed, what entered the radar, what died — from the best-of-Agent-Harnesses dataset, which rescores itself every week. Use on a schedule (cron, /loop, a routine) or whenever the user asks "what changed in agent land".

RyanAlberts/best-of-Agent-Harnesses · 68 tokens

harness-scout

Picks the right AI agent harness for a described task or project. Use when the user asks "what harness/framework/agent tool should I use", compares agent frameworks, or starts an agent project without a stack decision. Grounded in the live best-of-Agent-Harnesses dataset, never in training-data memory.

RyanAlberts/best-of-Agent-Harnesses · 68 tokens

agent-orchestration-context-manager

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2024/2025 best practices. Use PROACTIVELY for complex AI…

wshobson/agents · 66 tokens

basic-agents

A basic agent uses a predefined strategy with a simple execution flow that works for most common use cases. It accepts a string input (a question, request, or task description) and sends this input to the configured LLM. The LLM may decide to call provided tools. The agent will execute the tools and send the results…

JetBrains/koog · 0 tokens