You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---Optional filter function to control which chats are shown when browsing
131
-
chat_filter=nil, -- function(chat_data) return boolean end
146
+
147
+
-- Summary system
148
+
summary= {
149
+
-- Keymap to generate summary for current chat (default: "gcs")
150
+
create_summary_keymap="gcs",
151
+
-- Keymap to browse summaries (default: "gbs")
152
+
browse_summaries_keymap="gbs",
153
+
154
+
generation_opts= {
155
+
adapter=nil, -- defaults to current chat adapter
156
+
model=nil, -- defaults to current chat model
157
+
context_size=90000, -- max tokens that the model supports
158
+
include_references=true, -- include slash command content
159
+
include_tool_outputs=true, -- include tool execution results
160
+
system_prompt=nil, -- custom system prompt (string or function)
161
+
format_summary=nil, -- custom function to format generated summary e.g to remove <think/> tags from summary
162
+
},
163
+
},
164
+
165
+
-- Memory system (requires VectorCode CLI)
166
+
memory= {
167
+
-- Automatically index summaries when they are generated
168
+
auto_create_memories_on_summary_generation=true,
169
+
-- Path to the VectorCode executable
170
+
vectorcode_exe="vectorcode",
171
+
-- Tool configuration
172
+
tool_opts= {
173
+
-- Default number of memories to retrieve
174
+
default_num=10
175
+
},
176
+
-- Enable notifications for indexing progress
177
+
notify=true,
178
+
-- Index all existing memories on startup
179
+
-- (requires VectorCode 0.6.12+ for efficient incremental indexing)
180
+
index_on_startup=false,
181
+
},
132
182
}
133
183
}
134
184
}
135
185
})
136
186
```
137
187
188
+
189
+
> [!WARNING]
190
+
> Title and summary generation defaults to current chat's adapter and model. Make sure to set cheaper models in `title_generation_opts` and `summary.generation_opts` to avoid using premium models.
191
+
192
+
138
193
## 🛠️ Usage
139
194
140
195
#### 🎯 Commands
141
196
142
197
-`:CodeCompanionHistory` - Open the history browser
198
+
-`:CodeCompanionSummaries` - Browse all summaries
143
199
144
200
145
201
#### ⌨️ Chat Buffer Keymaps
146
202
203
+
**History Management:**
147
204
-`gh` - Open history browser (customizable via `opts.keymap`)
148
205
-`sc` - Save current chat manually (customizable via `opts.save_chat_keymap`)
149
206
207
+
**Summary System:**
208
+
-`gcs` - Generate summary for current chat (customizable via `opts.summary.create_summary_keymap`)
209
+
-`gbs` - Browse saved summaries (customizable via `opts.summary.browse_summaries_keymap`)
210
+
150
211
#### 📚 History Browser
151
212
152
213
The history browser shows all your saved chats with:
153
214
- Title (auto-generated or custom)
154
-
- Last updated time
215
+
- Summary indicator (📝 icon for chats with summaries)
216
+
- Token estimates and relative timestamps
155
217
- Preview of chat contents
156
218
157
219
Actions in history browser:
@@ -165,7 +227,46 @@ Actions in history browser:
165
227
-`<M-r>` (Alt+r) - Rename selected chat
166
228
-`<C-y>` - Duplicate selected chat
167
229
168
-
> Note: Delete, rename, and duplicate actions are only available in telescope, snacks, and fzf-lua pickers. Multiple chats can be selected for deletion using picker's multi-select feature (press `<Tab>`). Duplication is limited to one chat at a time.
230
+
#### 📝 Summary Browser
231
+
232
+
The summary browser shows all your generated summaries with:
233
+
- Chat title (from original conversation)
234
+
- Project context and relative timestamps
235
+
- Preview of summary content
236
+
237
+
Actions in summary browser:
238
+
-`<CR>` - Add the summary to the current chat
239
+
- Normal mode:
240
+
-`d` - Delete selected summary(s)
241
+
- Insert mode:
242
+
-`<M-d>` (Alt+d) - Delete selected summary(s)
243
+
244
+
245
+
## The `@memory` tool
246
+
247
+
If you have installed the [VectorCode](https://github.com/Davidyz/VectorCode) CLI,
248
+
this plugin will use VectorCode to create an index for your chat summaries and create
249
+
a tool called `@memory`. This tool gives the LLM the ability to search for
250
+
(the summary of) previous chats so that you can refer to them in a new chat.
251
+
252
+
Available options for the memory submodule:
253
+
```lua
254
+
opts.memory= {
255
+
auto_create_memories_on_summary_generation=true,
256
+
-- path to the `vectorcode` executable
257
+
vectorcode_exe="vectorcode",
258
+
tool_opts= {
259
+
-- default number of memories to retrieve
260
+
default_num=10
261
+
},
262
+
-- whether to enable notification
263
+
notify=true,
264
+
-- whether to automatically update the index of all existing memories on startup
265
+
-- (requires VectorCode 0.6.12+ for efficient incremental indexing)
266
+
index_on_startup=false,
267
+
}
268
+
```
269
+
169
270
170
271
#### 🔄 Title Refresh Feature
171
272
@@ -224,8 +325,8 @@ Each chat index entry (used in filtering) includes the following information:
224
325
The history extension exports the following functions that can be accessed via `require("codecompanion").extensions.history`:
225
326
226
327
```lua
227
-
--Get the storage location for saved chats
228
-
get_location(): string?
328
+
--Chat Management
329
+
get_location(): string?-- Get storage location
229
330
230
331
-- Save a chat to storage (uses last chat if none provided)
@@ -389,9 +510,13 @@ The extension integrates with CodeCompanion through a robust event-driven archit
389
510
390
511
</details>
391
512
392
-
## 📝 TODOs
513
+
## 🔮 Future Roadmap
393
514
394
-
-[x] Add support for additional pickers like snacks, fzf etc
515
+
516
+
### Upcoming Features
517
+
-[ ] Auto-summary generation options
518
+
-[ ] Summary search and filtering
519
+
-[ ] Integration with vector databases
395
520
396
521
## 🔌 Related Extensions
397
522
@@ -400,9 +525,10 @@ The extension integrates with CodeCompanion through a robust event-driven archit
400
525
401
526
## 🙏 Acknowledgements
402
527
403
-
Special thanks to [Oli Morris](https://github.com/olimorris) for creating the amazing [CodeCompanion.nvim](https://codecompanion.olimorris.dev) plugin - a highly configurable and powerful coding assistant for Neovim.
528
+
Special thanks to:
529
+
-[Oli Morris](https://github.com/olimorris) for creating the amazing [CodeCompanion.nvim](https://codecompanion.olimorris.dev) plugin - a highly configurable and powerful coding assistant for Neovim.
530
+
-[David](https://github.com/Davidyz) for the awesome [VectorCode](https://github.com/Davidyz/VectorCode) CLI and adding the @memory tool integration.
0 commit comments