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
- CRITICAL: dotproduct normalization changed from `Math.abs` to sigmoid
20
+
- CRITICAL: addVectors restructured to validate-then-commit (atomic)
21
+
- CRITICAL: save() wrapped with proper error handling for partial failure
22
+
- IMPORTANT: `ensureInitialized` removed from public exports
23
+
- IMPORTANT: `initPromise` cleared after successful init
24
+
- IMPORTANT: `__proto__`/`constructor`/`prototype` keys stripped in metadata
25
+
- FIX: package.json exports updated to match tsup output paths (`dist/index.mjs`, `dist/index.cjs`)
17
26
18
27
**Day 5 must deliver:**
19
28
1.`pkg/langchain/tests/integration.test.ts` — **NEW FILE** (does not exist yet)
20
29
2.`pkg/langchain/dist/` — **NOT YET BUILT** (tsup configured but never run)
21
30
3. Verification of inherited LangChain methods (`similaritySearch`, `similaritySearchWithScore`, `asRetriever`)
22
31
23
-
**Plan correction:**`maxMarginalRelevanceSearch` does NOT exist on the installed `@langchain/core@0.3.x` VectorStore prototype. Task W43.5d is **DROPPED** and replaced with `similaritySearch` string-query test (the actual default method that calls embedQuery + similaritySearchVectorWithScore).
32
+
**Plan corrections:**
33
+
-`maxMarginalRelevanceSearch` does NOT exist on `@langchain/core@0.3.x` VectorStore prototype — **DROPPED** from all plans
34
+
-`addDocuments` is NOT a default method — EdgeVecStore.addDocuments delegates to embedDocuments+addVectors. Tested as W43.5c2.
35
+
- Parent plan (`WEEKLY_TASK_PLAN.md`) has been synced to remove MMR references and align task IDs
24
36
25
37
---
26
38
@@ -30,22 +42,25 @@
30
42
|:-----|:---|:------|:-------|:-----------|
31
43
| Create integration test with mock embeddings (no external API) | W43.5a | 1.5h | PENDING | Day 4 |
32
44
| Test full RAG pipeline: embed -> store -> search -> retrieve | W43.5b | 1h | PENDING | W43.5a |
33
-
| Test `similaritySearch` default (string query -> embedQuery -> search) | W43.5c | 0.5h | PENDING | Day 3 |
45
+
| Test `similaritySearch` default (string query → embedQuery → search) | W43.5c | 0.5h | PENDING | Day 3 |
46
+
| Test `addDocuments` (embeds via this.embeddings, then addVectors) | W43.5c2 | 0.5h | PENDING | Day 3 |
34
47
| Test `similaritySearchWithScore` default (string query variant) | W43.5d | 0.5h | PENDING | Day 3 |
35
48
| Test `asRetriever()` returns functional `VectorStoreRetriever`| W43.5e | 0.5h | PENDING | Day 3 |
36
49
| Verify build: ESM + CJS dual output via `tsup`| W43.5f | 1h | PENDING | Day 3 |
37
-
| Verify peer dep: test with `@langchain/core@0.3.x` and `@langchain/core@0.4.x`| W43.5g | 0.5h | PENDING | W43.5f |
50
+
| Verify peer dep: test with `@langchain/core@0.3.0` (lower bound)| W43.5g | 0.5h | PENDING | W43.5f |
38
51
39
-
**Total Estimated Hours:** 5.5h
52
+
**Total Estimated Hours:** 6h
53
+
54
+
**Note on W43.5g:**`@langchain/core@0.4.x` may not yet exist on npm. If unavailable, test only with `@0.3.0` (lower bound) and `@0.3.x` (latest in range). Do NOT fail the task if 0.4.x is not published.
@@ -112,9 +127,17 @@ The `VectorStore` base class provides `similaritySearch(query, k, filter)` which
112
127
113
128
Verify this chain works correctly with EdgeVecStore.
114
129
130
+
### W43.5c2 — `addDocuments`
131
+
132
+
`addDocuments` is an EdgeVecStore method that:
133
+
1. Calls `this.embeddings.embedDocuments(texts)` to get vectors
134
+
2. Calls `this.addVectors(vectors, documents, options)` to store
135
+
136
+
Verify: embedDocuments is called, vectors stored, IDs returned.
137
+
115
138
### W43.5d — Default `similaritySearchWithScore`
116
139
117
-
Same as `similaritySearch` but returns `[Document, score][]` (preserves scores). Verify scores are normalized.
140
+
Same as `similaritySearch` but returns `[Document, score][]` (preserves scores). Verify scores are normalized via sigmoid for dotproduct, `1-d` for cosine, `1/(1+d)` for L2.
118
141
119
142
### W43.5e — `asRetriever()`
120
143
@@ -135,23 +158,25 @@ Verify:
135
158
cd pkg/langchain && npm run build
136
159
```
137
160
138
-
Verify:
139
-
-`dist/index.js` or `dist/index.mjs` exists (ESM output)
**Note:** tsup.config.ts output structure may differ from the `dist/esm/` + `dist/cjs/` layout described in the original plan. Check actual tsup output paths.
164
+
-`dist/index.d.ts` exists (ESM type declarations)
165
+
-`dist/index.d.cts` exists (CJS type declarations)
166
+
-No TypeScript errors in strict mode (`npx tsc --noEmit`)
-`package.json``exports`, `main`, `module`, `types` fields point to correct paths
146
169
147
170
### W43.5g — Peer Dep Compatibility
148
171
149
172
Test installation with:
150
-
-`@langchain/core@0.3.0` (lower bound)
151
-
-`@langchain/core@0.4.x` (latest in range, if available)
173
+
-`@langchain/core@0.3.0` (lower bound of peer dep range)
174
+
-`@langchain/core@latest` within `>=0.3.0 <0.5.0`range
152
175
153
176
Verify `npm install` succeeds and basic import works. This is a **verification task**, not a separate test suite — run in a temp directory with `npm pack` output.
154
177
178
+
**Note:** If `@langchain/core@0.4.x` is not yet published on npm, test only `@0.3.0` and `@0.3.x` latest. Do not fail the task for unpublished versions.
179
+
155
180
---
156
181
157
182
## Implementation Notes
@@ -186,14 +211,16 @@ From `@langchain/core@0.3.x` VectorStore prototype:
186
211
## Acceptance Criteria
187
212
188
213
-[ ] Integration tests pass with mock embeddings (no external API calls)
189
-
-[ ] Full RAG pipeline: text -> embed -> add -> query -> get document back with correct content
214
+
-[ ] Full RAG pipeline: text → embed → add → query → get document back with correct content
190
215
-[ ]`similaritySearch` default: calls `embedQuery`, returns `Document[]` without scores
216
+
-[ ]`addDocuments`: calls `embedDocuments`, then `addVectors`, returns IDs
| tsup output paths differ from expected `dist/esm/` + `dist/cjs/`| Check actual tsup output after first build; update package.json `exports` if needed |
234
+
|`@langchain/core@0.4.x` not published | Test only with 0.3.x range; do not fail task |
235
+
|`dist/index.d.cts` not generated by tsup | Verify after first build; if missing, add `dts: { resolve: true }` to tsup config |
0 commit comments