kiro-memory 1.6.0 → 1.7.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 CHANGED
@@ -3,7 +3,8 @@
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <strong>Persistent cross-session memory for <a href="https://kiro.dev/">Kiro CLI</a>.</strong>
6
+ <strong>Persistent cross-session memory for AI coding assistants.</strong><br/>
7
+ <em>Works with <a href="https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview">Claude Code</a>, <a href="https://www.cursor.com/">Cursor</a>, <a href="https://codeium.com/windsurf">Windsurf</a>, <a href="https://github.com/cline/cline">Cline</a>, and any MCP-compatible editor.</em>
7
8
  </p>
8
9
 
9
10
  <p align="center">
@@ -14,7 +15,9 @@
14
15
 
15
16
  ---
16
17
 
17
- Kiro Memory gives your Kiro agent memory that persists across sessions. It automatically captures what happened -- files changed, tools used, decisions made -- and feeds relevant context back at the start of the next session. No manual bookkeeping. Your agent picks up exactly where it left off.
18
+ Kiro Memory gives your AI coding assistant memory that persists across sessions. It automatically captures what happened -- files changed, tools used, decisions made -- and feeds relevant context back at the start of the next session. No manual bookkeeping. Your agent picks up exactly where it left off.
19
+
20
+ Works with **Claude Code** (hooks), **Cursor** (rules + MCP), **Windsurf** (rules + MCP), **Cline** (custom instructions + MCP), and any editor that supports the **Model Context Protocol**.
18
21
 
19
22
  ## What Your Agent Sees
20
23
 
@@ -40,13 +43,18 @@ When a new session starts, Kiro Memory automatically injects previous session co
40
43
 
41
44
  ## Features
42
45
 
43
- - **Automatic Context Injection** -- Previous session knowledge injected at agent start via `agentSpawn` hook
44
- - **Prompt Tracking** -- Every user prompt recorded for continuity (`userPromptSubmit` hook)
45
- - **Tool & File Monitoring** -- File writes, command executions, and tool usage captured in real time (`postToolUse` hook)
46
- - **Session Summaries** -- Structured summaries generated when sessions end (`stop` hook)
46
+ - **Multi-Editor Support** -- Works with Claude Code, Cursor, Windsurf, Cline, and any MCP-compatible editor
47
+ - **Automatic Context Injection** -- Previous session knowledge injected at agent start via hooks
48
+ - **Vector Search** -- Local embeddings with semantic similarity search (no API keys required)
49
+ - **Smart Ranking** -- 4-signal scoring (recency, frequency, semantic, decay) for relevance ordering
50
+ - **Memory Decay** -- Automatic stale detection and consolidation of old observations
51
+ - **Structured Knowledge** -- Store architectural decisions, constraints, heuristics, and rejected approaches
52
+ - **Session Checkpoint & Resume** -- Checkpoint sessions and resume from where you left off
53
+ - **Activity Reports** -- Weekly/monthly digests in text, Markdown, or JSON format
54
+ - **Analytics Dashboard** -- Activity timeline, type distribution, session stats, and file hotspots
55
+ - **Session Summaries** -- Structured summaries generated when sessions end
47
56
  - **Web Dashboard** -- Real-time viewer at `http://localhost:3001` with dark/light theme, search, project filters, and live updates via SSE
48
- - **Auto-Start Worker** -- The background worker starts automatically when a Kiro session begins (no manual setup required)
49
- - **MCP Server** -- 4 tools (`search`, `timeline`, `get_observations`, `get_context`) exposed via Model Context Protocol
57
+ - **MCP Server** -- 10 tools exposed via Model Context Protocol
50
58
  - **Full-Text Search** -- SQLite FTS5 for fast, typo-tolerant search across all stored context
51
59
  - **TypeScript SDK** -- Programmatic access to the entire memory system
52
60
  - **CLI** -- Query and manage context directly from the terminal
@@ -57,8 +65,12 @@ When a new session starts, Kiro Memory automatically injects previous session co
57
65
  # Install globally
