The Neocortex Format
Long-Term Memory for AI Agents
A schema-organized, biologically-inspired memory format that any agent can read, write, and share. Plain text. Human-readable. LLM-parseable.
By Roman Godz & R2D2
Every Agent Reinvents Memory
There is no standard, no interoperability, and no theory behind the design of AI agent long-term memory.
Proprietary Silos
Mem0 uses proprietary JSON. MemGPT stores memory blocks. OpenAI's memory is opaque. Memory created in one system stays locked in that system. No portability, no interoperability.
Unstructured Chaos
Most agents use unstructured markdown that grows until it's unusable. By entry 200, it's a haystack with no needles — or all needles and no way to find the right one.
No Theory Behind Design
Every developer invents their own format from scratch. No biological grounding, no consolidation rules, no pruning strategy. Just 'however the developer felt like.'
| System | Format | Portable? | Standard? |
|---|---|---|---|
| Mem0 | Proprietary JSON + graph | Within Mem0 | No |
| MemGPT / Letta | Memory blocks (JSON) | Within Letta | No |
| OpenAI Memory | Internal, opaque | No | No |
| Claude Projects | Per-project context | No | No |
| Custom agents | Whatever markdown | Technically | No |
How It Works
A self-describing header, seven standard sections mirroring cortical specialization, and gist-extracted entries optimized for token efficiency.
<!-- neocortex.md v1.0 --> <!-- agent: atlas --> <!-- owner: Jane Chen --> <!-- consolidated: 2026-01-31 --> <!-- entries: 187 | tokens: ~9,400 --> # Memory ## Identity - Name: Atlas | Role: Engineering assistant - Style: Precise, thorough, prefers concise answers ## People - Jane: Owner. Seattle. Prefers Slack over email. ## Projects - Acme API: REST platform. Next.js + Postgres + Redis. ## Knowledge - OAuth2 + PKCE for all SPAs. Tokens expire in 1h. ## Patterns - Jane prefers dark theme, monospace fonts in docs ## Lessons - ALWAYS write to files, not "mental notes" — they don't survive ## Context - Current focus: API v2 migration (Jan-Feb 2026)
Key Features
Schema-Organized
5–8 domain sections mirroring cortical specialization. Not one flat list — modular regions like the brain itself. Each section handles a knowledge domain.
Gist Over Verbatim
Store meaning, not exact words. 50 tokens average per entry instead of 55-line conversation excerpts. 36× compression over raw logs.
Metadata Tracking
HTML comment metadata tracks last update, confidence, access count, and source. Enables intelligent pruning decisions without cluttering the readable text.
Consolidation Rules
Entries transform over time: detailed → compressed → gist. Daily light cycles, weekly deep merges, monthly full audits. Like sleep consolidation.
Pruning & Size Constraints
10K-token target with per-section limits. Retention scoring based on access frequency, recency, and confidence. Forgetting is a feature, not a bug.
Contradiction Handling
Supersession format with strikethrough history. Prediction errors are learning signals. Higher-confidence info wins. Full provenance preserved.
Brain Mapping
Each section maps to a brain region that specializes in that type of knowledge. This isn't arbitrary — it's 200 million years of mammalian evolution.
| Section | Brain Analog | What It Stores | Stability |
|---|---|---|---|
| Identity | Prefrontal Cortex | Self-model, values, communication style | Very High |
| People | Fusiform Face Area | Key individuals, relationships, preferences | High |
| Projects | Motor/Planning Cortex | Active work, decisions, architecture | Medium |
| Knowledge | Association Cortex | Technical skills, domain expertise, APIs | Medium |
| Patterns | Basal Ganglia | User preferences, routines, workflows | Med-High |
| Lessons | Error-Correction Circuits | Mistakes, insights, anti-patterns | High |
| Context | Temporal/Spatial Cortex | Time-sensitive info, current priorities | Low |
Self-model, values, communication style
Key individuals, relationships, preferences
Active work, decisions, architecture
Technical skills, domain expertise, APIs
User preferences, routines, workflows
Mistakes, insights, anti-patterns
Time-sensitive info, current priorities
Real Benchmarks
Measured on a production agent over 30 days.
| Approach | Size | Entries | Accuracy |
|---|---|---|---|
| Raw conversation logs | ~340K tokens | N/A | 76% |
| Unstructured MEMORY.md | ~18K tokens | ~240 | 86% |
| neocortex.md format ✦ | ~9.4K tokens | ~187 | 94% |
The file is MEMORY.md.
The format is neocortex.md.
neocortex.md is a format specification, not a filename. Just as an HTML5 document lives in a .html file, a neocortex.md-formatted memory lives in MEMORY.md. The format identifier in the header tells any reader what standard the file follows.
Adoption is frictionless: restructure your existing MEMORY.md, add the header, and you're done. No migration tooling, no config changes, no broken references.
Brain Architecture
neocortex.md is one component of a biologically-inspired agent workspace. Each protocol handles one function. Together, they form a complete memory system.
Neocortex stores what the agent knows. Hippocampus indexes where memories are.
Defrag defines when to consolidate. Synapse shares knowledge between agents.
Get Started
Create a MEMORY.md with the neocortex.md format. No infrastructure, no dependencies. A text editor and a convention.
<!-- neocortex.md v1.0 -->
<!-- agent: my-agent -->
<!-- consolidated: 2026-01-31 -->
<!-- entries: 0 | tokens: ~500 -->
# Memory
## Identity
- Name: {agent_name} | Role: {role}
- Owner: {owner_name} | Timezone: {tz}
- Style: {communication style}
## People
- {Person}: {role}. {key facts}.
## Projects
- {Project}: {status}. {key architecture}.
## Knowledge
- {Fact}: {compressed knowledge}.
## Patterns
- {Pattern}: {observed behavior or preference}.
## Lessons
- {Lesson}: {what happened} → {what to do instead}.
## Context
- {Current situation}: {time-sensitive detail}.
---
<!-- Consolidation rules:
- Max entries: 300
- Max tokens: 15,000
- Prune: accessed=0 AND age>90d
- Compress: accessed<3 AND age>30d
- Frequency: daily (light), weekly (deep), monthly (full)
-->