memgrid 0.5.0 → 0.5.1
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.
- package/CHANGELOG.md +88 -80
- package/LICENSE +21 -21
- package/README.md +251 -251
- package/dist/learn/index.d.ts.map +1 -1
- package/dist/learn/index.js +28 -9
- package/dist/learn/index.js.map +1 -1
- package/dist/memgrid.d.ts.map +1 -1
- package/dist/memgrid.js +39 -6
- package/dist/memgrid.js.map +1 -1
- package/dist/retrieve/index.d.ts +1 -1
- package/dist/retrieve/index.d.ts.map +1 -1
- package/dist/retrieve/index.js +17 -13
- package/dist/retrieve/index.js.map +1 -1
- package/dist/retrieve/semantic.d.ts.map +1 -1
- package/dist/retrieve/semantic.js +9 -7
- package/dist/retrieve/semantic.js.map +1 -1
- package/dist/scanner/composite.d.ts.map +1 -1
- package/dist/scanner/composite.js +1 -3
- package/dist/scanner/composite.js.map +1 -1
- package/dist/scanner/config.d.ts.map +1 -1
- package/dist/scanner/config.js +30 -8
- package/dist/scanner/config.js.map +1 -1
- package/dist/scanner/golang.d.ts.map +1 -1
- package/dist/scanner/golang.js +11 -6
- package/dist/scanner/golang.js.map +1 -1
- package/dist/scanner/javascript.d.ts.map +1 -1
- package/dist/scanner/javascript.js +9 -5
- package/dist/scanner/javascript.js.map +1 -1
- package/dist/scanner/markdown.d.ts.map +1 -1
- package/dist/scanner/markdown.js +8 -3
- package/dist/scanner/markdown.js.map +1 -1
- package/dist/scanner/python.d.ts.map +1 -1
- package/dist/scanner/python.js +7 -3
- package/dist/scanner/python.js.map +1 -1
- package/dist/scanner/rules.d.ts.map +1 -1
- package/dist/scanner/rules.js +17 -3
- package/dist/scanner/rules.js.map +1 -1
- package/dist/scanner/rust.d.ts.map +1 -1
- package/dist/scanner/rust.js +4 -2
- package/dist/scanner/rust.js.map +1 -1
- package/dist/scanner/sync.d.ts +50 -0
- package/dist/scanner/sync.d.ts.map +1 -0
- package/dist/scanner/sync.js +384 -0
- package/dist/scanner/sync.js.map +1 -0
- package/dist/scanner/typescript.d.ts.map +1 -1
- package/dist/scanner/typescript.js +93 -17
- package/dist/scanner/typescript.js.map +1 -1
- package/dist/serve/cli.js +1 -1
- package/dist/serve/mcp-server.d.ts.map +1 -1
- package/dist/serve/mcp-server.js +27 -9
- package/dist/serve/mcp-server.js.map +1 -1
- package/dist/store/file-store.d.ts +5 -0
- package/dist/store/file-store.d.ts.map +1 -1
- package/dist/store/file-store.js +36 -8
- package/dist/store/file-store.js.map +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +64 -23
- package/dist/sync/index.js.map +1 -1
- package/package.json +64 -51
package/README.md
CHANGED
|
@@ -1,251 +1,251 @@
|
|
|
1
|
-
# MemGrid
|
|
2
|
-
|
|
3
|
-
> Project-level semantic memory for AI coding agents. Replaces full-codebase context loading with a self-evolving knowledge-mesh.
|
|
4
|
-
|
|
5
|
-
## 🧠 What is MemGrid?
|
|
6
|
-
|
|
7
|
-
MemGrid builds a **memory mesh** of your project — not as flat documents, but as interconnected **knowledge units**. Each unit represents one thing: a method, a component, a design pattern, a bug fix, a coding style preference, or a tooling rule.
|
|
8
|
-
|
|
9
|
-
When an AI coding agent starts a task, instead of dumping your entire codebase into context, MemGrid retrieves only the relevant units — and traverses their associations to pull in related context.
|
|
10
|
-
|
|
11
|
-
Think of it as **your project's persistent brain** that gets sharper with every task.
|
|
12
|
-
|
|
13
|
-
## 🎯 The Problem
|
|
14
|
-
|
|
15
|
-
AI coding tools today face a context dilemma:
|
|
16
|
-
|
|
17
|
-
- Load the whole project → massive token waste, slow responses, OOM
|
|
18
|
-
- Load only open files → no context, generic output, repeated mistakes
|
|
19
|
-
- Start fresh every session → no learning, inconsistent style
|
|
20
|
-
|
|
21
|
-
MemGrid solves this by giving the agent exactly what it needs, nothing it doesn't.
|
|
22
|
-
|
|
23
|
-
## 📐 Architecture
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
┌─────────────────────────────────────────┐
|
|
27
|
-
│ MemGrid (Agent Brain) │
|
|
28
|
-
│ │
|
|
29
|
-
│ ┌────────────────────────────────────┐ │
|
|
30
|
-
│ │ Scheduler Layer (Meta-Cognition) │ │
|
|
31
|
-
│ │ skill_trigger / mcp_trigger │ │
|
|
32
|
-
│ │ rule_trigger │ │
|
|
33
|
-
│ │ "What tool for what task" │ │
|
|
34
|
-
│ └──────────┬─────────────────────────┘ │
|
|
35
|
-
│ │ drives │
|
|
36
|
-
│ ┌──────────▼─────────────────────────┐ │
|
|
37
|
-
│ │ Knowledge Layer (Semantics) │ │
|
|
38
|
-
│ │ method / component / pattern │ │
|
|
39
|
-
│ │ config / error_solution │ │
|
|
40
|
-
│ │ "What this project is" │ │
|
|
41
|
-
│ └──────────┬─────────────────────────┘ │
|
|
42
|
-
│ │ shapes │
|
|
43
|
-
│ ┌──────────▼─────────────────────────┐ │
|
|
44
|
-
│ │ Style Layer (Your DNA) │ │
|
|
45
|
-
│ │ style_preference │ │
|
|
46
|
-
│ │ architecture_principle │ │
|
|
47
|
-
│ │ decision (why we did this) │ │
|
|
48
|
-
│ │ "What your code looks like" │ │
|
|
49
|
-
│ └────────────────────────────────────┘ │
|
|
50
|
-
└─────────────────────────────────────────┘
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 🚀 Quick Start
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npm install -g memgrid
|
|
57
|
-
# or
|
|
58
|
-
pnpm add -g memgrid
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Initialize
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
cd your-project
|
|
65
|
-
memgrid init
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
MemGrid auto-detects your project's languages and scans all relevant source files.
|
|
69
|
-
|
|
70
|
-
**Supported languages:** TypeScript, JavaScript, Python, Go, Rust, and any Markdown documentation.
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Example output for a TypeScript + Markdown + Rules project:
|
|
74
|
-
# 🔍 Scanning project (typescript, markdown, rules, config)...
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The grid is stored in `.claude/memory-grid/`.
|
|
78
|
-
|
|
79
|
-
### Search
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# Hybrid search (keyword + semantic, configurable weight)
|
|
83
|
-
memgrid search "add file upload to creation endpoint"
|
|
84
|
-
|
|
85
|
-
# With options
|
|
86
|
-
memgrid search "error handling pattern" --semantic 0.6 --max 5 --hops 2
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Incremental Sync
|
|
90
|
-
|
|
91
|
-
Fast sync after code changes — only re-scans changed files:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
memgrid sync
|
|
95
|
-
# Output:
|
|
96
|
-
# 📁 Changed files: 3
|
|
97
|
-
# 🗑️ Removed files: 0
|
|
98
|
-
# 📝 Updated units: 12
|
|
99
|
-
# ⚠️ Stale units: 0
|
|
100
|
-
# 🔗 Repaired links: 2
|
|
101
|
-
# ⏱️ Done in 1834ms
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Add Custom Units
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
memgrid add \
|
|
108
|
-
--type decision \
|
|
109
|
-
--summary "Why we chose PostgreSQL over MongoDB" \
|
|
110
|
-
--description "ACID compliance for financial data, team expertise, $REASON" \
|
|
111
|
-
--file docs/decisions/database.md
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Stats
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
memgrid stats
|
|
118
|
-
# 📊 MemGrid Statistics
|
|
119
|
-
# Total units: 150
|
|
120
|
-
# Active: 142
|
|
121
|
-
# Archived: 8
|
|
122
|
-
# Last scan: 2026-06-28T10:00:00.000Z
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### MCP Server
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
memgrid serve
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Exposes MemGrid as an MCP tool — plug into Claude Desktop, VS Code, or any MCP-compatible agent.
|
|
132
|
-
|
|
133
|
-
## 📦 Memory Unit Types
|
|
134
|
-
|
|
135
|
-
| Type | What it stores | Example |
|
|
136
|
-
|------|---------------|---------|
|
|
137
|
-
| `method` | A function/class method | `CreationDomainService.create()` |
|
|
138
|
-
| `component` | A UI component | `CreationCard` |
|
|
139
|
-
| `pattern` | Design pattern or convention | ResponseBuilder chain pattern |
|
|
140
|
-
| `config` | Configuration/env | Docker services, tech stack |
|
|
141
|
-
| `error_solution` | A bug + how it was fixed | "GLM OOM → switch to DeepSeek" |
|
|
142
|
-
| `decision` | A code decision + rationale | "Why delete returns true, not null" |
|
|
143
|
-
| `skill_trigger` | When to use which skill | "Figma work → enable chakra MCP" |
|
|
144
|
-
| `mcp_trigger` | When to call which MCP | "New Chakra component → get_component_example" |
|
|
145
|
-
| `rule_trigger` | When to load which rule | "Server code → load coding-philosophy" |
|
|
146
|
-
| `style_preference` | Your coding style | "functional pipes over for-loops" |
|
|
147
|
-
| `architecture_principle` | Architecture red lines | "Controller never calls Repository directly" |
|
|
148
|
-
|
|
149
|
-
## 🆚 vs Alternatives
|
|
150
|
-
|
|
151
|
-
| | Claude Auto Memory | Mem0 | Cursor Indexing | **MemGrid** |
|
|
152
|
-
|---|---|---|---|---|
|
|
153
|
-
| Granularity | Documents | Conversations | Files | **Knowledge units** |
|
|
154
|
-
| Structure | Flat text | Flat | File tree | **Mesh (graph)** |
|
|
155
|
-
| Retrieval | Full load | Semantic | Semantic | **Hybrid + Traverse** |
|
|
156
|
-
| Learning | Linear append | None | None | **Post-task self-evolution** |
|
|
157
|
-
| Incremental sync | No | No | Full re-index | **Hash-diff incremental** |
|
|
158
|
-
| Tool-aware | No | No | No | **Trigger units** |
|
|
159
|
-
| Style-aware | Rules only | No | No | **Style layer** |
|
|
160
|
-
|
|
161
|
-
## 📊 Performance
|
|
162
|
-
|
|
163
|
-
| Scenario | Time |
|
|
164
|
-
|----------|------|
|
|
165
|
-
| Search (keyword) | < 3ms |
|
|
166
|
-
| Search (repeated, LRU) | 0ms |
|
|
167
|
-
| Sync (0 changes) | ~5ms |
|
|
168
|
-
| Sync (1 file changed) | ~2s |
|
|
169
|
-
| Full init (150 units) | ~10s |
|
|
170
|
-
|
|
171
|
-
## 📁 File Format
|
|
172
|
-
|
|
173
|
-
Memory units are stored as JSON in `.claude/memory-grid/units/` — **Git-friendly and human-readable**.
|
|
174
|
-
|
|
175
|
-
```json
|
|
176
|
-
{
|
|
177
|
-
"id": "method_creation_create",
|
|
178
|
-
"type": "method",
|
|
179
|
-
"summary": "CreationDomainService.create — Create a new work",
|
|
180
|
-
"source": {
|
|
181
|
-
"file": "apps/server/src/creation/creation.domain-service.ts",
|
|
182
|
-
"lines": "45-67"
|
|
183
|
-
},
|
|
184
|
-
"signatures": ["CreationDomainService.create"],
|
|
185
|
-
"content": {
|
|
186
|
-
"description": "Creates a new work, verifies ownership, saves to DB",
|
|
187
|
-
"inputs": "userId: string, dto: Partial<CreationEntity>",
|
|
188
|
-
"outputs": "ApiResponse{ value: savedEntity }"
|
|
189
|
-
},
|
|
190
|
-
"associations": [
|
|
191
|
-
{
|
|
192
|
-
"to": "pattern_response_builder",
|
|
193
|
-
"relation": "implements_pattern",
|
|
194
|
-
"weight": 0.9
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
"meta": {
|
|
198
|
-
"created": "2026-06-28T00:00:00.000Z",
|
|
199
|
-
"updated": "2026-06-28T00:00:00.000Z",
|
|
200
|
-
"confidence": 0.8,
|
|
201
|
-
"usage_count": 0,
|
|
202
|
-
"status": "active"
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
`mesh.json` stores the grid metadata including `fileSnapshot` for incremental sync and `edgeIndex` for fast association traversal.
|
|
208
|
-
|
|
209
|
-
## 🌐 Language Support
|
|
210
|
-
|
|
211
|
-
MemGrid is **language-agnostic** at its core. Scanners are swappable plugins:
|
|
212
|
-
|
|
213
|
-
| Scanner | Detects | Extracts |
|
|
214
|
-
|---------|---------|----------|
|
|
215
|
-
| **TypeScript** | `tsconfig.json`, `.ts` files | Classes, methods, exported functions (AST via ts-morph) |
|
|
216
|
-
| **JavaScript** | `package.json` (no tsconfig), `.js` files | Exported functions, classes, arrow functions (regex) |
|
|
217
|
-
| **Python** | `pyproject.toml`, `.py` files | Functions, classes, decorators, docstrings (regex) |
|
|
218
|
-
| **Go** | `go.mod`, `.go` files | Functions, methods, structs, interfaces (regex) |
|
|
219
|
-
| **Rust** | `Cargo.toml`, `.rs` files | Functions, structs, enums, traits, impl blocks (regex) |
|
|
220
|
-
| **Markdown** | Any `.md` files | Headings as knowledge units |
|
|
221
|
-
| **Rules** | `.claude/rules/*.md` | Design patterns, coding rules, trigger units |
|
|
222
|
-
| **Config** | `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `docker-compose.yml` | Tech stack, dependencies, infrastructure |
|
|
223
|
-
|
|
224
|
-
**Adding a new language** means implementing the `Scanner` interface — the core engine (storage, retrieval, learning, sync) stays untouched.
|
|
225
|
-
|
|
226
|
-
```typescript
|
|
227
|
-
// src/scanner/python.ts (example)
|
|
228
|
-
export class PythonScanner implements Scanner {
|
|
229
|
-
readonly name = 'python';
|
|
230
|
-
detect(projectRoot: string): boolean { ... }
|
|
231
|
-
async scan(options: ScanOptions): Promise<MemoryUnit[]> { ... }
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## 🔌 Integration
|
|
236
|
-
|
|
237
|
-
MemGrid outputs **standardized Markdown context** consumable by any AI coding tool:
|
|
238
|
-
|
|
239
|
-
- **Claude Code** — via MCP Server or Hook
|
|
240
|
-
- **Cursor / Windsurf** — via Rules file injection
|
|
241
|
-
- **GitHub Copilot** — via `.github/copilot-instructions.md`
|
|
242
|
-
- **Aider / Cline / Continue** — via custom prompt templates
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
# Start MCP Server
|
|
246
|
-
memgrid serve
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## License
|
|
250
|
-
|
|
251
|
-
MIT
|
|
1
|
+
# MemGrid
|
|
2
|
+
|
|
3
|
+
> Project-level semantic memory for AI coding agents. Replaces full-codebase context loading with a self-evolving knowledge-mesh.
|
|
4
|
+
|
|
5
|
+
## 🧠 What is MemGrid?
|
|
6
|
+
|
|
7
|
+
MemGrid builds a **memory mesh** of your project — not as flat documents, but as interconnected **knowledge units**. Each unit represents one thing: a method, a component, a design pattern, a bug fix, a coding style preference, or a tooling rule.
|
|
8
|
+
|
|
9
|
+
When an AI coding agent starts a task, instead of dumping your entire codebase into context, MemGrid retrieves only the relevant units — and traverses their associations to pull in related context.
|
|
10
|
+
|
|
11
|
+
Think of it as **your project's persistent brain** that gets sharper with every task.
|
|
12
|
+
|
|
13
|
+
## 🎯 The Problem
|
|
14
|
+
|
|
15
|
+
AI coding tools today face a context dilemma:
|
|
16
|
+
|
|
17
|
+
- Load the whole project → massive token waste, slow responses, OOM
|
|
18
|
+
- Load only open files → no context, generic output, repeated mistakes
|
|
19
|
+
- Start fresh every session → no learning, inconsistent style
|
|
20
|
+
|
|
21
|
+
MemGrid solves this by giving the agent exactly what it needs, nothing it doesn't.
|
|
22
|
+
|
|
23
|
+
## 📐 Architecture
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
┌─────────────────────────────────────────┐
|
|
27
|
+
│ MemGrid (Agent Brain) │
|
|
28
|
+
│ │
|
|
29
|
+
│ ┌────────────────────────────────────┐ │
|
|
30
|
+
│ │ Scheduler Layer (Meta-Cognition) │ │
|
|
31
|
+
│ │ skill_trigger / mcp_trigger │ │
|
|
32
|
+
│ │ rule_trigger │ │
|
|
33
|
+
│ │ "What tool for what task" │ │
|
|
34
|
+
│ └──────────┬─────────────────────────┘ │
|
|
35
|
+
│ │ drives │
|
|
36
|
+
│ ┌──────────▼─────────────────────────┐ │
|
|
37
|
+
│ │ Knowledge Layer (Semantics) │ │
|
|
38
|
+
│ │ method / component / pattern │ │
|
|
39
|
+
│ │ config / error_solution │ │
|
|
40
|
+
│ │ "What this project is" │ │
|
|
41
|
+
│ └──────────┬─────────────────────────┘ │
|
|
42
|
+
│ │ shapes │
|
|
43
|
+
│ ┌──────────▼─────────────────────────┐ │
|
|
44
|
+
│ │ Style Layer (Your DNA) │ │
|
|
45
|
+
│ │ style_preference │ │
|
|
46
|
+
│ │ architecture_principle │ │
|
|
47
|
+
│ │ decision (why we did this) │ │
|
|
48
|
+
│ │ "What your code looks like" │ │
|
|
49
|
+
│ └────────────────────────────────────┘ │
|
|
50
|
+
└─────────────────────────────────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 🚀 Quick Start
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g memgrid
|
|
57
|
+
# or
|
|
58
|
+
pnpm add -g memgrid
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Initialize
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
cd your-project
|
|
65
|
+
memgrid init
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
MemGrid auto-detects your project's languages and scans all relevant source files.
|
|
69
|
+
|
|
70
|
+
**Supported languages:** TypeScript, JavaScript, Python, Go, Rust, and any Markdown documentation.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Example output for a TypeScript + Markdown + Rules project:
|
|
74
|
+
# 🔍 Scanning project (typescript, markdown, rules, config)...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The grid is stored in `.claude/memory-grid/`.
|
|
78
|
+
|
|
79
|
+
### Search
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Hybrid search (keyword + semantic, configurable weight)
|
|
83
|
+
memgrid search "add file upload to creation endpoint"
|
|
84
|
+
|
|
85
|
+
# With options
|
|
86
|
+
memgrid search "error handling pattern" --semantic 0.6 --max 5 --hops 2
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Incremental Sync
|
|
90
|
+
|
|
91
|
+
Fast sync after code changes — only re-scans changed files:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
memgrid sync
|
|
95
|
+
# Output:
|
|
96
|
+
# 📁 Changed files: 3
|
|
97
|
+
# 🗑️ Removed files: 0
|
|
98
|
+
# 📝 Updated units: 12
|
|
99
|
+
# ⚠️ Stale units: 0
|
|
100
|
+
# 🔗 Repaired links: 2
|
|
101
|
+
# ⏱️ Done in 1834ms
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Add Custom Units
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
memgrid add \
|
|
108
|
+
--type decision \
|
|
109
|
+
--summary "Why we chose PostgreSQL over MongoDB" \
|
|
110
|
+
--description "ACID compliance for financial data, team expertise, $REASON" \
|
|
111
|
+
--file docs/decisions/database.md
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Stats
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
memgrid stats
|
|
118
|
+
# 📊 MemGrid Statistics
|
|
119
|
+
# Total units: 150
|
|
120
|
+
# Active: 142
|
|
121
|
+
# Archived: 8
|
|
122
|
+
# Last scan: 2026-06-28T10:00:00.000Z
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### MCP Server
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
memgrid serve
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Exposes MemGrid as an MCP tool — plug into Claude Desktop, VS Code, or any MCP-compatible agent.
|
|
132
|
+
|
|
133
|
+
## 📦 Memory Unit Types
|
|
134
|
+
|
|
135
|
+
| Type | What it stores | Example |
|
|
136
|
+
|------|---------------|---------|
|
|
137
|
+
| `method` | A function/class method | `CreationDomainService.create()` |
|
|
138
|
+
| `component` | A UI component | `CreationCard` |
|
|
139
|
+
| `pattern` | Design pattern or convention | ResponseBuilder chain pattern |
|
|
140
|
+
| `config` | Configuration/env | Docker services, tech stack |
|
|
141
|
+
| `error_solution` | A bug + how it was fixed | "GLM OOM → switch to DeepSeek" |
|
|
142
|
+
| `decision` | A code decision + rationale | "Why delete returns true, not null" |
|
|
143
|
+
| `skill_trigger` | When to use which skill | "Figma work → enable chakra MCP" |
|
|
144
|
+
| `mcp_trigger` | When to call which MCP | "New Chakra component → get_component_example" |
|
|
145
|
+
| `rule_trigger` | When to load which rule | "Server code → load coding-philosophy" |
|
|
146
|
+
| `style_preference` | Your coding style | "functional pipes over for-loops" |
|
|
147
|
+
| `architecture_principle` | Architecture red lines | "Controller never calls Repository directly" |
|
|
148
|
+
|
|
149
|
+
## 🆚 vs Alternatives
|
|
150
|
+
|
|
151
|
+
| | Claude Auto Memory | Mem0 | Cursor Indexing | **MemGrid** |
|
|
152
|
+
|---|---|---|---|---|
|
|
153
|
+
| Granularity | Documents | Conversations | Files | **Knowledge units** |
|
|
154
|
+
| Structure | Flat text | Flat | File tree | **Mesh (graph)** |
|
|
155
|
+
| Retrieval | Full load | Semantic | Semantic | **Hybrid + Traverse** |
|
|
156
|
+
| Learning | Linear append | None | None | **Post-task self-evolution** |
|
|
157
|
+
| Incremental sync | No | No | Full re-index | **Hash-diff incremental** |
|
|
158
|
+
| Tool-aware | No | No | No | **Trigger units** |
|
|
159
|
+
| Style-aware | Rules only | No | No | **Style layer** |
|
|
160
|
+
|
|
161
|
+
## 📊 Performance
|
|
162
|
+
|
|
163
|
+
| Scenario | Time |
|
|
164
|
+
|----------|------|
|
|
165
|
+
| Search (keyword) | < 3ms |
|
|
166
|
+
| Search (repeated, LRU) | 0ms |
|
|
167
|
+
| Sync (0 changes) | ~5ms |
|
|
168
|
+
| Sync (1 file changed) | ~2s |
|
|
169
|
+
| Full init (150 units) | ~10s |
|
|
170
|
+
|
|
171
|
+
## 📁 File Format
|
|
172
|
+
|
|
173
|
+
Memory units are stored as JSON in `.claude/memory-grid/units/` — **Git-friendly and human-readable**.
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"id": "method_creation_create",
|
|
178
|
+
"type": "method",
|
|
179
|
+
"summary": "CreationDomainService.create — Create a new work",
|
|
180
|
+
"source": {
|
|
181
|
+
"file": "apps/server/src/creation/creation.domain-service.ts",
|
|
182
|
+
"lines": "45-67"
|
|
183
|
+
},
|
|
184
|
+
"signatures": ["CreationDomainService.create"],
|
|
185
|
+
"content": {
|
|
186
|
+
"description": "Creates a new work, verifies ownership, saves to DB",
|
|
187
|
+
"inputs": "userId: string, dto: Partial<CreationEntity>",
|
|
188
|
+
"outputs": "ApiResponse{ value: savedEntity }"
|
|
189
|
+
},
|
|
190
|
+
"associations": [
|
|
191
|
+
{
|
|
192
|
+
"to": "pattern_response_builder",
|
|
193
|
+
"relation": "implements_pattern",
|
|
194
|
+
"weight": 0.9
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"meta": {
|
|
198
|
+
"created": "2026-06-28T00:00:00.000Z",
|
|
199
|
+
"updated": "2026-06-28T00:00:00.000Z",
|
|
200
|
+
"confidence": 0.8,
|
|
201
|
+
"usage_count": 0,
|
|
202
|
+
"status": "active"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`mesh.json` stores the grid metadata including `fileSnapshot` for incremental sync and `edgeIndex` for fast association traversal.
|
|
208
|
+
|
|
209
|
+
## 🌐 Language Support
|
|
210
|
+
|
|
211
|
+
MemGrid is **language-agnostic** at its core. Scanners are swappable plugins:
|
|
212
|
+
|
|
213
|
+
| Scanner | Detects | Extracts |
|
|
214
|
+
|---------|---------|----------|
|
|
215
|
+
| **TypeScript** | `tsconfig.json`, `.ts` files | Classes, methods, exported functions (AST via ts-morph) |
|
|
216
|
+
| **JavaScript** | `package.json` (no tsconfig), `.js` files | Exported functions, classes, arrow functions (regex) |
|
|
217
|
+
| **Python** | `pyproject.toml`, `.py` files | Functions, classes, decorators, docstrings (regex) |
|
|
218
|
+
| **Go** | `go.mod`, `.go` files | Functions, methods, structs, interfaces (regex) |
|
|
219
|
+
| **Rust** | `Cargo.toml`, `.rs` files | Functions, structs, enums, traits, impl blocks (regex) |
|
|
220
|
+
| **Markdown** | Any `.md` files | Headings as knowledge units |
|
|
221
|
+
| **Rules** | `.claude/rules/*.md` | Design patterns, coding rules, trigger units |
|
|
222
|
+
| **Config** | `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `docker-compose.yml` | Tech stack, dependencies, infrastructure |
|
|
223
|
+
|
|
224
|
+
**Adding a new language** means implementing the `Scanner` interface — the core engine (storage, retrieval, learning, sync) stays untouched.
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
// src/scanner/python.ts (example)
|
|
228
|
+
export class PythonScanner implements Scanner {
|
|
229
|
+
readonly name = 'python';
|
|
230
|
+
detect(projectRoot: string): boolean { ... }
|
|
231
|
+
async scan(options: ScanOptions): Promise<MemoryUnit[]> { ... }
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## 🔌 Integration
|
|
236
|
+
|
|
237
|
+
MemGrid outputs **standardized Markdown context** consumable by any AI coding tool:
|
|
238
|
+
|
|
239
|
+
- **Claude Code** — via MCP Server or Hook
|
|
240
|
+
- **Cursor / Windsurf** — via Rules file injection
|
|
241
|
+
- **GitHub Copilot** — via `.github/copilot-instructions.md`
|
|
242
|
+
- **Aider / Cline / Continue** — via custom prompt templates
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Start MCP Server
|
|
246
|
+
memgrid serve
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/learn/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAw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ChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3B,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;KAAE,EAAE,CAAC;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,QAAQ,CAAiB;gBAErB,KAAK,EAAE,SAAS;IAK5B;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyI7D;;;OAGG;IACG,KAAK,CAAC,WAAW,EAAE,mBAAmB,EAAE,aAAa,SAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkDrF;;OAEG;IACH,iBAAiB,CAAC,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAgC3D;;OAEG;IACH,OAAO,CAAC,WAAW;CAyCpB"}
|
package/dist/learn/index.js
CHANGED
|
@@ -21,9 +21,7 @@ export class LearnEngine {
|
|
|
21
21
|
// 1. Suggest new method units for modified files
|
|
22
22
|
if (task.filesModified.length > 0) {
|
|
23
23
|
const existingUnits = await this.store.listUnits();
|
|
24
|
-
const existingFiles = new Set(existingUnits
|
|
25
|
-
.filter((u) => u.source?.file)
|
|
26
|
-
.map((u) => u.source.file));
|
|
24
|
+
const existingFiles = new Set(existingUnits.filter((u) => u.source?.file).map((u) => u.source.file));
|
|
27
25
|
const newFiles = task.filesModified.filter((f) => !existingFiles.has(f));
|
|
28
26
|
if (newFiles.length > 0) {
|
|
29
27
|
summaries.push(`🆕 ${newFiles.length} new files to scan`);
|
|
@@ -215,12 +213,33 @@ export class LearnEngine {
|
|
|
215
213
|
*/
|
|
216
214
|
inferDomain(summary) {
|
|
217
215
|
const domains = {
|
|
218
|
-
'server code': [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
'server code': [
|
|
217
|
+
'server',
|
|
218
|
+
'api',
|
|
219
|
+
'controller',
|
|
220
|
+
'service',
|
|
221
|
+
'nest',
|
|
222
|
+
'typeorm',
|
|
223
|
+
'postgres',
|
|
224
|
+
'database',
|
|
225
|
+
'auth',
|
|
226
|
+
],
|
|
227
|
+
frontend: [
|
|
228
|
+
'web',
|
|
229
|
+
'ui',
|
|
230
|
+
'component',
|
|
231
|
+
'page',
|
|
232
|
+
'chakra',
|
|
233
|
+
'react',
|
|
234
|
+
'next',
|
|
235
|
+
'figma',
|
|
236
|
+
'style',
|
|
237
|
+
'css',
|
|
238
|
+
],
|
|
239
|
+
config: ['config', 'env', 'docker', 'ci', 'deploy', 'package'],
|
|
240
|
+
review: ['pr', 'review', 'merge', 'branch'],
|
|
241
|
+
docs: ['docs', 'readme', 'documentation'],
|
|
242
|
+
memory: ['memory', 'grid', 'atom'],
|
|
224
243
|
};
|
|
225
244
|
const lower = summary.toLowerCase();
|
|
226
245
|
for (const [domain, keywords] of Object.entries(domains)) {
|
package/dist/learn/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/learn/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAmBtD,MAAM,OAAO,WAAW;IACd,KAAK,CAAY;IACjB,QAAQ,CAAiB;IAEjC,YAAY,KAAgB;QAC1B,IAAI,CAAC,KA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;;OAEG;IACK,WAAW,CAAC,OAAe;QACjC,MAAM,OAAO,GAA6B;YACxC,aAAa,EAAE;gBACb,QAAQ;gBACR,KAAK;gBACL,YAAY;gBACZ,SAAS;gBACT,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;gBACV,MAAM;aACP;YACD,QAAQ,EAAE;gBACR,KAAK;gBACL,IAAI;gBACJ,WAAW;gBACX,MAAM;gBACN,QAAQ;gBACR,OAAO;gBACP,MAAM;gBACN,OAAO;gBACP,OAAO;gBACP,KAAK;aACN;YACD,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC;YAC9D,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;YAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;YACzC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SACnC,CAAC;QAEF,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAEpC,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACzD,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5C,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,2BAA2B,CAAC;IACrC,CAAC;CACF"}
|
package/dist/memgrid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memgrid.d.ts","sourceRoot":"","sources":["../src/memgrid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"memgrid.d.ts","sourceRoot":"","sources":["../src/memgrid.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