58
66
  npm install -g kiro-memory
59
67
 
60
- # Install into Kiro CLI (hooks + MCP server + agent config)
61
- kiro-memory install
68
+ # Install for your editor
69
+ kiro-memory install # Auto-detects your editor
70
+ kiro-memory install --claude-code # Claude Code (hooks + MCP)
71
+ kiro-memory install --cursor # Cursor (rules + MCP)
72
+ kiro-memory install --windsurf # Windsurf (rules + MCP)
73
+ kiro-memory install --cline # Cline (instructions + MCP)
62
74
  ```
63
75
 
64
76
  Or from source:
@@ -70,96 +82,71 @@ npm install && npm run build
70
82
  npm run install:kiro
71
83
  ```
72
84
 
73
- ### Start Kiro with memory enabled
85
+ Once installed, the worker auto-starts and the web dashboard is available at `http://localhost:3001`.
74
86
 
75
- Kiro Memory works as a **custom agent**. You must start Kiro with the `--agent` flag:
87
+ ## Editor Integration
76
88
 
77
- ```bash
78
- kiro-cli --agent kiro-memory
79
- ```
89
+ ### Claude Code
80
90
 
81
- > **Why?** Kiro Memory uses hooks (`agentSpawn`, `postToolUse`, `userPromptSubmit`, `stop`) to capture context automatically. Hooks are defined inside the agent configuration, so they only run when the `kiro-memory` agent is active.
91
+ Registers **4 hooks** and an **MCP server** automatically via `kiro-memory install --claude-code`:
82
92
 
83
- To avoid typing the flag every time, add an alias to your shell:
93
+ | Hook | Trigger | Purpose |
94
+ |------|---------|---------|
95
+ | `PreToolUse` | Before tool runs | Injects session context |
96
+ | `PostToolUse` | After tool completes | Captures file writes, commands, research |
97
+ | `Notification` | User sends prompt | Records prompts for continuity |
98
+ | `Stop` | Session ends | Generates structured session summary |
84
99
 
85
- ```bash
86
- # Bash
87
- echo 'alias kiro="kiro-cli --agent kiro-memory"' >> ~/.bashrc && source ~/.bashrc
100
+ ### Cursor / Windsurf / Cline
88
101
 
89
- # Zsh
90
- echo 'alias kiro="kiro-cli --agent kiro-memory"' >> ~/.zshrc && source ~/.zshrc
91
- ```
102
+ For editors without hook support, Kiro Memory uses **rules files** + **MCP server**:
92
103
 
93
- Once running, the worker auto-starts and the web dashboard is available at `http://localhost:3001`.
94
-
95
- ## Kiro Integration
96
-
97
- Kiro Memory registers **4 hooks** and an **MCP server** with Kiro CLI via a custom agent. The agent configuration is installed to `~/.kiro/agents/kiro-memory.json` and is activated with `kiro --agent kiro-memory`:
98
-
99
- ```json
100
- {
101
- "name": "kiro-memory",
102
- "tools": ["read", "write", "shell", "glob", "grep", "@kiro-memory"],
103
- "mcpServers": {
104
- "kiro-memory": {
105
- "command": "node",
106
- "args": ["/path/to/dist/servers/mcp-server.js"]
107
- }
108
- },
109
- "hooks": {
110
- "agentSpawn": [{ "command": "node /path/to/dist/hooks/agentSpawn.js" }],
111
- "userPromptSubmit": [{ "command": "node /path/to/dist/hooks/userPromptSubmit.js" }],
112
- "postToolUse": [{ "command": "node /path/to/dist/hooks/postToolUse.js", "matcher": "*" }],
113
- "stop": [{ "command": "node /path/to/dist/hooks/stop.js" }]
114
- }
115
- }
116
- ```
104
+ - **Cursor**: `.cursor/rules/kiro-memory.mdc` + MCP config in `.cursor/mcp.json`
105
+ - **Windsurf**: `.windsurfrules` + MCP config in `~/.codeium/windsurf/mcp_config.json`
106
+ - **Cline**: `.clinerules` + MCP config in Cline settings
117
107
 
