@teammates/recall 0.5.1 → 0.5.3
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 +29 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,6 +95,20 @@ teammates-recall status --dir ./.teammates
|
|
|
95
95
|
4. **Stores** the index at `.teammates/<teammate>/.index/` (gitignored)
|
|
96
96
|
5. **Searches** using Vectra's semantic similarity matching
|
|
97
97
|
|
|
98
|
+
### Two-Pass Query Architecture
|
|
99
|
+
|
|
100
|
+
When used by the CLI, recall runs a two-pass search for maximum relevance:
|
|
101
|
+
|
|
102
|
+
**Pass 1 — Pre-task (no LLM, automatic):**
|
|
103
|
+
- `buildQueryVariations()` generates 1-3 queries from the task prompt and conversation context (keyword extraction, focused keyword query, conversation-derived topic query)
|
|
104
|
+
- `matchMemoryCatalog()` scans memory file frontmatter (name + description fields) for text matches against the task — a cheap, no-LLM relevance signal
|
|
105
|
+
- `multiSearch()` fuses results from all query variations + catalog matches, deduplicating by URI (highest score wins)
|
|
106
|
+
|
|
107
|
+
**Pass 2 — Mid-task (agent-driven):**
|
|
108
|
+
- Every teammate prompt includes a recall tool section documenting `teammates-recall search` CLI usage
|
|
109
|
+
- Agents can search iteratively mid-task: query → read result → refine query
|
|
110
|
+
- Supports cross-teammate search by omitting `--teammate`
|
|
111
|
+
|
|
98
112
|
## Auto-Sync
|
|
99
113
|
|
|
100
114
|
Every `search` call automatically detects new or changed memory files and indexes them before returning results. This is on by default — no manual `sync` or `index` step is needed.
|
|
@@ -129,7 +143,10 @@ The `--json` flag returns structured results that agents can parse:
|
|
|
129
143
|
## Use As a Library
|
|
130
144
|
|
|
131
145
|
```typescript
|
|
132
|
-
import {
|
|
146
|
+
import {
|
|
147
|
+
Indexer, search, multiSearch,
|
|
148
|
+
buildQueryVariations, matchMemoryCatalog
|
|
149
|
+
} from "@teammates/recall";
|
|
133
150
|
|
|
134
151
|
// Full index rebuild
|
|
135
152
|
const indexer = new Indexer({ teammatesDir: "./.teammates" });
|
|
@@ -155,6 +172,17 @@ const results2 = await search("database migration", {
|
|
|
155
172
|
teammatesDir: "./.teammates",
|
|
156
173
|
skipSync: true,
|
|
157
174
|
});
|
|
175
|
+
|
|
176
|
+
// Multi-query fusion (used by CLI pre-task recall)
|
|
177
|
+
const queries = buildQueryVariations("fix auth token refresh", conversationHistory);
|
|
178
|
+
const catalogMatches = matchMemoryCatalog("./.teammates", "atlas", "fix auth token refresh");
|
|
179
|
+
const fused = await multiSearch({
|
|
180
|
+
queries,
|
|
181
|
+
catalogMatches,
|
|
182
|
+
teammatesDir: "./.teammates",
|
|
183
|
+
teammate: "atlas",
|
|
184
|
+
maxResults: 10,
|
|
185
|
+
});
|
|
158
186
|
```
|
|
159
187
|
|
|
160
188
|
## Embedding Model
|
package/package.json
CHANGED