Patterns
Open Reasoning Format
Agent Memory Β· Draft v0.1 Β· Filesystem Native

Open Reasoning Format

A file-based memory format for AI coding agents to preserve reusable lessons, traps, and validated paths without vector databases or server infrastructure.

Core Idea

Experience as project memory

Reusable lessons are stored as Markdown playbooks with YAML frontmatter, kept close to the codebase and reviewable in Git.

Retrieval

Progressive disclosure

Agents inspect categories, then frontmatter, then full experiences only when a lesson matches the current task.

Best Fit

Trap-aware workflows

ORF is built for recurring bugs, tool gotchas, validated command paths, and hard-won debugging knowledge.

Open Reasoning Format (ORF) is a file-based specification that gives AI coding agents persistent memory of past problem-solving experience. Lessons are stored as plain Markdown files under an experiences/ directory β€” no vector databases, no embedding pipelines, no server infrastructure required.


Why ORF Exists

The Problem

Most agent sessions start cold. Every time the context window resets, the agent re-learns the same:

  • Framework gotchas
  • Parser edge cases
  • Command failures
  • Deployment traps
  • Debugging paths

This repetition wastes tokens, time, and reliability.

Existing Approaches Fall Short

ApproachProblem
Large RAG / vector systemsAdds embedding pipelines and retrieval infrastructure
Single giant memory fileLoads too much irrelevant context; hard to maintain

The ORF Solution

ORF treats hard-won agent experience as source-controlled project knowledge. Each lesson is a small, structured playbook that records:

  1. The objective that triggered the lesson
  2. The trap or failure mode encountered
  3. An abstracted, reusable insight
  4. The validated path that worked
  5. A verification checklist

Think of it as a compact technical wiki for agents β€” not a search system or a monolithic prompt file.


Core Architecture

All experiences live under a single project-local directory:

<project-root>/
└── experiences/
    β”œβ”€β”€ INDEX.md
    └── <domain>/
        └── EXP-<YYYYMMDD>-<sequence>.md

Key design decisions:

  • No database or daemon β€” files are plain Markdown, readable by humans and cheap for agents to inspect.
  • Git-native β€” every file can be diffed, reviewed, and reverted like any other source artifact.
  • INDEX.md as router β€” lists categories with short descriptions so an agent can determine whether relevant memory exists before loading any details.

Experience File Structure

Each experience file is a Markdown document with YAML frontmatter and five mandatory sections.

Step 1 β€” Frontmatter (Metadata)

---
id: "EXP-<YYYYMMDD>-<sequence>"
title: "<Short, imperative title>"
description: "<When to load this experience>"
domain: "<domain-id>"
keywords: [keyword1, keyword2]
complexity: "low" | "medium" | "high"
created_at: "YYYY-MM-DD"
---

Step 2 β€” Body Sections

## 1. Objective
<What task triggered the experience>

## 2. The Trap
<The naive path, failure mode, error, or edge case>

## 3. Abstracted Insight
> **Core Principle:** <Reusable heuristic>

## 4. Validated Path
<The commands, edits, or steps that worked>

## 5. Verification Checklist
- [ ] <How to confirm the path still works>

Why these two sections matter most:

  • The Trap makes failure modes first-class, so a future agent can match on symptoms before it even knows the fix.
  • Abstracted Insight forces the lesson above a one-off execution log into a reusable rule of thumb.

How Agents Retrieve Memory (Progressive Disclosure)

ORF never loads every memory file into context. Instead, it uses a three-step retrieval pattern that is intentionally token-budgeted:

StepActionWhat the Agent Learns
1List categoriesWhich experience domains exist
2Read frontmatter for a categoryWhich specific lessons may match
3Read one full experienceThe full trap, insight, path, and checklist

How it works in practice:

  1. Inspect low-cost category metadata (cheap).
  2. Scan frontmatter for one domain (cheap).
  3. Load the full body only after a match is found (expensive, done once).

This mirrors the discovery pattern used by agent skills: show cheap summaries first, reveal expensive detail only after a match is confirmed.


Reference CLI

A lightweight Python CLI handles both retrieval and recording.

Retrieving Experiences

# Step 1 β€” See which domains have recorded experience
python3 manage-experience/scripts/experiences.py list-categories

# Step 2 β€” Read frontmatter for a specific category
python3 manage-experience/scripts/experiences.py get-frontmatter --category python-scripting

# Step 3 β€” Read a specific experience in full
python3 manage-experience/scripts/experiences.py read-experience --id EXP-20260720-0001

Recording a New Experience

python3 manage-experience/scripts/experiences.py create-experience --domain cloud-run ...

Important: create-experience writes the new file and updates INDEX.md, but does not commit anything. This is a deliberate trust boundary β€” new memory appears as a normal working-tree change for human review before it becomes part of the project’s knowledge base.


Packaging as an Agent Skill

ORF also packages the experience workflow as an agentskills.io-style skill named manage-experience. A compliant host can:

  1. Discover the skill automatically.
  2. Run retrieval at the start of a complex task.
  3. Record a new experience after resolving something non-trivial.

The Two-Phase Lifecycle

Task Start                              Task End
    β”‚                                       β”‚
    β–Ό                                       β–Ό
Consult prior experience        Record the lesson for
via progressive disclosure      future agents to use

This feedback loop is ORF’s core goal: agent work should improve the next agent run instead of disappearing with the session.


Adoption: Step-by-Step Checklist

Follow these steps to add ORF to a project:

  • Step 1 β€” Create experiences/INDEX.md with your initial domain categories.
  • Step 2 β€” Add the manage-experience skill and reference CLI to the project.
  • Step 3 β€” Configure the agent to consult ORF at the start of complex tasks.
  • Step 4 β€” Configure the agent to record a new experience after resolving a non-obvious trap.
  • Step 5 β€” Review experiences/ changes like source code so stale or low-quality memory does not accumulate.