118
- The hooks are fully automatic. No changes to your workflow required.
108
+ The MCP server exposes 10 tools that your AI assistant can use directly.
119
109
 
120
110
  ## Architecture
121
111
 
122
112
  ```
123
- Kiro CLI
113
+ Claude Code / Cursor / Windsurf / Cline
124
114
  |
125
115
  +-------------+-------------+
126
116
  | | |
127
- agentSpawn postToolUse stop
128
- (inject ctx) (track tools) (summarize)
117
+ Hooks MCP Server Rules Files
118
+ (auto-capture) (10 tools) (editor config)
129
119
  | | |
130
120
  +------+------+------+------+
131
121
  | |
132
- Worker HTTP MCP Server
133
- (port 3001) (stdio)
122
+ Worker HTTP Vector Index
123
+ (port 3001) (embeddings)
134
124
  | |
135
125
  Web Dashboard |
136
126
  (localhost:3001) |
137
127
  | |
138
128
  +------+-----+
139
129
  |
140
- SQLite + FTS5
141
- (~/.kiro-memory/kiro-memory.db)
130
+ SQLite + FTS5 + Embeddings
131
+ (~/.kiro-memory/kiro-memory.db)
142
132
  ```
143
133
 
144
- > The worker auto-starts when `agentSpawn` fires. No manual setup required.
145
-
146
- ### Hooks
147
-
148
- | Hook | Trigger | Purpose |
149
- |------|---------|---------|
150
- | `agentSpawn` | Session starts | Injects relevant context from previous sessions |
151
- | `userPromptSubmit` | User sends prompt | Records the prompt for session continuity |
152
- | `postToolUse` | Any tool completes | Captures file writes, commands, research actions |
153
- | `stop` | Session ends | Generates and stores a structured session summary |
134
+ > The worker auto-starts when a session begins. No manual setup required.
154
135
 
155
136
  ### MCP Tools
156
137
 
157
138
  | Tool | Description |
158
139
  |------|-------------|
159
- | `search` | Full-text search across observations and summaries. Supports project and type filters. |
160
- | `timeline` | Chronological context around a specific observation. Shows what happened before and after. |
161
- | `get_observations` | Retrieve full details of specific observations by ID. Use after `search` to drill down. |
162
- | `get_context` | Get recent observations, summaries, and prompts for a project. |
140
+ | `search` | Full-text search across observations and summaries with project/type filters |
141
+ | `timeline` | Chronological context around a specific observation |
142
+ | `get_observations` | Retrieve full details of observations by ID |
143
+ | `get_context` | Get recent observations, summaries, and prompts for a project |
144
+ | `store_observation` | Store a new observation from the AI assistant |
145
+ | `store_summary` | Store a session summary |
146
+ | `store_knowledge` | Store structured knowledge (decision, constraint, heuristic, rejected) |
147
+ | `resume_session` | Get checkpoint data to resume a previous session |
148
+ | `generate_report` | Generate weekly/monthly activity report in Markdown |
149
+ | `get_recent_context` | Get recent memory context for session injection |
163
150
 
164
151
  ### Storage
165
152
 
@@ -181,8 +168,6 @@ const ctx = createKiroMemory({ project: 'my-project' });
181
168
 
182
169
  // Retrieve context for the current project
183
170
  const context = await ctx.getContext();
184
- console.log(context.relevantObservations);
185
- console.log(context.relevantSummaries);
186
171
 
187
172
  // Store an observation
