retriv 0.1.0 → 0.2.0
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
|
@@ -244,18 +244,18 @@ interface SearchResult {
|
|
|
244
244
|
|
|
245
245
|
## Benchmarks
|
|
246
246
|
|
|
247
|
-
Retrieval accuracy on Nuxt documentation (
|
|
247
|
+
Retrieval accuracy on Nuxt documentation (2,817 chunks):
|
|
248
248
|
|
|
249
249
|
| Test Type | FTS | Vector | Hybrid |
|
|
250
250
|
|-----------|-----|--------|--------|
|
|
251
|
-
| Exact terminology (ports, config names) |
|
|
252
|
-
| Doc retrieval (keyword overlap) |
|
|
253
|
-
| Semantic queries (synonyms, no overlap) |
|
|
254
|
-
| **Total** | **
|
|
251
|
+
| Exact terminology (ports, config names) | 7/7 | 5/7 | 7/7 |
|
|
252
|
+
| Doc retrieval (keyword overlap) | 0/7 | 5/7 | 5/7 |
|
|
253
|
+
| Semantic queries (synonyms, no overlap) | 1/6 | 5/6 | 5/6 |
|
|
254
|
+
| **Total** | **8/20 (40%)** | **15/20 (75%)** | **17/20 (85%)** |
|
|
255
255
|
|
|
256
256
|
- **FTS** excels at exact terms but fails semantic queries ("reuse logic" → composables)
|
|
257
|
-
- **Vector** understands meaning but misses precise terminology ("
|
|
258
|
-
- **Hybrid** combines both -
|
|
257
|
+
- **Vector** understands meaning but misses precise terminology (".global" suffix)
|
|
258
|
+
- **Hybrid** combines both - best overall recall across query types
|
|
259
259
|
|
|
260
260
|
Run locally: `pnpm test:eval`
|
|
261
261
|
|
|
@@ -11,7 +11,7 @@ async function clearCorruptedCache(error, model) {
|
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
13
|
function transformersJs(options = {}) {
|
|
14
|
-
const model = resolveModelForPreset(options.model ?? "bge-
|
|
14
|
+
const model = resolveModelForPreset(options.model ?? "bge-small-en-v1.5", "transformers.js");
|
|
15
15
|
let cached = null;
|
|
16
16
|
return { async resolve() {
|
|
17
17
|
if (cached) return cached;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retriv",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "Unified document retrieval for search - semantic, full-text, and fuzzy.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -139,17 +139,18 @@
|
|
|
139
139
|
"@huggingface/transformers": "^3.8.1",
|
|
140
140
|
"@libsql/client": "^0.17.0",
|
|
141
141
|
"@types/node": "^25.2.0",
|
|
142
|
-
"@types/pg": "^8.
|
|
143
|
-
"@upstash/vector": "^1.
|
|
142
|
+
"@types/pg": "^8.16.0",
|
|
143
|
+
"@upstash/vector": "^1.2.2",
|
|
144
144
|
"@vitest/coverage-v8": "^4.0.18",
|
|
145
145
|
"ai": "^6.0.67",
|
|
146
|
-
"
|
|
146
|
+
"ai-sdk-provider-gemini-cli": "^2.0.1",
|
|
147
|
+
"bumpp": "^10.4.0",
|
|
147
148
|
"eslint": "^9.39.2",
|
|
148
|
-
"obuild": "^0.4.
|
|
149
|
+
"obuild": "^0.4.22",
|
|
149
150
|
"pg": "^8.18.0",
|
|
150
151
|
"sqlite-vec": "^0.1.7-alpha.2",
|
|
151
152
|
"typescript": "^5.9.3",
|
|
152
|
-
"vitest": "^4.0.
|
|
153
|
+
"vitest": "^4.0.18",
|
|
153
154
|
"zod": "^4.3.6"
|
|
154
155
|
},
|
|
155
156
|
"scripts": {
|