engramx 0.1.1 → 0.2.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/README.md +57 -7
- package/dist/{chunk-44GN6IRQ.js → chunk-22ADJYQ5.js} +443 -25
- package/dist/chunk-YQ3FPGPC.js +361 -0
- package/dist/cli.js +57 -9
- package/dist/{core-M5N34VUU.js → core-HWOM7GSU.js} +3 -1
- package/dist/index.js +15 -3
- package/dist/serve.js +65 -12
- package/package.json +1 -1
- package/dist/chunk-WJUA4VZ7.js +0 -247
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<a href="#usage"><strong>Usage</strong></a> ·
|
|
8
8
|
<a href="#mcp-server"><strong>MCP Server</strong></a> ·
|
|
9
9
|
<a href="#how-it-works"><strong>How It Works</strong></a> ·
|
|
10
|
+
<a href="docs/INTEGRATION.md"><strong>Integration Guide</strong></a> ·
|
|
10
11
|
<a href="#contributing"><strong>Contributing</strong></a>
|
|
11
12
|
</p>
|
|
12
13
|
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
<a href="https://github.com/NickCirv/engram/actions"><img src="https://github.com/NickCirv/engram/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
15
16
|
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License">
|
|
16
17
|
<img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node">
|
|
17
|
-
<img src="https://img.shields.io/badge/tests-
|
|
18
|
+
<img src="https://img.shields.io/badge/tests-132%20passing-brightgreen" alt="Tests">
|
|
18
19
|
<img src="https://img.shields.io/badge/LLM%20cost-$0-green" alt="Zero LLM cost">
|
|
19
20
|
<img src="https://img.shields.io/badge/native%20deps-zero-green" alt="Zero native deps">
|
|
20
21
|
</p>
|
|
@@ -46,22 +47,24 @@ npx engram init
|
|
|
46
47
|
|
|
47
48
|
Every AI coding session starts from zero. Claude Code re-reads your files. Cursor reindexes. Copilot has no memory. CLAUDE.md is a sticky note you write by hand.
|
|
48
49
|
|
|
49
|
-
engram fixes this with
|
|
50
|
+
engram fixes this with five things no other tool combines:
|
|
50
51
|
|
|
51
52
|
1. **Persistent knowledge graph** — survives across sessions, stored in `.engram/graph.db`
|
|
52
53
|
2. **Learns from every session** — decisions, patterns, mistakes are extracted and remembered
|
|
53
54
|
3. **Universal protocol** — MCP server + CLI + auto-generates CLAUDE.md, .cursorrules, AGENTS.md
|
|
55
|
+
4. **Skill-aware** (v0.2) — indexes your `~/.claude/skills/` directory into the graph so queries return code *and* the skill to apply
|
|
56
|
+
5. **Regret buffer** (v0.2) — surfaces past mistakes at the top of query results so your AI stops re-making the same wrong turns
|
|
54
57
|
|
|
55
58
|
## Install
|
|
56
59
|
|
|
57
60
|
```bash
|
|
58
|
-
npx
|
|
61
|
+
npx engramx init
|
|
59
62
|
```
|
|
60
63
|
|
|
61
64
|
Or install globally:
|
|
62
65
|
|
|
63
66
|
```bash
|
|
64
|
-
npm install -g
|
|
67
|
+
npm install -g engramx
|
|
65
68
|
engram init
|
|
66
69
|
```
|
|
67
70
|
|
|
@@ -71,6 +74,7 @@ Requires Node.js 20+. Zero native dependencies. No build tools needed.
|
|
|
71
74
|
|
|
72
75
|
```bash
|
|
73
76
|
engram init [path] # Scan codebase, build knowledge graph
|
|
77
|
+
engram init --with-skills # Also index ~/.claude/skills/ (v0.2)
|
|
74
78
|
engram query "how does auth" # Query the graph (BFS, token-budgeted)
|
|
75
79
|
engram query "auth" --dfs # DFS traversal (trace specific paths)
|
|
76
80
|
engram gods # Show most connected entities
|
|
@@ -78,7 +82,9 @@ engram stats # Node/edge counts, token savings
|
|
|
78
82
|
engram bench # Token reduction benchmark
|
|
79
83
|
engram path "auth" "database" # Shortest path between concepts
|
|
80
84
|
engram learn "chose JWT..." # Teach a decision or pattern
|
|
85
|
+
engram mistakes # List known mistakes (v0.2)
|
|
81
86
|
engram gen # Generate CLAUDE.md section from graph
|
|
87
|
+
engram gen --task bug-fix # Task-aware view (v0.2: general|bug-fix|feature|refactor)
|
|
82
88
|
engram hooks install # Auto-rebuild on git commit
|
|
83
89
|
```
|
|
84
90
|
|
|
@@ -103,7 +109,7 @@ Connect engram to Claude Code, Windsurf, or any MCP client:
|
|
|
103
109
|
"mcpServers": {
|
|
104
110
|
"engram": {
|
|
105
111
|
"command": "npx",
|
|
106
|
-
"args": ["-y", "
|
|
112
|
+
"args": ["-y", "engramx", "serve", "/path/to/your/project"]
|
|
107
113
|
}
|
|
108
114
|
}
|
|
109
115
|
}
|
|
@@ -122,12 +128,24 @@ Or if installed globally:
|
|
|
122
128
|
}
|
|
123
129
|
```
|
|
124
130
|
|
|
125
|
-
**MCP Tools
|
|
131
|
+
**MCP Tools** (6 total):
|
|
126
132
|
- `query_graph` — Search the knowledge graph with natural language
|
|
127
133
|
- `god_nodes` — Core abstractions (most connected entities)
|
|
128
134
|
- `graph_stats` — Node/edge counts, confidence breakdown
|
|
129
135
|
- `shortest_path` — Trace connections between two concepts
|
|
130
136
|
- `benchmark` — Token reduction measurement
|
|
137
|
+
- `list_mistakes` — Known failure modes from past sessions (v0.2)
|
|
138
|
+
|
|
139
|
+
### Shell Wrapper (for Bash-based agents)
|
|
140
|
+
|
|
141
|
+
If your agent stack runs shell commands instead of JSON-RPC MCP, use the reference wrapper at [`scripts/mcp-engram`](scripts/mcp-engram). One command handles all projects via `-p <path>` — no per-project MCP server needed.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
cp scripts/mcp-engram ~/bin/mcp-engram && chmod +x ~/bin/mcp-engram
|
|
145
|
+
mcp-engram query "how does auth work" -p ~/myrepo
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
See [`docs/INTEGRATION.md`](docs/INTEGRATION.md) for multi-machine setups, rule-file integration, and gotchas.
|
|
131
149
|
|
|
132
150
|
## Auto-Generated AI Instructions
|
|
133
151
|
|
|
@@ -142,6 +160,19 @@ engram gen --target agents # Write to AGENTS.md
|
|
|
142
160
|
|
|
143
161
|
This writes a structured codebase summary — god nodes, file structure, key dependencies, decisions — so your AI assistant navigates by structure instead of grepping.
|
|
144
162
|
|
|
163
|
+
### Task-Aware Views (v0.2)
|
|
164
|
+
|
|
165
|
+
`engram gen --task <name>` emits different content based on what you're about to do. The four preset views are defined in `src/autogen.ts` as a data table — no branching logic — so you can add your own task modes without touching the renderer.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
engram gen --task general # default — balanced mix of sections
|
|
169
|
+
engram gen --task bug-fix # emphasizes hot files + past mistakes
|
|
170
|
+
engram gen --task feature # emphasizes architecture + decisions
|
|
171
|
+
engram gen --task refactor # emphasizes god nodes + dependency graph
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Each view picks a different set of sections with different limits. For example, `bug-fix` omits `## Decisions` and `## Key dependencies` entirely (they'd just be noise when you're chasing a regression) and leads with `🔥 Hot files` and `⚠️ Past mistakes`.
|
|
175
|
+
|
|
145
176
|
## How engram Compares
|
|
146
177
|
|
|
147
178
|
| | engram | Mem0 | Graphify | aider repo-map | CLAUDE.md |
|
|
@@ -234,7 +265,26 @@ src/
|
|
|
234
265
|
|
|
235
266
|
TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, Ruby, PHP.
|
|
236
267
|
|
|
237
|
-
|
|
268
|
+
## Roadmap
|
|
269
|
+
|
|
270
|
+
### v0.2 (current) — **shipped April 2026**
|
|
271
|
+
- ✅ Skills miner — index `~/.claude/skills/` into the graph
|
|
272
|
+
- ✅ Adaptive gen — task-aware views (`--task general|bug-fix|feature|refactor`)
|
|
273
|
+
- ✅ Regret buffer — surface past mistakes at the top of query results
|
|
274
|
+
- ✅ `list_mistakes` MCP tool
|
|
275
|
+
- ✅ Atomic init lockfile
|
|
276
|
+
- ✅ Marker-safe `writeToFile` + surrogate-safe truncation
|
|
277
|
+
|
|
278
|
+
### v0.3
|
|
279
|
+
- Tree-sitter WASM (20+ languages with full call-graph precision)
|
|
280
|
+
- Cross-project graph (query patterns across *all* your projects)
|
|
281
|
+
- Temporal graph (commit-snapshot deltas — "what changed in auth this week?")
|
|
282
|
+
- Token enforcement PreToolUse hook for Claude Code
|
|
283
|
+
|
|
284
|
+
### v0.4+
|
|
285
|
+
- LLM-free semantic search (locality-sensitive hashing over n-grams)
|
|
286
|
+
- Graph-as-IR experimental spike
|
|
287
|
+
- Team memory sync (paid tier)
|
|
238
288
|
|
|
239
289
|
## Privacy
|
|
240
290
|
|