opencode-session-recall 0.7.0 → 0.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.
Files changed (2) hide show
  1. package/README.md +88 -57
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,26 +1,77 @@
1
1
  # opencode-session-recall
2
2
 
3
- A plugin for [opencode](https://github.com/opencode-ai/opencode) that gives your agent a memory that survives compaction without building another memory system.
3
+ **Everything your agent ever did is already in the database. It's just not looking.**
4
4
 
5
- opencode is an open-source AI coding agent that runs in your terminal. It manages long conversations through compaction: summarizing older context to keep the active window focused. But compaction means the agent forgets original tool outputs, earlier reasoning, the user's exact words.
5
+ OpenCode stores the full conversation history your agent worked through messages, tool calls, tool outputs, reasoning traces even after compaction removes them from the active context window. As conversations get long, OpenCode shrinks what the model can see. The old content is still stored, just no longer visible to the agent.
6
6
 
7
- This plugin adds five tools to the agent's toolkit that let it search and retrieve that lost context on demand, within the current session, across all sessions in the project, or across every project on the machine.
7
+ This plugin gives the agent five tools to search and retrieve all of it on demand within the current session, across every session in the project, or across every project on the machine.
8
8
 
9
- **It doesn't create a separate memory store.** Most agent "memory" solutions add vector databases, embedding pipelines, or knowledge graphs — duplicating your data into yet another system. `opencode-session-recall` does none of that. opencode already stores every message, every tool output, every reasoning trace in its database, even after compaction prunes them from context. This plugin simply gives the agent access to what's already there.
9
+ [OpenCode](https://github.com/opencode-ai/opencode) is an open-source AI coding agent that runs in your terminal.
10
10
 
11
- No embeddings. No vector store. No data duplication. No setup. Just install the plugin and the agent can remember.
11
+ **No new database.**
12
+ **No embeddings.**
13
+ **No summarization.**
14
+ **No duplication.**
15
+ **No overhead.**
12
16
 
13
- ## What this enables
17
+ Just install the plugin. The agent can search its own history.
14
18
 
15
- **"We already solved this."** The agent searches its own history and finds the solution from 2 hours ago that got compacted away, instead of solving the same problem again.
19
+ ## The problem is absurd when you think about it
16
20
 
17
- **"How did we do it in that other project?"** Cross-project search finds the JWT middleware implementation from the auth project, the Docker config from the deployment project, the test patterns from the API project.
21
+ Your agent solves a tricky build error. Twenty minutes later, compaction runs. An hour later, the same error shows up. The agent starts from zero debugging something it already figured out, while the answer sits in the database it's connected to.
18
22
 
19
- **"What did you originally ask for?"** After 50+ tool calls and 3 compactions, the agent can pull up the user's exact original requirements to make sure it's still on track.
23
+ You're 200 tool calls and 3 compactions deep. The agent has drifted from your original request. Your exact words are gone from context. But they're not gone — they're in the database. The agent just can't see them.
20
24
 
21
- **"What was that error?"** The full stack trace from the tool output that got pruned is still there. The agent retrieves it instead of reproducing the error.
25
+ The data already exists. This plugin removes the blindfold.
22
26
 
23
- **"Show me what happened."** Browse any session chronologically, play back the conversation, understand the narrative of how a problem was investigated and solved.
27
+ ## What it looks like
28
+
29
+ **"We already fixed this."**
30
+
31
+ ```
32
+ recall({ query: "ECONNREFUSED retry", scope: "session" })
33
+ ```
34
+
35
+ Agent finds its own solution from 2 hours ago. Doesn't re-derive it.
36
+
37
+ **"It was in that other project."**
38
+
39
+ ```
40
+ recall_sessions({ scope: "global", search: "rate limit" })
41
+ recall_get({ sessionID: "...", messageID: "..." })
42
+ ```
43
+
44
+ Finds the implementation from your API project. Reuses it instead of reinventing it.
45
+
46
+ **"What did I originally ask for?"**
47
+
48
+ ```
49
+ recall_messages({ limit: 5, role: "user" })
50
+ ```
51
+
52
+ Pulls up exact original requirements after 3 compactions. Checks its own work against what you actually said.
53
+
54
+ **"What was that error?"**
55
+
56
+ ```
57
+ recall({ query: "TypeError", type: "tool", scope: "session" })
58
+ ```
59
+
60
+ Gets the full stack trace from a tool output that got pruned. Doesn't re-run the failing command.
61
+
62
+ **"Why did we decide on that approach?"**
63
+
64
+ ```
65
+ recall({ query: "chose postgres over", scope: "project", type: "reasoning" })
66
+ ```
67
+
68
+ Recovers the reasoning behind an architectural decision from three sessions ago. Context that no summary captures.
69
+
70
+ ## Recall is not memory
71
+
72
+ This is not a memory system. Memory is selective and curated. Recall is raw history retrieval — verbatim, exhaustive, on demand.
73
+
74
+ If you use a persistent memory system alongside this plugin, recall gives it source material. The agent searches history, finds something useful, and stores it deliberately. Discovery first, then permanent memory.
24
75
 
25
76
  ## Install
26
77
 
@@ -28,16 +79,19 @@ No embeddings. No vector store. No data duplication. No setup. Just install the
28
79
  opencode plugin opencode-session-recall
29
80
  ```
30
81
 
31
- Or add it to your `opencode.json` manually:
82
+ Or add it to your `opencode.json`:
32
83
 
33
84
  ```jsonc
34
85
  {
35
- "plugin": [
36
- "opencode-session-recall",
86
+ "plugin": ["opencode-session-recall"],
87
+ }
88
+ ```
89
+
90
+ To disable cross-project search:
37
91
 
38
- // Disable cross-project search if needed
39
- ["opencode-session-recall", { "global": false }],
40
- ],
92
+ ```jsonc
93
+ {
94
+ "plugin": [["opencode-session-recall", { "global": false }]],
41
95
  }
42
96
  ```
43
97
 
@@ -47,25 +101,25 @@ Five tools, designed around how agents actually navigate conversation history:
47
101
 
48
102
  ### `recall` — Search
49
103
 
50
- The primary tool. Full-text search across text, tool outputs, tool inputs, reasoning, and subtask descriptions. Searches the current session by default, or widen to all project sessions or all sessions globally.
104
+ The primary tool. Full-text search across messages, tool outputs, tool inputs, reasoning, and subtask descriptions. Searches globally by default, or narrow to the current project or session.
51
105
 
52
106
  ```
53
107
  recall({ query: "authentication", scope: "project" })
54
- recall({ query: "error", after: <2 days ago>, type: "tool" })
108
+ recall({ query: "error", type: "tool", scope: "session" })
55
109
  recall({ query: "JWT", sessionID: "ses_from_another_project" })
56
110
  ```
57
111
 
58
- | Param | Default | Description |
59
- | ---------------- | ----------- | --------------------------------------------- |
60
- | `query` | required | Text to search for (case-insensitive) |
61
- | `scope` | `"session"` | `"session"`, `"project"`, or `"global"` |
62
- | `sessionID` | — | Target a specific session (overrides scope) |
63
- | `type` | `"all"` | `"text"`, `"tool"`, `"reasoning"`, or `"all"` |
64
- | `role` | `"all"` | `"user"`, `"assistant"`, or `"all"` |
65
- | `before`/`after` | — | Timestamp filters (ms epoch) |
66
- | `width` | `200` | Snippet size (50-1000 chars) |
67
- | `sessions` | `10` | Max sessions to scan |
68
- | `results` | `10` | Max results to return |
112
+ | Param | Default | Description |
113
+ | ---------------- | ---------- | --------------------------------------------- |
114
+ | `query` | required | Text to search for (case-insensitive) |
115
+ | `scope` | `"global"` | `"session"`, `"project"`, or `"global"` |
116
+ | `sessionID` | — | Target a specific session (overrides scope) |
117
+ | `type` | `"all"` | `"text"`, `"tool"`, `"reasoning"`, or `"all"` |
118
+ | `role` | `"all"` | `"user"`, `"assistant"`, or `"all"` |
119
+ | `before`/`after` | — | Timestamp filters (ms epoch) |
120
+ | `width` | `200` | Snippet size (501000 chars) |
121
+ | `sessions` | `10` | Max sessions to scan |
122
+ | `results` | `10` | Max results to return |
69
123
 
70
124
  ### `recall_get` — Retrieve
71
125
 
@@ -107,29 +161,6 @@ recall_sessions({ scope: "project", search: "auth" })
107
161
  recall_sessions({ scope: "global", search: "deployment" })
108
162
  ```
109
163
 
110
- ## Real-world workflow
111
-
112
- This is what it actually looks like when an agent uses these tools to answer "what have we been doing with our UniFi network?" across a 3-week, 600+ message session in a different project:
113
-
114
- ```
115
- 1. recall_sessions({ scope: "global", search: "unifi" })
116
- → discovers the ubiopti project session
117
-
118
- 2. recall_messages({ sessionID: "...", limit: 5, role: "user", reverse: true })
119
- → reads the most recent user messages to understand current state
120
-
121
- 3. recall({ query: "kickout threshold", sessionID: "...", width: 500 })
122
- → finds the technical root cause analysis in tool outputs
123
-
124
- 4. recall_context({ sessionID: "...", messageID: "...", window: 3 })
125
- → expands around the Ubiquiti support chat to see the full interaction
126
-
127
- 5. recall({ query: "iwpriv", sessionID: "...", after: <recent timestamp> })
128
- → finds only recent mentions, not the whole session history
129
- ```
130
-
131
- Five tool calls, complete narrative reconstructed across projects.
132
-
133
164
  ## Options
134
165
 
135
166
  | Option | Type | Default | Description |
@@ -139,13 +170,13 @@ Five tool calls, complete narrative reconstructed across projects.
139
170
 
140
171
  ## How it works
141
172
 
142
- This plugin doesn't create a separate memory store. It reads what opencode already has.
173
+ When OpenCode compacts a session, it doesn't delete anything. Tool outputs get a `compacted` timestamp and are replaced with placeholder text in the LLM's context — but the original data stays in the database. Messages before a compaction boundary are skipped when building the LLM context — but they're still there.
143
174
 
144
- When opencode compacts a session, it doesn't delete anything. Tool outputs get a `compacted` timestamp and are replaced with placeholder text in the LLM's context — but the original data stays in the database. Messages before a compaction boundary are skipped when building the LLM context — but they're still there. The plugin accesses all of this through the opencode SDK.
175
+ This plugin reads all of it through the OpenCode SDK:
145
176
 
146
- - Uses the opencode SDK client (no direct database queries, no separate storage)
177
+ - No direct database queries, no separate storage
147
178
  - Zero setup — no embeddings to generate, no indexes to build, no data to sync
148
- - Sessions are scanned newest-first with bounded concurrency
179
+ - Sessions scanned newest-first with bounded concurrency
149
180
  - Respects abort signals for long-running searches
150
181
  - Cross-project search enabled by default (disable with `global: false`)
151
182
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-session-recall",
4
- "version": "0.7.0",
4
+ "version": "0.7.1",
5
5
  "type": "module",
6
- "description": "Agent memory without a memory system search and retrieve opencode conversation history that was lost to compaction, across sessions and projects",
6
+ "description": "Everything your agent ever did is already in the database this plugin lets it look",
7
7
  "main": "./dist/opencode-session-recall.js",
8
8
  "exports": {
9
9
  ".": {