Where ORF Fits: Lineage

ORF combines ideas from three adjacent formats and research directions:

InfluenceWhat ORF Borrows
Reasoning BankStore abstracted heuristics and named traps, not raw trajectories
Open Knowledge FormatUse Markdown + YAML frontmatter as a portable, Git-native representation
Agent SkillsUse progressive disclosure so agents load summaries before full detail

ORF is a narrow format for episodic problem-solving memory β€” not general organizational knowledge, not a tool skill registry, and not a semantic search corpus.


Evaluation Model

ORF uses a cold-versus-warm evaluation flow to measure effectiveness:

  1. Cold run β€” an agent attempts a task without any prior experience files.
  2. Spec validation β€” generated experience files are checked for required frontmatter and sections.
  3. Warm run β€” a fresh agent repeats the same task with the recorded experience available.

Early results show fewer repeated debugging steps in warm runs. Sample sizes are small, so treat findings as directional: ORF demonstrates that structured experience files can help a later agent avoid a known trap.


Compared With Alternatives

CapabilityORFVector DB / RAG MemoryMonolithic Memory File
InfrastructureFilesystem onlyEmbeddings + vector storeFilesystem only
RetrievalMetadata-first progressive disclosureSemantic top-k retrievalEverything loads
Human reviewGit-native MarkdownOften opaque or indirectGit-native text
Write pathStructured agent-created experiencesUsually separate ingestionManual edits
Best fitSmall-to-medium lessons learned storesLarge unstructured corporaSmall stable context

ORF is strongest when the memory unit is a reusable operational lesson: a trap, fix, command sequence, framework gotcha, or validated debugging path.


Strengths

StrengthDetail
No infrastructureAdoption can be as small as adding a folder, a skill, and a Python script
Git-nativeExperience records can be diffed, reviewed, blamed, reverted, and discussed in PRs
Token-awareRetrieval is staged so agents do not load every past lesson into context
Trap-orientedThe format optimizes for recognizing recurring failure modes, not just matching topics
Agent-writableMemory can compound over repeated task execution instead of remaining a static document

Limitations

LimitationDetail
Early draftv0.1.0 should be treated as experimental
Abstraction quality not guaranteedAgents may still record overly specific lessons despite the schema
Staleness unresolvedValidated paths can decay as dependencies, tools, and platforms change
Deduplication undefinedOverlapping or conflicting experiences need human or future-tool consolidation
Team sharing still openCross-repo experience distribution is not yet fully specified

Bottom Line

ORF is a practical pattern for agent memory: structured, local, auditable, and cheap to query.

Its most useful idea is not the file extension or CLI, but the discipline of turning agent trial-and-error into small reusable playbooks that future agents can discover before repeating the same mistake.

Future References

Explore these resources for deeper learning on AI agent development, spec-driven development, and prompt engineering tools.

Spec-Driven Development

Comprehensive guide on Spec-Driven Development practices and methodologies.

Awesome Copilot

Curated list of GitHub Copilot resources, extensions, and best practices.

Promptfoo

Tool for testing, evaluating, and improving LLM prompts and applications.

Prompts.chat

Collection of prompt engineering resources and templates.

Agent Skills

Agent skills resources and documentation for building AI agent skills.

Awesome Skills

Curated list of awesome skill repositories and collections.

Agent Skills Topic

GitHub topic for discovering agent-related skills and repositories.

AI Agent Topic

Trendshift topic for discovering AI agents.

AI Skills Topic

Trendshift topic for discovering AI skills.

Agent Governance Toolkit

Agent governance toolkit.

Pattern Sources

Our patterns are curated from industry-leading sources with proper attribution and licensing compliance.

Refactoring.Guru

Classic GoF design patterns, code smells catalog, and refactoring techniques (https://refactoring.guru).

Enterprise Integration Patterns

65 messaging patterns for integrating enterprise applications by Gregor Hohpe and Bobby Woolf (CC BY 4.0).

Microservices.io

Comprehensive patterns for microservice architectures by Chris Richardson.

Agent Catalog Patterns

Patterns for agentic systems from agentpatternscatalog.org (CC BY 4.0).

OWASP Foundation

Security patterns from OWASP Top 10 for Web Applications, LLM Applications, and Agentic Applications (CC BY-SA 4.0).

Industry Research

ML/AI patterns from Microsoft, Google, Anthropic, and academic research.

AI Agent Patterns

Spec-driven development patterns from Claude, Gemini, OpenAI, and GitHub Copilot on github/spec-kit and OpenSpec.

Data Engineering Leaders

Data platform patterns from Martin Fowler (Data Mesh), Kimball Group (Dimensional Modeling), and cloud providers.

MLOps Best Practices

Data science patterns from MLflow, Great Expectations, and MLOps practitioners.

Streaming & Analytics

Real-time patterns from Confluent/Kafka, Apache projects, and serverless analytics platforms.

Academic Papers

Rigorous ML patterns from peer-reviewed research including data leakage prevention and active learning.

5-Day AI Agents Course

Intensive Vibe Coding Course With Google by Brenda Flynn et al. (2026) on Kaggle.

The Agent Loop

Foundational Agent Definition (Perceive + Act):
Russell, S. J., & Norvig, P. (1995). Artificial Intelligence: A Modern Approach. Prentice Hall. (Current edition: 4th Ed., Pearson, 2020)

Modern Iterative LLM Agent Loop:
Yao, S., Zhao, J., Yu, D., et al. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629.

Historical Context:
Incorporating AIMA's perceive/act model, Classical robotics' Sense-Plan-Act loop (Brooks, 1986), and ReAct's Thought→Action→Observation cycle.