claude_memory 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.claude/CLAUDE.md +3 -0
- data/.claude/memory.sqlite3 +0 -0
- data/.claude/output-styles/memory-aware.md +21 -0
- data/.claude/rules/claude_memory.generated.md +21 -0
- data/.claude/settings.json +62 -0
- data/.claude/settings.local.json +21 -0
- data/.claude-plugin/marketplace.json +13 -0
- data/.claude-plugin/plugin.json +10 -0
- data/.mcp.json +11 -0
- data/CHANGELOG.md +36 -0
- data/CLAUDE.md +224 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +212 -0
- data/Rakefile +10 -0
- data/commands/analyze.md +29 -0
- data/commands/recall.md +17 -0
- data/commands/remember.md +26 -0
- data/docs/demo.md +126 -0
- data/docs/organizational_memory_playbook.md +291 -0
- data/docs/plan.md +411 -0
- data/docs/plugin.md +202 -0
- data/docs/updated_plan.md +453 -0
- data/exe/claude-memory +8 -0
- data/hooks/hooks.json +59 -0
- data/lib/claude_memory/cli.rb +869 -0
- data/lib/claude_memory/distill/distiller.rb +11 -0
- data/lib/claude_memory/distill/extraction.rb +29 -0
- data/lib/claude_memory/distill/json_schema.md +78 -0
- data/lib/claude_memory/distill/null_distiller.rb +123 -0
- data/lib/claude_memory/hook/handler.rb +49 -0
- data/lib/claude_memory/index/lexical_fts.rb +58 -0
- data/lib/claude_memory/ingest/ingester.rb +46 -0
- data/lib/claude_memory/ingest/transcript_reader.rb +21 -0
- data/lib/claude_memory/mcp/server.rb +127 -0
- data/lib/claude_memory/mcp/tools.rb +409 -0
- data/lib/claude_memory/publish.rb +201 -0
- data/lib/claude_memory/recall.rb +360 -0
- data/lib/claude_memory/resolve/predicate_policy.rb +30 -0
- data/lib/claude_memory/resolve/resolver.rb +152 -0
- data/lib/claude_memory/store/sqlite_store.rb +340 -0
- data/lib/claude_memory/store/store_manager.rb +139 -0
- data/lib/claude_memory/sweep/sweeper.rb +80 -0
- data/lib/claude_memory/templates/hooks.example.json +74 -0
- data/lib/claude_memory/templates/output-styles/memory-aware.md +21 -0
- data/lib/claude_memory/version.rb +5 -0
- data/lib/claude_memory.rb +36 -0
- data/sig/claude_memory.rbs +4 -0
- data/skills/analyze/SKILL.md +126 -0
- data/skills/memory/SKILL.md +82 -0
- metadata +123 -0
data/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# ClaudeMemory
|
|
2
|
+
|
|
3
|
+
Turn-key Ruby gem providing Claude Code with instant, high-quality, long-term, self-managed memory using **Claude Code Hooks + MCP + Output Style**, with minimal dependencies (SQLite by default).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Automated ingestion**: Claude Code hooks trigger delta-based transcript ingestion
|
|
8
|
+
- **Claude-powered fact extraction**: Uses Claude's own intelligence to extract facts (no API key needed)
|
|
9
|
+
- **Truth maintenance**: Deterministic conflict/supersession resolution
|
|
10
|
+
- **Full-text search**: SQLite FTS5 for fast recall without embeddings
|
|
11
|
+
- **MCP integration**: Memory tools accessible directly in Claude Code
|
|
12
|
+
- **Snapshot publishing**: Curated memory files for Claude Code's built-in system
|
|
13
|
+
- **Claude Code Plugin**: Install as a plugin for seamless integration
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
gem install claude_memory
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or add to your Gemfile:
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
gem 'claude_memory'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Initialize in your project (project-local)
|
|
31
|
+
cd your-project
|
|
32
|
+
claude-memory init
|
|
33
|
+
|
|
34
|
+
# Or install globally for all projects
|
|
35
|
+
claude-memory init --global
|
|
36
|
+
|
|
37
|
+
# Verify setup
|
|
38
|
+
claude-memory doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| `init` | Initialize ClaudeMemory in a project |
|
|
46
|
+
| `db:init` | Initialize the SQLite database |
|
|
47
|
+
| `ingest` | Ingest transcript delta |
|
|
48
|
+
| `hook ingest` | Hook entrypoint for ingest (reads stdin JSON) |
|
|
49
|
+
| `hook sweep` | Hook entrypoint for sweep (reads stdin JSON) |
|
|
50
|
+
| `hook publish` | Hook entrypoint for publish (reads stdin JSON) |
|
|
51
|
+
| `search` | Search indexed content |
|
|
52
|
+
| `recall` | Recall facts matching a query |
|
|
53
|
+
| `explain` | Explain a fact with provenance receipts |
|
|
54
|
+
| `conflicts` | Show open conflicts |
|
|
55
|
+
| `changes` | Show recent fact changes |
|
|
56
|
+
| `publish` | Publish snapshot to Claude Code memory |
|
|
57
|
+
| `sweep` | Run maintenance/pruning |
|
|
58
|
+
| `serve-mcp` | Start MCP server for Claude Code |
|
|
59
|
+
| `doctor` | Check system health |
|
|
60
|
+
|
|
61
|
+
## Usage Examples
|
|
62
|
+
|
|
63
|
+
### Ingest Content
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
claude-memory ingest \
|
|
67
|
+
--source claude_code \
|
|
68
|
+
--session-id sess-123 \
|
|
69
|
+
--transcript-path ~/.claude/projects/myproject/transcripts/latest.jsonl
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Recall Facts
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
claude-memory recall "database"
|
|
76
|
+
# Returns facts + provenance receipts
|
|
77
|
+
|
|
78
|
+
claude-memory recall "database" --scope project
|
|
79
|
+
# Only facts scoped to current project
|
|
80
|
+
|
|
81
|
+
claude-memory recall "preferences" --scope global
|
|
82
|
+
# Only global facts (apply to all projects)
|
|
83
|
+
|
|
84
|
+
claude-memory explain 42
|
|
85
|
+
# Detailed explanation with supersession/conflict links
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Publish Snapshot
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Publish to .claude/rules/ (shared, default)
|
|
92
|
+
claude-memory publish
|
|
93
|
+
|
|
94
|
+
# Publish to local file (not committed)
|
|
95
|
+
claude-memory publish --mode local
|
|
96
|
+
|
|
97
|
+
# Publish to user home directory
|
|
98
|
+
claude-memory publish --mode home
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### MCP Tools
|
|
102
|
+
|
|
103
|
+
When configured, these tools are available in Claude Code:
|
|
104
|
+
|
|
105
|
+
- `memory.recall` - Search for relevant facts (supports scope filtering)
|
|
106
|
+
- `memory.explain` - Get detailed fact provenance
|
|
107
|
+
- `memory.promote` - Promote a project fact to global memory
|
|
108
|
+
- `memory.store_extraction` - Store extracted facts from a conversation
|
|
109
|
+
- `memory.changes` - Recent fact updates
|
|
110
|
+
- `memory.conflicts` - Open contradictions
|
|
111
|
+
- `memory.sweep_now` - Run maintenance
|
|
112
|
+
- `memory.status` - System health check
|
|
113
|
+
|
|
114
|
+
## Scope: Global vs Project
|
|
115
|
+
|
|
116
|
+
Facts are scoped to control where they apply:
|
|
117
|
+
|
|
118
|
+
| Scope | Description | Example |
|
|
119
|
+
|-------|-------------|---------|
|
|
120
|
+
| `project` | Applies only to the current project | "This app uses PostgreSQL" |
|
|
121
|
+
| `global` | Applies across all projects | "I prefer 4-space indentation" |
|
|
122
|
+
|
|
123
|
+
**Automatic detection**: The distiller recognizes signals like "always", "in all projects", or "my preference" and sets `scope_hint: "global"`.
|
|
124
|
+
|
|
125
|
+
**Manual promotion**: Use `memory.set_scope` in Claude Code or the user can say "make that preference global" and Claude will call the tool.
|
|
126
|
+
|
|
127
|
+
## Claude Code Plugin
|
|
128
|
+
|
|
129
|
+
ClaudeMemory is available as a Claude Code plugin for seamless integration.
|
|
130
|
+
|
|
131
|
+
### Install as Plugin
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Add the marketplace
|
|
135
|
+
/plugin marketplace add /path/to/claude_memory
|
|
136
|
+
|
|
137
|
+
# Install the plugin
|
|
138
|
+
/plugin install claude-memory
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Plugin Components
|
|
142
|
+
|
|
143
|
+
| Component | Description |
|
|
144
|
+
|-----------|-------------|
|
|
145
|
+
| **MCP Server** | Exposes memory tools to Claude |
|
|
146
|
+
| **Hooks** | Automatic ingestion, extraction, and publishing |
|
|
147
|
+
| **Skill** | `/memory` command for manual interaction |
|
|
148
|
+
|
|
149
|
+
### How Claude-Powered Extraction Works
|
|
150
|
+
|
|
151
|
+
ClaudeMemory uses **prompt hooks** to leverage Claude's own intelligence for fact extraction—no separate API key required:
|
|
152
|
+
|
|
153
|
+
1. **On session stop**: A prompt hook asks Claude to review what it learned
|
|
154
|
+
2. **Claude extracts facts**: Using its understanding of the conversation, Claude identifies durable facts
|
|
155
|
+
3. **Stores via MCP**: Claude calls `memory.store_extraction` to persist the facts
|
|
156
|
+
4. **Truth maintenance**: The resolver handles conflicts and supersession automatically
|
|
157
|
+
|
|
158
|
+
This approach means:
|
|
159
|
+
- ✅ No API key configuration needed
|
|
160
|
+
- ✅ Uses Claude's full contextual understanding
|
|
161
|
+
- ✅ Extracts only genuinely useful, durable facts
|
|
162
|
+
- ✅ Respects scope (project vs global)
|
|
163
|
+
|
|
164
|
+
### Fact Types Extracted
|
|
165
|
+
|
|
166
|
+
| Predicate | Description | Example |
|
|
167
|
+
|-----------|-------------|---------|
|
|
168
|
+
| `uses_database` | Database technology | "PostgreSQL" |
|
|
169
|
+
| `uses_framework` | Framework choice | "Rails", "React" |
|
|
170
|
+
| `deployment_platform` | Where deployed | "Vercel", "AWS" |
|
|
171
|
+
| `convention` | Coding standards | "4-space indentation" |
|
|
172
|
+
| `decision` | Architectural choice | "Use microservices" |
|
|
173
|
+
| `auth_method` | Authentication approach | "JWT tokens" |
|
|
174
|
+
|
|
175
|
+
## Architecture
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Transcripts → Ingest → FTS Index
|
|
179
|
+
↓
|
|
180
|
+
Claude Prompt Hook → Extract entities/facts/signals
|
|
181
|
+
↓
|
|
182
|
+
memory.store_extraction (MCP)
|
|
183
|
+
↓
|
|
184
|
+
Resolve → Truth maintenance (conflicts/supersession)
|
|
185
|
+
↓
|
|
186
|
+
Store → SQLite (facts, provenance, entities, scope)
|
|
187
|
+
↓
|
|
188
|
+
Publish → .claude/rules/claude_memory.generated.md
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Configuration
|
|
192
|
+
|
|
193
|
+
The database location defaults to `.claude_memory.sqlite3` in the project root.
|
|
194
|
+
|
|
195
|
+
Override with `--db PATH` on any command.
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
git clone https://github.com/codenamev/claude_memory
|
|
201
|
+
cd claude_memory
|
|
202
|
+
bin/setup
|
|
203
|
+
bundle exec rspec
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT License - see [LICENSE.txt](LICENSE.txt)
|
|
209
|
+
|
|
210
|
+
## Contributing
|
|
211
|
+
|
|
212
|
+
Bug reports and pull requests welcome at https://github.com/codenamev/claude_memory
|
data/Rakefile
ADDED
data/commands/analyze.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze project and store facts in memory
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Analyze this project to understand its tech stack, frameworks, tools, and conventions.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Read key project files (if they exist):
|
|
11
|
+
- `Gemfile`, `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`
|
|
12
|
+
- `README.md`, `tsconfig.json`, `Dockerfile`
|
|
13
|
+
- `.eslintrc*`, `.prettierrc*`, `.rubocop.yml`, `.standard.yml`
|
|
14
|
+
- `.github/workflows/*.yml`
|
|
15
|
+
|
|
16
|
+
2. Extract facts about:
|
|
17
|
+
- Languages (Ruby, TypeScript, Python, Go, Rust)
|
|
18
|
+
- Frameworks (Rails, React, Next.js, Django, FastAPI)
|
|
19
|
+
- Tools (RSpec, Jest, ESLint, Prettier, Docker)
|
|
20
|
+
- Databases (PostgreSQL, MySQL, Redis, MongoDB)
|
|
21
|
+
- Package managers (Bundler, npm, pnpm, Poetry, Cargo)
|
|
22
|
+
- CI/CD (GitHub Actions, CircleCI, GitLab CI)
|
|
23
|
+
|
|
24
|
+
3. Use `memory.store_extraction` to store facts with:
|
|
25
|
+
- Appropriate entity types and predicates
|
|
26
|
+
- Quotes referencing the source file/line
|
|
27
|
+
- `strength: "stated"` for explicit declarations
|
|
28
|
+
|
|
29
|
+
4. Report what you learned and stored.
|
data/commands/recall.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Recall what you know about this project
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Recall facts stored in memory about this project.
|
|
7
|
+
|
|
8
|
+
Use `memory.recall` to search for relevant facts. Try queries like:
|
|
9
|
+
- "uses" - to find tech stack facts
|
|
10
|
+
- "framework" - to find framework choices
|
|
11
|
+
- "database" - to find database facts
|
|
12
|
+
- "tool" - to find tooling facts
|
|
13
|
+
- "convention" - to find coding conventions
|
|
14
|
+
|
|
15
|
+
Summarize what you know about this project's tech stack and conventions.
|
|
16
|
+
|
|
17
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Store something in memory
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
argument-hint: [what to remember]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Store the following in memory using `memory.store_extraction`:
|
|
8
|
+
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
|
|
11
|
+
## Guidelines
|
|
12
|
+
|
|
13
|
+
1. Choose appropriate entity types:
|
|
14
|
+
- `database`, `framework`, `language`, `platform`, `tool`, `convention`
|
|
15
|
+
|
|
16
|
+
2. Choose appropriate predicates:
|
|
17
|
+
- `uses_database`, `uses_framework`, `uses_language`, `uses_tool`
|
|
18
|
+
- `has_convention`, `prefers`, `decision`
|
|
19
|
+
|
|
20
|
+
3. Set scope:
|
|
21
|
+
- Use `scope_hint: "global"` if the user says this applies to all projects
|
|
22
|
+
- Use `scope_hint: "project"` (default) for project-specific facts
|
|
23
|
+
|
|
24
|
+
4. Include the user's statement as the `quote` for provenance.
|
|
25
|
+
|
|
26
|
+
5. Confirm what was stored.
|
data/docs/demo.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Claude Memory Demo
|
|
2
|
+
|
|
3
|
+
This document walks through a complete end-to-end demo of ClaudeMemory.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install the gem
|
|
9
|
+
gem install claude_memory
|
|
10
|
+
|
|
11
|
+
# Initialize in your project
|
|
12
|
+
cd your-project
|
|
13
|
+
claude-memory init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Ingest Some Content
|
|
17
|
+
|
|
18
|
+
Create a sample transcript:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
echo '{"type":"message","content":"We decided to use PostgreSQL for the database."}
|
|
22
|
+
{"type":"message","content":"Convention: Always use snake_case for variable names."}
|
|
23
|
+
{"type":"message","content":"We are deploying to AWS using Terraform."}' > /tmp/demo_transcript.jsonl
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Ingest it:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude-memory ingest \
|
|
30
|
+
--source claude_code \
|
|
31
|
+
--session-id demo-session \
|
|
32
|
+
--transcript-path /tmp/demo_transcript.jsonl
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Distill and Resolve Facts
|
|
36
|
+
|
|
37
|
+
The distiller extracts structured facts from raw content:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Search the indexed content
|
|
41
|
+
claude-memory search "PostgreSQL"
|
|
42
|
+
|
|
43
|
+
# Check for conflicts
|
|
44
|
+
claude-memory conflicts
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Recall Facts
|
|
48
|
+
|
|
49
|
+
Query the memory:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Recall facts about databases
|
|
53
|
+
claude-memory recall "database"
|
|
54
|
+
|
|
55
|
+
# Explain a specific fact
|
|
56
|
+
claude-memory explain 1
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Publish Snapshot
|
|
60
|
+
|
|
61
|
+
Generate a snapshot for Claude Code:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
claude-memory publish
|
|
65
|
+
|
|
66
|
+
# Check the generated file
|
|
67
|
+
cat .claude/rules/claude_memory.generated.md
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Maintenance
|
|
71
|
+
|
|
72
|
+
Run periodic maintenance:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Run sweep with 5-second budget
|
|
76
|
+
claude-memory sweep --budget 5
|
|
77
|
+
|
|
78
|
+
# Check system status via MCP
|
|
79
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"memory.status","arguments":{}}}' | \
|
|
80
|
+
claude-memory serve-mcp
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Verify Setup
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
claude-memory doctor
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Full Loop with Claude Code
|
|
90
|
+
|
|
91
|
+
1. Configure hooks (from `claude-memory init` output)
|
|
92
|
+
2. Configure MCP server
|
|
93
|
+
3. Start using Claude Code normally
|
|
94
|
+
4. Hooks automatically ingest transcripts
|
|
95
|
+
5. Use MCP tools like `memory.recall` in your prompts
|
|
96
|
+
6. Run `claude-memory publish` periodically to update snapshot
|
|
97
|
+
|
|
98
|
+
## Example: Detecting Conflicts
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# First statement
|
|
102
|
+
echo '{"type":"message","content":"We use MySQL for the database."}' > /tmp/t1.jsonl
|
|
103
|
+
claude-memory ingest --source claude_code --session-id s1 --transcript-path /tmp/t1.jsonl
|
|
104
|
+
|
|
105
|
+
# Contradicting statement without supersession
|
|
106
|
+
echo '{"type":"message","content":"We use PostgreSQL for the database."}' > /tmp/t2.jsonl
|
|
107
|
+
claude-memory ingest --source claude_code --session-id s2 --transcript-path /tmp/t2.jsonl
|
|
108
|
+
|
|
109
|
+
# This would create a conflict (requires distill+resolve which needs LLM in full version)
|
|
110
|
+
claude-memory conflicts
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Example: Supersession
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Original decision
|
|
117
|
+
echo '{"type":"message","content":"We decided to use MySQL."}' > /tmp/t1.jsonl
|
|
118
|
+
claude-memory ingest --source claude_code --session-id s1 --transcript-path /tmp/t1.jsonl
|
|
119
|
+
|
|
120
|
+
# Superseding decision with explicit signal
|
|
121
|
+
echo '{"type":"message","content":"We no longer use MySQL, switching to PostgreSQL."}' > /tmp/t2.jsonl
|
|
122
|
+
claude-memory ingest --source claude_code --session-id s2 --transcript-path /tmp/t2.jsonl
|
|
123
|
+
|
|
124
|
+
# Check recent changes
|
|
125
|
+
claude-memory changes --since 2024-01-01
|
|
126
|
+
```
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# **Organizational Memory: Axioms, Formulae, and Scale Playbook**
|
|
2
|
+
|
|
3
|
+
*A north star for building, evaluating, or reasoning about org-memory systems.*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## I. Core Premise
|
|
8
|
+
|
|
9
|
+
> **When implementation becomes cheap, meaning becomes the bottleneck.**
|
|
10
|
+
|
|
11
|
+
Modern teams no longer fail because they cannot build fast enough.
|
|
12
|
+
They fail because they cannot **remember why they built what they built**.
|
|
13
|
+
|
|
14
|
+
Organizational memory is not storage.
|
|
15
|
+
It is the system that preserves **decision-quality over time**.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## II. Foundational Axioms
|
|
20
|
+
|
|
21
|
+
### **Axiom 1: Code is no longer the primary artifact**
|
|
22
|
+
|
|
23
|
+
The primary artifact is the **decision**.
|
|
24
|
+
|
|
25
|
+
Code is a consequence of decisions.
|
|
26
|
+
Tests, reviews, and conversations encode intent more faithfully than the final diff.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### **Axiom 2: Truth is temporal**
|
|
31
|
+
|
|
32
|
+
There is no permanent truth.
|
|
33
|
+
|
|
34
|
+
Only:
|
|
35
|
+
|
|
36
|
+
> *What was believed to be true, by whom, at a given time.*
|
|
37
|
+
|
|
38
|
+
Any system that cannot answer *“when was this true?”* will hallucinate certainty.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### **Axiom 3: Memory without resolution becomes noise**
|
|
43
|
+
|
|
44
|
+
Captured information increases entropy unless conflicts are resolved.
|
|
45
|
+
|
|
46
|
+
Storing more ≠ knowing more.
|
|
47
|
+
|
|
48
|
+
Resolution creates signal.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### **Axiom 4: Provenance outweighs content**
|
|
53
|
+
|
|
54
|
+
A weak fact with strong provenance is more valuable than a strong claim with no source.
|
|
55
|
+
|
|
56
|
+
Who said it, when, and with what authority matters more than phrasing.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### **Axiom 5: Meaning must be captured at the moment of action**
|
|
61
|
+
|
|
62
|
+
Reconstruction after the fact is lossy.
|
|
63
|
+
|
|
64
|
+
If memory is not embedded in the execution path, it decays immediately.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## III. Primitive Building Blocks
|
|
69
|
+
|
|
70
|
+
### **1. Fact (Temporal)**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
(subject, predicate, object,
|
|
74
|
+
valid_from, valid_to,
|
|
75
|
+
source, confidence)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Facts are intervals, not fields.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### **2. Decision**
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
(action,
|
|
86
|
+
context,
|
|
87
|
+
alternatives,
|
|
88
|
+
rationale,
|
|
89
|
+
approver,
|
|
90
|
+
time,
|
|
91
|
+
outcome)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If “because” cannot be answered, the decision is incomplete.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### **3. Trace (Because Graph)**
|
|
99
|
+
|
|
100
|
+
Edges matter more than nodes.
|
|
101
|
+
|
|
102
|
+
* evidence → rationale
|
|
103
|
+
* rationale → decision
|
|
104
|
+
* decision → action
|
|
105
|
+
* policy(version) → constraint
|
|
106
|
+
* approver → authorization
|
|
107
|
+
|
|
108
|
+
No edges = folklore.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### **4. Status**
|
|
113
|
+
|
|
114
|
+
Every belief must be one of:
|
|
115
|
+
|
|
116
|
+
* current
|
|
117
|
+
* superseded
|
|
118
|
+
* disputed
|
|
119
|
+
|
|
120
|
+
If none apply, the system is lying.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## IV. Core Formulae
|
|
125
|
+
|
|
126
|
+
### **1. Organizational Memory Value**
|
|
127
|
+
|
|
128
|
+
Let:
|
|
129
|
+
|
|
130
|
+
* **R** = rework avoided
|
|
131
|
+
* **O** = onboarding acceleration
|
|
132
|
+
* **D** = decision-quality improvement
|
|
133
|
+
* **A** = adoption rate (0–1)
|
|
134
|
+
* **C** = system cost
|
|
135
|
+
* **P** = risk cost (privacy, error, misuse)
|
|
136
|
+
|
|
137
|
+
[
|
|
138
|
+
\text{Memory Value} =
|
|
139
|
+
A \cdot (R + O + \lambda D) - (C + P)
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
If adoption is near zero, value is near zero regardless of intelligence.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### **2. Temporal Truth Resolution**
|
|
147
|
+
|
|
148
|
+
At time **t**:
|
|
149
|
+
|
|
150
|
+
[
|
|
151
|
+
Truth(t) =
|
|
152
|
+
\arg\max_{claims}
|
|
153
|
+
(confidence \times authority(source))
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
subject to:
|
|
157
|
+
|
|
158
|
+
[
|
|
159
|
+
valid_from \le t < valid_to
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
Truth is **time-sliced and source-weighted**.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### **3. Signal-to-Entropy Ratio**
|
|
167
|
+
|
|
168
|
+
[
|
|
169
|
+
SER = \frac{\text{Resolved Decisions}}{\text{Captured Artifacts}}
|
|
170
|
+
]
|
|
171
|
+
|
|
172
|
+
Healthy systems increase SER over time.
|
|
173
|
+
|
|
174
|
+
Wikis decay. Memory systems must sharpen.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## V. Scale Playbook
|
|
179
|
+
|
|
180
|
+
### **Scale 1: Individual or Tiny Team (1–5)**
|
|
181
|
+
|
|
182
|
+
**Goal:** Stop losing important decisions.
|
|
183
|
+
|
|
184
|
+
**Characteristics**
|
|
185
|
+
|
|
186
|
+
* Low conflict
|
|
187
|
+
* High context sharing
|
|
188
|
+
* Minimal governance
|
|
189
|
+
|
|
190
|
+
**Do**
|
|
191
|
+
|
|
192
|
+
* Capture PRs, LLM sessions, key discussions
|
|
193
|
+
* Distill into:
|
|
194
|
+
|
|
195
|
+
* Decision
|
|
196
|
+
* Learning
|
|
197
|
+
* Open Question
|
|
198
|
+
* Append-only with timestamps
|
|
199
|
+
|
|
200
|
+
**Avoid**
|
|
201
|
+
|
|
202
|
+
* Complex ontologies
|
|
203
|
+
* Automatic resolution
|
|
204
|
+
* Over-structuring
|
|
205
|
+
|
|
206
|
+
**Failure Mode**
|
|
207
|
+
|
|
208
|
+
* Memory becomes a diary, not a tool
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### **Scale 2: Team / Org (5–50)**
|
|
213
|
+
|
|
214
|
+
**Goal:** Prevent contradictions from compounding.
|
|
215
|
+
|
|
216
|
+
**Add**
|
|
217
|
+
|
|
218
|
+
* Supersedes links
|
|
219
|
+
* Decision status (current / superseded / disputed)
|
|
220
|
+
* Authority weighting
|
|
221
|
+
* Policy versioning
|
|
222
|
+
|
|
223
|
+
**Key Question**
|
|
224
|
+
|
|
225
|
+
> “Which belief is currently in force?”
|
|
226
|
+
|
|
227
|
+
**Failure Mode**
|
|
228
|
+
|
|
229
|
+
* Two truths exist and no one knows which one applies
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### **Scale 3: Organization / Enterprise (50+)**
|
|
234
|
+
|
|
235
|
+
**Goal:** Make memory unavoidable.
|
|
236
|
+
|
|
237
|
+
**Add**
|
|
238
|
+
|
|
239
|
+
* Event logs of actions
|
|
240
|
+
* Mandatory capture points
|
|
241
|
+
* Approval instrumentation
|
|
242
|
+
* Audit-friendly traces
|
|
243
|
+
|
|
244
|
+
**Rule**
|
|
245
|
+
|
|
246
|
+
> If it materially affects the business, it must be captured at execution time.
|
|
247
|
+
|
|
248
|
+
**Failure Mode**
|
|
249
|
+
|
|
250
|
+
* Post-hoc archaeology
|
|
251
|
+
* Compliance theater
|
|
252
|
+
* Memory drift between teams
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## VI. What This System Delivers
|
|
257
|
+
|
|
258
|
+
| Recipient | Value |
|
|
259
|
+
| ------------ | ---------------------------------- |
|
|
260
|
+
| Engineers | Less rework, faster onboarding |
|
|
261
|
+
| Product | Clear rationale, fewer regressions |
|
|
262
|
+
| Leadership | Decision continuity |
|
|
263
|
+
| AI agents | Grounded reasoning |
|
|
264
|
+
| Organization | Institutional durability |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## VII. The North Star Question
|
|
269
|
+
|
|
270
|
+
Every org-memory system must answer, clearly and reliably:
|
|
271
|
+
|
|
272
|
+
> **“Why are we the way we are right now?”**
|
|
273
|
+
|
|
274
|
+
If it cannot answer that question:
|
|
275
|
+
|
|
276
|
+
* confidently
|
|
277
|
+
* temporally
|
|
278
|
+
* with provenance
|
|
279
|
+
|
|
280
|
+
…it is not memory.
|
|
281
|
+
It is storage wearing a lab coat.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## VIII. Final Reduction
|
|
286
|
+
|
|
287
|
+
If all of this collapses into one sentence:
|
|
288
|
+
|
|
289
|
+
> **Organizational memory exists to preserve decision-quality across time, scale, and personnel change.**
|
|
290
|
+
|
|
291
|
+
Everything else is implementation detail.
|