---
title: "3-Tier Memory Architecture"
description: "OrchestKit stores your decisions once and brings them back in later Claude Code sessions. See the three memory tiers, the confidence rule and the hooks."
canonical: "https://orchestkit.dev/docs/memory/overview"
---

# 3-Tier Memory Architecture

OrchestKit stores your decisions once and brings them back in later Claude Code sessions. See the three memory tiers, the confidence rule and the hooks.

import { Callout } from 'fumadocs-ui/components/callout';

OrchestKit maintains a **3-tier memory architecture** that stores decisions once and surfaces them automatically in every future session. Each tier serves a distinct purpose, and the system degrades gracefully: if a tier is unavailable, the tiers above it continue operating without interruption.

## Architecture at a Glance

| Tier | Name | Storage | Config Required | Purpose |
|------|------|---------|-----------------|---------|
| **1** | [Graph Memory](/docs/memory/graph-memory) | MCP `mcp__memory__*` | Needs a memory MCP server (not bundled) | Primary once configured. Entities with typed relations. |
| **2** | [Local Persistence](/docs/memory/local-memory) | `.claude/memory/*.jsonl` | None | Session backup, offline queues, durability. |
| **3** | [CC Native](/docs/memory/native-cc-memory) | `~/.claude/projects/*/memory/MEMORY.md` | None | Injected into Claude's system prompt. Survives plugin removal. |

<Callout type="info">
Tiers 2 and 3 need no setup. Tier 1 needs a memory MCP server, which OrchestKit does not bundle: see [Set up memory](/docs/cookbook/setup-memory). Tier 2 creates its directory automatically.
</Callout>

## How Decisions Flow Across Tiers

When you store a decision with `/ork:memory remember`, Claude writes it through the graph MCP. Local files and MEMORY.md are written by skills or by Claude when the session calls for it, not by a background writer.

| Tier | Backend | What Gets Stored |
|---|---|---|
| **1. Graph Memory** | `mcp__memory__create_entities` + `create_relations` | Entities: `cursor-pagination` (Pattern), `list-endpoints` (Component). Relation: `project -> CHOSE -> cursor-pagination` |
| **2. Local Persistence** | `.claude/memory/decisions.jsonl` | Optional decision record, when a skill or script writes one |
| **3. CC Native** | `~/.claude/projects/<project>/memory/MEMORY.md` | Claude auto-injects this into every future system prompt |

### No Automatic Scoring

Nothing in OrchestKit scores decisions or promotes them between tiers. A decision reaches a tier when Claude or a skill writes it there.

## The Read Path

When Claude processes your prompt, multiple hooks activate to surface relevant memory.

### On Request

No hook injects memory on each prompt or at session start. Reads happen when Claude calls the graph MCP, for example through `/ork:memory search`. CC Native memory is the exception: Claude Code injects MEMORY.md itself.

### On Agent Spawn

When a subagent is created, it inherits memory context from the parent session. The agent's domain keywords (e.g., PostgreSQL, schema, migration for `database-engineer`) are used by Claude to search the knowledge graph via `mcp__memory__search_nodes` for relevant entities.

## The Write Path

Decisions enter the system through multiple channels.

### Explicit Storage

```bash
# Basic decision
/ork:memory remember "Use JWT tokens for auth, not session cookies"

# Successful pattern
/ork:memory remember --success "Cursor-based pagination scales for 2M+ rows"

# Anti-pattern
/ork:memory remember --failed "Offset pagination caused timeouts at 1M rows"

# Cross-project best practice
/ork:memory remember --global "Always validate input at API boundaries"
```

### Suggested Capture

One hook suggests what to store. It writes nothing itself:

| Hook | Lifecycle | What It Captures |
|------|-----------|-----------------|
| `session-summary` | `stop` | Suggests graph entity capture via `additionalContext` for high-activity sessions (20+ tool calls) |

### Entity and Relation Extraction

`/ork:memory remember` extracts structured data from natural language:

| Input Pattern | Extracted Entity Type |
|---|---|
| Capitalized terms (PostgreSQL, React) | Technology |
| Agent names (database-engineer) | Agent |
| Pattern names (cursor-pagination) | Pattern |
| "decided to...", "chose..." | Decision |
| Failed patterns (`--failed` flag) | AntiPattern |

| Input Pattern | Extracted Relation |
|---|---|
| "X uses Y" | `USES` |
| "chose X over Y" | `CHOSE_OVER` |
| "X requires Y" | `REQUIRES` |
| "X enables Y" | `ENABLES` |
| "X prefers Y" | `PREFERS` |

## Memory Fabric: Unified Search

The **Memory Fabric** layer sits above individual tiers and provides unified search with cross-referencing. When you run `/ork:memory search "pagination"`, the fabric:

1. **Parses** the query into search terms and entity hints
2. **Dispatches** queries to the knowledge graph
3. **Normalizes** results to a common format with source, relevance score, and entities
4. **Deduplicates** results with greater than 85% text similarity, keeping the higher-relevance copy
5. **Ranks** by: `recency (0.3) x relevance (0.5) x source_authority (0.2)`

## Memory Health

Check the health of all tiers at any time:

```bash
/ork:memory status
```

The health check validates:

- **Graph tier**: `.claude/memory/` exists, `decisions.jsonl` is parseable, queue depth is below threshold
- **Local tier**: JSONL files are parseable, queue depths are below threshold
- **CC Native tier**: MEMORY.md exists and is readable

Possible statuses: `healthy`, `degraded` (corrupt lines or high queue depth), `unavailable` (missing directory or API key).

## Sharing Scopes

Decisions are scoped to control where they are visible:

| Scope | User ID Format | Visibility |
|---|---|---|
| `local` | Current session only | Not persisted beyond session |
| `user` | User-scoped ID | Personal across sessions |
| `team` | `{project}-decisions` | Shared within project |
| `global` | `orchestkit-global-best-practices` | Cross-project, anonymized |

Decisions with confidence >= 0.8, a rationale, and a well-known technology or pattern keyword are automatically marked as generalizable and eligible for global sharing.

## Graceful Degradation

The system is designed to function at every level of configuration:

| Configuration | Available Tiers | Behavior |
|---|---|---|
| OrchestKit installed (default) | 1, 2, 3 | Full local memory, graph storage, CC Native MEMORY.md |
| OrchestKit removed | 3 only | CC Native MEMORY.md still injected by Claude. Decisions kept there survive. |
| Fresh machine, no plugins | None | Start fresh. Install OrchestKit to begin building memory. |

<Callout type="info">
The most important design decision in the memory architecture: CC Native MEMORY.md (Tier 3) is a plain Markdown file managed by Claude Code itself. This means the decisions you keep there persist even if you uninstall OrchestKit, switch machines, or change plugin versions.
</Callout>

## Next Steps

- [Graph Memory](/docs/memory/graph-memory): how the primary knowledge graph works
- [Local Persistence](/docs/memory/local-memory): JSONL queues and session backup
- [CC Native Memory](/docs/memory/native-cc-memory): how MEMORY.md works beside OrchestKit
- [Set Up Cross-Session Memory](/docs/cookbook/setup-memory): hands-on cookbook