188
173
  await ctx.storeObservation({
@@ -191,22 +176,23 @@ await ctx.storeObservation({
191
176
  content: 'Fixed OAuth flow -- tokens now refresh with 5-min buffer'
192
177
  });
193
178
 
194
- // Full-text search with filters
195
- const results = await ctx.searchAdvanced('authentication', {
196
- type: 'file-write',
197
- limit: 10
179
+ // Semantic search with vector embeddings
180
+ const results = await ctx.hybridSearch('authentication flow', { limit: 10 });
181
+
182
+ // Store structured knowledge
183
+ await ctx.storeKnowledge({
184
+ knowledgeType: 'decision',
185
+ title: 'Chose PostgreSQL over MongoDB',
186
+ content: 'ACID compliance required for financial transactions',
187
+ reasoning: 'Need strong consistency guarantees'
198
188
  });
199
189
 
200
- // Get chronological timeline around an observation
201
- const timeline = await ctx.getTimeline(42, 5, 5);
190
+ // Session checkpoint & resume
191
+ await ctx.createCheckpoint('session-123', { completedSteps: ['auth', 'db'] });
192
+ const checkpoint = await ctx.getCheckpoint('session-123');
202
193
 
203
- // Store a session summary
204
- await ctx.storeSummary({
205
- request: 'Implement OAuth2 login',
206
- learned: 'Google OAuth requires PKCE for SPAs',
207
- completed: 'Login flow with Google provider',
208
- nextSteps: 'Add refresh token rotation'
209
- });
194
+ // Generate activity report
195
+ const report = await ctx.generateReport({ period: 'weekly' });
210
196
 
211
197
  // Always close when done
212
198
  ctx.close();
@@ -216,16 +202,22 @@ ctx.close();
216
202
 
217
203
  | Method | Returns | Description |
218
204
  |--------|---------|-------------|
219
- | `getContext()` | `ContextContext` | Recent observations, summaries, and prompts for the project |
205
+ | `getContext()` | `ContextContext` | Recent observations, summaries, and prompts |
220
206
  | `storeObservation(data)` | `number` | Store an observation, returns its ID |
221
207
  | `storeSummary(data)` | `number` | Store a session summary, returns its ID |
222
208
  | `search(query)` | `{ observations, summaries }` | Basic full-text search |
223
- | `searchAdvanced(query, filters)` | `{ observations, summaries }` | FTS5 search with project/type/date/limit filters |
209
+ | `searchAdvanced(query, filters)` | `{ observations, summaries }` | FTS5 search with filters |
210
+ | `hybridSearch(query, opts)` | `ScoredResult[]` | Vector + FTS5 hybrid search with smart ranking |
211
+ | `semanticSearch(query, opts)` | `ScoredResult[]` | Pure vector similarity search |
212
+ | `storeKnowledge(data)` | `number` | Store structured knowledge (decision/constraint/heuristic) |
213
+ | `getKnowledge(filters)` | `KnowledgeItem[]` | Retrieve knowledge by type |
214
+ | `createCheckpoint(sessionId, data)` | `void` | Save session checkpoint for resume |
215
+ | `getCheckpoint(sessionId)` | `DBCheckpoint \| null` | Retrieve latest session checkpoint |
216
+ | `generateReport(opts)` | `ReportData` | Generate weekly/monthly activity report |
217
+ | `runDecay(opts)` | `DecayResult` | Run memory decay and stale detection |
218
+ | `consolidateStale(opts)` | `ConsolidateResult` | Consolidate stale observations |
224
219
  | `getTimeline(anchorId, before, after)` | `TimelineEntry[]` | Chronological context around an observation |
225
- | `getRecentObservations(limit)` | `Observation[]` | Most recent observations |
226
- | `getRecentSummaries(limit)` | `Summary[]` | Most recent summaries |
227
220
  | `getOrCreateSession(id)` | `DBSession` | Get or initialize a session |
228
- | `storePrompt(sessionId, num, text)` | `number` | Store a user prompt |
229
221
  | `close()` | `void` | Close the database connection |
230
222
 
231
223
  ## CLI Reference
@@ -236,27 +228,41 @@ kiro-memory <command> [options]
236
228
 
237
229
  | Command | Alias | Description |
238
230
  |---------|-------|-------------|
231
+ | `kiro-memory install` | -- | Install hooks + MCP for your editor |
239
232
  | `kiro-memory context` | `ctx` | Display current project context |
240
233
  | `kiro-memory search <query>` | -- | Search across all stored context |
241
- | `kiro-memory observations [limit]` | `obs` | Show recent observations (default: 10) |
242
- | `kiro-memory summaries [limit]` | `sum` | Show recent summaries (default: 5) |
234
+ | `kiro-memory semantic-search <query>` | `ss` | Vector similarity search |
235
+ | `kiro-memory observations [limit]` | `obs` | Show recent observations |
236
+ | `kiro-memory summaries [limit]` | `sum` | Show recent summaries |
243
237
  | `kiro-memory add-observation <title> <content>` | `add-obs` | Manually add an observation |
244
238
  | `kiro-memory add-summary <content>` | `add-sum` | Manually add a summary |
239
+ | `kiro-memory add-knowledge <type> <title> <content>` | -- | Store structured knowledge |
240
+ | `kiro-memory resume [sessionId]` | -- | Resume from last checkpoint |
241
+ | `kiro-memory report` | -- | Generate activity report |
242
+ | `kiro-memory decay` | -- | Run memory decay detection |
243
+ | `kiro-memory embeddings` | -- | Build/rebuild vector index |
244
+ | `kiro-memory doctor` | -- | Run environment diagnostics |
245
245
 
246
246
  ### Examples
247
247
 
248
248
  ```bash
249
- # View what Kiro Memory knows about your project
250
- kiro-memory context
249
+ # Install for Claude Code
250
+ kiro-memory install --claude-code
251
+
252
+ # Search with vector similarity
253
+ kiro-memory semantic-search "authentication flow"
254
+
255
+ # Generate a weekly report in Markdown
256
+ kiro-memory report --period=weekly --format=md --output=report.md
251
257
 
252
- # Search for past work on authentication
253
- kiro-memory search "OAuth token refresh"
258
+ # Store an architectural decision
259
+ kiro-memory add-knowledge decision "Use PostgreSQL" "ACID compliance for transactions"
254
260
 
255
- # Show the last 20 observations
256
- kiro-memory observations 20
261
+ # Resume a previous session
262
+ kiro-memory resume
257
263
 
258
- # Manually record a decision
259
- kiro-memory add-observation "Architecture Decision" "Chose PostgreSQL over MongoDB for ACID compliance"
264
+ # Run memory decay to clean stale observations
265
+ kiro-memory decay --days=30
260
266
  ```
261
267
 
262
268
  ## Configuration
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "kiro-memory",
3
- "version": "1.6.0",
4
- "description": "Persistent cross-session memory for Kiro CLI. Automatically tracks context, observations, and summaries across coding sessions.",
3
+ "version": "1.7.1",
4
+ "description": "Persistent cross-session memory for AI coding assistants. Works with Claude Code, Cursor, Windsurf, Cline, and any MCP-compatible editor.",
5
5
  "keywords": [
6
6
  "kiro",
7
- "kiro-cli",
8
- "context",
7
+ "claude-code",
8
+ "cursor",
9
+ "windsurf",
10
+ "cline",
9
11
  "memory",
10
- "persistence",
11
12
  "mcp",
12
- "hooks",
13
+ "context",
14
+ "persistence",
15
+ "vector-search",
16
+ "embeddings",
13
17
  "sqlite",
14
18
  "typescript",
15
- "agent",
16
19
  "ai-tools"
17
20
  ],
18
21
  "author": "auriti-web-design",
@@ -106,6 +109,10 @@
106
109
  "yaml": "^2.8.2",
107
110
  "zod": "^3.23.8"
108
111
  },
112
+ "optionalDependencies": {
113
+ "fastembed": "^2.1.0",
114
+ "@huggingface/transformers": "^3.8.0"
115
+ },
109
116
  "devDependencies": {
110
117
  "@types/better-sqlite3": "^7.6.13",
111
118
  "@types/cors": "^2.8.19",