@johnhenry/viaframe-documents 0.0.0-stage → 1.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/package.json +19 -4
- package/viaframe-documents.viaframe-pkg.json +3646 -0
- package/README.md +0 -3
|
@@ -0,0 +1,3646 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "viaframe-package",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"name": "@viaframe/documents",
|
|
5
|
+
"packageVersion": "1.2.0",
|
|
6
|
+
"requires": {
|
|
7
|
+
"helpers": {
|
|
8
|
+
"docs": 2
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"description": "Local document retrieval: extract text, Markdown, HTML, DOCX, EPUB and PDF (best effort; optional pdf.js and OCR adapters you wire), chunk with stable ids and source/page/span/heading provenance, build a bounded index (deterministic local embedder; opt-in on-device AI or an embedder you wire), search with citations by cosine, BM25 or both, and export or import the corpus as a file, optionally with compact vectors. Pure JavaScript, no server, no network, no dependency.",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"panes": [
|
|
14
|
+
{
|
|
15
|
+
"id": "extract",
|
|
16
|
+
"title": "Extract documents",
|
|
17
|
+
"description": "Read documents locally: plain text, Markdown, HTML (stripped as text, never run) PDF (best effort: simple fonts, no encryption, no scans), DOCX and EPUB (their text and headings, nothing run). `adapters` is optional and wired from your own panes: `{ pdfjs }` (the pdfjs-dist module from an import pane, which reads object streams, composite fonts and the other PDF filters) and `{ ocr }` (a function ({ name, type, bytes }) => text, which reads images and scanned pages); without it PNG, JPEG and scans are listed as not read. Each document comes out with its text, headings and pages, or with a status that says why it could not be read: unsupported, encrypted, scanned, empty, too-large. Give a list of { name, text } or { name, file } (a media value), or a single media value.",
|
|
18
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M4 2h6l3 3v9H4zM10 2v3h3M6 8h5M6 11h5\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
19
|
+
"canvas": {
|
|
20
|
+
"format": "viaframe-canvas",
|
|
21
|
+
"version": 3,
|
|
22
|
+
"name": "Extract documents",
|
|
23
|
+
"panes": [
|
|
24
|
+
{
|
|
25
|
+
"id": "i_documents",
|
|
26
|
+
"type": "input",
|
|
27
|
+
"name": "documents",
|
|
28
|
+
"rect": {
|
|
29
|
+
"x": 0,
|
|
30
|
+
"y": 0,
|
|
31
|
+
"width": 240
|
|
32
|
+
},
|
|
33
|
+
"inputs": [],
|
|
34
|
+
"widget": {
|
|
35
|
+
"kind": "json",
|
|
36
|
+
"value": "[]"
|
|
37
|
+
},
|
|
38
|
+
"control": {
|
|
39
|
+
"group": "Settings"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "i_adapters",
|
|
44
|
+
"type": "input",
|
|
45
|
+
"name": "adapters",
|
|
46
|
+
"rect": {
|
|
47
|
+
"x": 0,
|
|
48
|
+
"y": 150,
|
|
49
|
+
"width": 240
|
|
50
|
+
},
|
|
51
|
+
"inputs": [],
|
|
52
|
+
"widget": {
|
|
53
|
+
"kind": "json",
|
|
54
|
+
"value": "null"
|
|
55
|
+
},
|
|
56
|
+
"control": {
|
|
57
|
+
"group": "Settings"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "run",
|
|
62
|
+
"type": "eval",
|
|
63
|
+
"name": "result",
|
|
64
|
+
"rect": {
|
|
65
|
+
"x": 320,
|
|
66
|
+
"y": 0,
|
|
67
|
+
"width": 360
|
|
68
|
+
},
|
|
69
|
+
"inputs": [
|
|
70
|
+
{
|
|
71
|
+
"name": "documents",
|
|
72
|
+
"source": "i_documents"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "adapters",
|
|
76
|
+
"source": "i_adapters"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"autorun": true,
|
|
80
|
+
"mode": "function",
|
|
81
|
+
"view": "auto",
|
|
82
|
+
"outputs": [
|
|
83
|
+
{
|
|
84
|
+
"name": "documents"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "report"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"code": "const items = Array.isArray(documents) ? documents : documents == null ? [] : [documents];\nif (items.length > docs.LIMITS.maxDocs) throw new Error(`${items.length} documents is over the limit of ${docs.LIMITS.maxDocs}`);\nconst brief = (d) => ({ name: d.name, kind: d.kind, status: d.status, chars: d.text.length, ...(d.reason ? { reason: d.reason } : {}), ...(d.pages ? { pages: d.pages.length } : {}), ...(d.warnings.length ? { warnings: d.warnings } : {}) });\nconst out = [];\nfor (let i = 0; i < items.length; i++) out.push(await docs.extractDocument(await docs.readSource(items[i], i), adapters ?? {}));\nreturn { documents: out, report: out.map(brief) };",
|
|
91
|
+
"description": "Read documents locally: plain text, Markdown, HTML (stripped as text, never run) PDF (best effort: simple fonts, no encryption, no scans), DOCX and EPUB (their text and headings, nothing run). `adapters` is optional and wired from your own panes: `{ pdfjs }` (the pdfjs-dist module from an import pane, which reads object streams, composite fonts and the other PDF filters) and `{ ocr }` (a function ({ name, type, bytes }) => text, which reads images and scanned pages); without it PNG, JPEG and scans are listed as not read. Each document comes out with its text, headings and pages, or with a status that says why it could not be read: unsupported, encrypted, scanned, empty, too-large. Give a list of { name, text } or { name, file } (a media value), or a single media value."
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"tests": [
|
|
96
|
+
{
|
|
97
|
+
"name": "html is text, scripts are gone",
|
|
98
|
+
"inputs": {
|
|
99
|
+
"documents": [
|
|
100
|
+
{
|
|
101
|
+
"name": "a.html",
|
|
102
|
+
"text": "<p>Hi <script>alert(1)</script>there</p><style>p{}</style>"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"expect": {
|
|
107
|
+
"result.documents": {
|
|
108
|
+
"matches": "\"text\":\"Hi there\""
|
|
109
|
+
},
|
|
110
|
+
"result.report": [
|
|
111
|
+
{
|
|
112
|
+
"name": "a.html",
|
|
113
|
+
"kind": "html",
|
|
114
|
+
"status": "ok",
|
|
115
|
+
"chars": 8
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "markdown headings are found",
|
|
122
|
+
"inputs": {
|
|
123
|
+
"documents": [
|
|
124
|
+
{
|
|
125
|
+
"name": "n.md",
|
|
126
|
+
"text": "# One\n\ntext\n\n## Two\n\nmore"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"expect": {
|
|
131
|
+
"result.documents": {
|
|
132
|
+
"matches": "\"headings\":\\[\\{\"level\":1,\"title\":\"One\",\"start\":0\\},\\{\"level\":2,\"title\":\"Two\",\"start\":13\\}\\]"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "what cannot be read says why",
|
|
138
|
+
"inputs": {
|
|
139
|
+
"documents": [
|
|
140
|
+
{
|
|
141
|
+
"name": "e.txt",
|
|
142
|
+
"text": " "
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "x.bin",
|
|
146
|
+
"text": "abc",
|
|
147
|
+
"kind": "rtf"
|
|
148
|
+
},
|
|
149
|
+
5
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"expect": {
|
|
153
|
+
"result.report": [
|
|
154
|
+
{
|
|
155
|
+
"name": "e.txt",
|
|
156
|
+
"kind": "text",
|
|
157
|
+
"status": "empty",
|
|
158
|
+
"chars": 0,
|
|
159
|
+
"reason": "no text was found"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "x.bin",
|
|
163
|
+
"kind": "unknown",
|
|
164
|
+
"status": "unsupported",
|
|
165
|
+
"chars": 0,
|
|
166
|
+
"reason": "unsupported kind \"rtf\": use text, markdown, html, pdf, docx, epub or image"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "document-3",
|
|
170
|
+
"kind": "unknown",
|
|
171
|
+
"status": "unsupported",
|
|
172
|
+
"chars": 0,
|
|
173
|
+
"reason": "not a document: give text, a file or { name, text | file }"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"hosts": []
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "chunk",
|
|
183
|
+
"title": "Chunk documents",
|
|
184
|
+
"description": "Split documents into chunks of up to `size` characters, on paragraph and sentence boundaries and never across a heading, repeating up to `overlap` characters of the previous chunk. Every chunk has a stable id (from its document name and text, so the same on every run and when other documents change) and its provenance: { doc, start, end, page, pageEnd, headings }. start/end are character positions in the extracted text, and `text` is exactly that span. Chunk text is run payload: the run log's retention policy applies to it. `report` holds names and counts only.",
|
|
185
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M4 2h6l3 3v9H4zM10 2v3h3M6 8h5M6 11h5\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
186
|
+
"canvas": {
|
|
187
|
+
"format": "viaframe-canvas",
|
|
188
|
+
"version": 3,
|
|
189
|
+
"name": "Chunk documents",
|
|
190
|
+
"panes": [
|
|
191
|
+
{
|
|
192
|
+
"id": "i_documents",
|
|
193
|
+
"type": "input",
|
|
194
|
+
"name": "documents",
|
|
195
|
+
"rect": {
|
|
196
|
+
"x": 0,
|
|
197
|
+
"y": 0,
|
|
198
|
+
"width": 240
|
|
199
|
+
},
|
|
200
|
+
"inputs": [],
|
|
201
|
+
"widget": {
|
|
202
|
+
"kind": "json",
|
|
203
|
+
"value": "[]"
|
|
204
|
+
},
|
|
205
|
+
"control": {
|
|
206
|
+
"group": "Settings"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "i_size",
|
|
211
|
+
"type": "input",
|
|
212
|
+
"name": "size",
|
|
213
|
+
"rect": {
|
|
214
|
+
"x": 0,
|
|
215
|
+
"y": 150,
|
|
216
|
+
"width": 240
|
|
217
|
+
},
|
|
218
|
+
"inputs": [],
|
|
219
|
+
"widget": {
|
|
220
|
+
"kind": "number",
|
|
221
|
+
"value": 800
|
|
222
|
+
},
|
|
223
|
+
"control": {
|
|
224
|
+
"group": "Settings"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "i_overlap",
|
|
229
|
+
"type": "input",
|
|
230
|
+
"name": "overlap",
|
|
231
|
+
"rect": {
|
|
232
|
+
"x": 0,
|
|
233
|
+
"y": 240,
|
|
234
|
+
"width": 240
|
|
235
|
+
},
|
|
236
|
+
"inputs": [],
|
|
237
|
+
"widget": {
|
|
238
|
+
"kind": "number",
|
|
239
|
+
"value": 100
|
|
240
|
+
},
|
|
241
|
+
"control": {
|
|
242
|
+
"group": "Settings"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "i_adapters",
|
|
247
|
+
"type": "input",
|
|
248
|
+
"name": "adapters",
|
|
249
|
+
"rect": {
|
|
250
|
+
"x": 0,
|
|
251
|
+
"y": 330,
|
|
252
|
+
"width": 240
|
|
253
|
+
},
|
|
254
|
+
"inputs": [],
|
|
255
|
+
"widget": {
|
|
256
|
+
"kind": "json",
|
|
257
|
+
"value": "null"
|
|
258
|
+
},
|
|
259
|
+
"control": {
|
|
260
|
+
"group": "Settings"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"id": "run",
|
|
265
|
+
"type": "eval",
|
|
266
|
+
"name": "result",
|
|
267
|
+
"rect": {
|
|
268
|
+
"x": 320,
|
|
269
|
+
"y": 0,
|
|
270
|
+
"width": 360
|
|
271
|
+
},
|
|
272
|
+
"inputs": [
|
|
273
|
+
{
|
|
274
|
+
"name": "documents",
|
|
275
|
+
"source": "i_documents"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "size",
|
|
279
|
+
"source": "i_size"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "overlap",
|
|
283
|
+
"source": "i_overlap"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "adapters",
|
|
287
|
+
"source": "i_adapters"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"autorun": true,
|
|
291
|
+
"mode": "function",
|
|
292
|
+
"view": "auto",
|
|
293
|
+
"outputs": [
|
|
294
|
+
{
|
|
295
|
+
"name": "chunks"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "report"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"code": "const items = Array.isArray(documents) ? documents : documents == null ? [] : [documents];\nif (items.length > docs.LIMITS.maxDocs) throw new Error(`${items.length} documents is over the limit of ${docs.LIMITS.maxDocs}`);\nconst brief = (d) => ({ name: d.name, kind: d.kind, status: d.status, chars: d.text.length, ...(d.reason ? { reason: d.reason } : {}), ...(d.pages ? { pages: d.pages.length } : {}), ...(d.warnings.length ? { warnings: d.warnings } : {}) });\nconst out = [];\nconst report = { documents: [], chunks: 0, truncated: false };\nfor (let i = 0; i < items.length; i++) {\n const doc = await docs.extractDocument(await docs.readSource(items[i], i), adapters ?? {});\n report.documents.push(brief(doc));\n if (doc.status !== \"ok\" && doc.status !== \"partial\") continue;\n for (const c of docs.chunkDocument(doc, { size, overlap })) {\n if (out.length >= docs.LIMITS.maxChunks) { report.truncated = true; break; }\n out.push(c);\n }\n}\nreport.chunks = out.length;\nreturn { chunks: out, report };",
|
|
302
|
+
"description": "Split documents into chunks of up to `size` characters, on paragraph and sentence boundaries and never across a heading, repeating up to `overlap` characters of the previous chunk. Every chunk has a stable id (from its document name and text, so the same on every run and when other documents change) and its provenance: { doc, start, end, page, pageEnd, headings }. start/end are character positions in the extracted text, and `text` is exactly that span. Chunk text is run payload: the run log's retention policy applies to it. `report` holds names and counts only."
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
"tests": [
|
|
307
|
+
{
|
|
308
|
+
"name": "chunks carry their span and heading path",
|
|
309
|
+
"inputs": {
|
|
310
|
+
"documents": [
|
|
311
|
+
{
|
|
312
|
+
"name": "guide.md",
|
|
313
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.\n\n## Retention\n\nChunk text is payload for the run log. The retention policy decides what the log keeps.\n"
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
"size": 80,
|
|
317
|
+
"overlap": 0
|
|
318
|
+
},
|
|
319
|
+
"expect": {
|
|
320
|
+
"result.report": {
|
|
321
|
+
"documents": [
|
|
322
|
+
{
|
|
323
|
+
"name": "guide.md",
|
|
324
|
+
"kind": "markdown",
|
|
325
|
+
"status": "ok",
|
|
326
|
+
"chars": 180
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"chunks": 3,
|
|
330
|
+
"truncated": false
|
|
331
|
+
},
|
|
332
|
+
"result.chunks": {
|
|
333
|
+
"matches": "\"doc\":\"guide.md\",\"index\":2,\"start\":131,\"end\":179,\"text\":\"The retention policy decides what the log keeps\\.\",\"headings\":\\[\"Guide\",\"Retention\"\\]"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "an unreadable document is reported, not chunked",
|
|
339
|
+
"inputs": {
|
|
340
|
+
"documents": [
|
|
341
|
+
{
|
|
342
|
+
"name": "z.txt",
|
|
343
|
+
"text": ""
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "pets.txt",
|
|
347
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim."
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"size": 800
|
|
351
|
+
},
|
|
352
|
+
"expect": {
|
|
353
|
+
"result.report": {
|
|
354
|
+
"documents": [
|
|
355
|
+
{
|
|
356
|
+
"name": "z.txt",
|
|
357
|
+
"kind": "text",
|
|
358
|
+
"status": "empty",
|
|
359
|
+
"chars": 0,
|
|
360
|
+
"reason": "no text was found"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "pets.txt",
|
|
364
|
+
"kind": "text",
|
|
365
|
+
"status": "ok",
|
|
366
|
+
"chars": 54
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"chunks": 1,
|
|
370
|
+
"truncated": false
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"hosts": []
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"id": "build-index",
|
|
379
|
+
"title": "Build document index",
|
|
380
|
+
"description": "Extract, chunk and embed documents into a searchable corpus, in this browser. The default embedder is a deterministic local one (hashed bag of words: lexical matching, no model, no network). `embedder: on-device-ai` also asks Chrome's built-in model, through viaframe's on-device AI consent, for keywords for each chunk; nothing leaves the device and a missing model is an error, never a fallback to a cloud. `model` replaces both with an embedder object you make in your own pane, such as `docs.endpointEmbedder({ http: fetch, url, model, dim, auth })` for a real embedding model behind an HTTP endpoint (that pane's fetch asks the network rules and `auth` names a stored API key; **every chunk's text is sent to that host**, so this pane stays offline unless you wire one). `adapters` are the optional `{ pdfjs, ocr }` of Extract documents. The pane remembers its last index while it runs, so a rerun reads again only documents whose content changed (`report.reused` / `rebuilt` / `removed`); wire an imported corpus into `previous` to continue from a file. `fingerprint` identifies the corpus. The index holds chunk text and vectors: it is run payload and not saved in the canvas file or link.",
|
|
381
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M2 3h12M2 7h12M2 11h8M12 11l2 2\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
382
|
+
"canvas": {
|
|
383
|
+
"format": "viaframe-canvas",
|
|
384
|
+
"version": 3,
|
|
385
|
+
"name": "Build document index",
|
|
386
|
+
"panes": [
|
|
387
|
+
{
|
|
388
|
+
"id": "i_documents",
|
|
389
|
+
"type": "input",
|
|
390
|
+
"name": "documents",
|
|
391
|
+
"rect": {
|
|
392
|
+
"x": 0,
|
|
393
|
+
"y": 0,
|
|
394
|
+
"width": 240
|
|
395
|
+
},
|
|
396
|
+
"inputs": [],
|
|
397
|
+
"widget": {
|
|
398
|
+
"kind": "json",
|
|
399
|
+
"value": "[]"
|
|
400
|
+
},
|
|
401
|
+
"control": {
|
|
402
|
+
"group": "Settings"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"id": "i_size",
|
|
407
|
+
"type": "input",
|
|
408
|
+
"name": "size",
|
|
409
|
+
"rect": {
|
|
410
|
+
"x": 0,
|
|
411
|
+
"y": 150,
|
|
412
|
+
"width": 240
|
|
413
|
+
},
|
|
414
|
+
"inputs": [],
|
|
415
|
+
"widget": {
|
|
416
|
+
"kind": "number",
|
|
417
|
+
"value": 800
|
|
418
|
+
},
|
|
419
|
+
"control": {
|
|
420
|
+
"group": "Settings"
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"id": "i_overlap",
|
|
425
|
+
"type": "input",
|
|
426
|
+
"name": "overlap",
|
|
427
|
+
"rect": {
|
|
428
|
+
"x": 0,
|
|
429
|
+
"y": 240,
|
|
430
|
+
"width": 240
|
|
431
|
+
},
|
|
432
|
+
"inputs": [],
|
|
433
|
+
"widget": {
|
|
434
|
+
"kind": "number",
|
|
435
|
+
"value": 100
|
|
436
|
+
},
|
|
437
|
+
"control": {
|
|
438
|
+
"group": "Settings"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"id": "i_embedder",
|
|
443
|
+
"type": "input",
|
|
444
|
+
"name": "embedder",
|
|
445
|
+
"rect": {
|
|
446
|
+
"x": 0,
|
|
447
|
+
"y": 330,
|
|
448
|
+
"width": 240
|
|
449
|
+
},
|
|
450
|
+
"inputs": [],
|
|
451
|
+
"widget": {
|
|
452
|
+
"kind": "select",
|
|
453
|
+
"value": "local",
|
|
454
|
+
"options": "local,on-device-ai"
|
|
455
|
+
},
|
|
456
|
+
"control": {
|
|
457
|
+
"group": "Options"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"id": "i_dim",
|
|
462
|
+
"type": "input",
|
|
463
|
+
"name": "dim",
|
|
464
|
+
"rect": {
|
|
465
|
+
"x": 0,
|
|
466
|
+
"y": 420,
|
|
467
|
+
"width": 240
|
|
468
|
+
},
|
|
469
|
+
"inputs": [],
|
|
470
|
+
"widget": {
|
|
471
|
+
"kind": "number",
|
|
472
|
+
"value": 512
|
|
473
|
+
},
|
|
474
|
+
"control": {
|
|
475
|
+
"group": "Settings"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"id": "i_previous",
|
|
480
|
+
"type": "input",
|
|
481
|
+
"name": "previous",
|
|
482
|
+
"rect": {
|
|
483
|
+
"x": 0,
|
|
484
|
+
"y": 510,
|
|
485
|
+
"width": 240
|
|
486
|
+
},
|
|
487
|
+
"inputs": [],
|
|
488
|
+
"widget": {
|
|
489
|
+
"kind": "json",
|
|
490
|
+
"value": "null"
|
|
491
|
+
},
|
|
492
|
+
"control": {
|
|
493
|
+
"group": "Settings"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"id": "i_model",
|
|
498
|
+
"type": "input",
|
|
499
|
+
"name": "model",
|
|
500
|
+
"rect": {
|
|
501
|
+
"x": 0,
|
|
502
|
+
"y": 660,
|
|
503
|
+
"width": 240
|
|
504
|
+
},
|
|
505
|
+
"inputs": [],
|
|
506
|
+
"widget": {
|
|
507
|
+
"kind": "json",
|
|
508
|
+
"value": "null"
|
|
509
|
+
},
|
|
510
|
+
"control": {
|
|
511
|
+
"group": "Settings"
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"id": "i_adapters",
|
|
516
|
+
"type": "input",
|
|
517
|
+
"name": "adapters",
|
|
518
|
+
"rect": {
|
|
519
|
+
"x": 0,
|
|
520
|
+
"y": 810,
|
|
521
|
+
"width": 240
|
|
522
|
+
},
|
|
523
|
+
"inputs": [],
|
|
524
|
+
"widget": {
|
|
525
|
+
"kind": "json",
|
|
526
|
+
"value": "null"
|
|
527
|
+
},
|
|
528
|
+
"control": {
|
|
529
|
+
"group": "Settings"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"id": "run",
|
|
534
|
+
"type": "eval",
|
|
535
|
+
"name": "result",
|
|
536
|
+
"rect": {
|
|
537
|
+
"x": 320,
|
|
538
|
+
"y": 0,
|
|
539
|
+
"width": 360
|
|
540
|
+
},
|
|
541
|
+
"inputs": [
|
|
542
|
+
{
|
|
543
|
+
"name": "documents",
|
|
544
|
+
"source": "i_documents"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
"name": "size",
|
|
548
|
+
"source": "i_size"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"name": "overlap",
|
|
552
|
+
"source": "i_overlap"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"name": "embedder",
|
|
556
|
+
"source": "i_embedder"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"name": "dim",
|
|
560
|
+
"source": "i_dim"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"name": "previous",
|
|
564
|
+
"source": "i_previous"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "model",
|
|
568
|
+
"source": "i_model"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"name": "adapters",
|
|
572
|
+
"source": "i_adapters"
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
"autorun": true,
|
|
576
|
+
"mode": "function",
|
|
577
|
+
"view": "auto",
|
|
578
|
+
"outputs": [
|
|
579
|
+
{
|
|
580
|
+
"name": "index"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
"name": "report"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "fingerprint"
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
"code": "const items = Array.isArray(documents) ? documents : documents == null ? [] : [documents];\nif (items.length > docs.LIMITS.maxDocs) throw new Error(`${items.length} documents is over the limit of ${docs.LIMITS.maxDocs}`);\nconst embedderObject = model ? model : embedder === \"on-device-ai\"\n ? docs.onDeviceEmbedder({ languageModel: typeof LanguageModel === \"undefined\" ? undefined : LanguageModel, dim })\n : docs.hashedEmbedder({ dim });\nconst { index, report } = await docs.buildIndex(items, { size, overlap, embedder: embedderObject, previous: previous ?? state.index ?? null, adapters: adapters ?? {} });\nstate.index = index;\nreturn { index, report, fingerprint: index.fingerprint };",
|
|
590
|
+
"description": "Extract, chunk and embed documents into a searchable corpus, in this browser. The default embedder is a deterministic local one (hashed bag of words: lexical matching, no model, no network). `embedder: on-device-ai` also asks Chrome's built-in model, through viaframe's on-device AI consent, for keywords for each chunk; nothing leaves the device and a missing model is an error, never a fallback to a cloud. `model` replaces both with an embedder object you make in your own pane, such as `docs.endpointEmbedder({ http: fetch, url, model, dim, auth })` for a real embedding model behind an HTTP endpoint (that pane's fetch asks the network rules and `auth` names a stored API key; **every chunk's text is sent to that host**, so this pane stays offline unless you wire one). `adapters` are the optional `{ pdfjs, ocr }` of Extract documents. The pane remembers its last index while it runs, so a rerun reads again only documents whose content changed (`report.reused` / `rebuilt` / `removed`); wire an imported corpus into `previous` to continue from a file. `fingerprint` identifies the corpus. The index holds chunk text and vectors: it is run payload and not saved in the canvas file or link."
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"tests": [
|
|
595
|
+
{
|
|
596
|
+
"name": "documents become chunks with a corpus fingerprint",
|
|
597
|
+
"inputs": {
|
|
598
|
+
"documents": [
|
|
599
|
+
{
|
|
600
|
+
"name": "guide.md",
|
|
601
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.\n\n## Retention\n\nChunk text is payload for the run log. The retention policy decides what the log keeps.\n"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "pets.txt",
|
|
605
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim."
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"size": 80,
|
|
609
|
+
"overlap": 0
|
|
610
|
+
},
|
|
611
|
+
"expect": {
|
|
612
|
+
"result.report": {
|
|
613
|
+
"matches": "\"rebuilt\":\\[\"guide.md\",\"pets.txt\"\\],\"removed\":\\[\\],\"skipped\":\\[\\],\"truncated\":false,\"warnings\":\\[\\],\"fingerprint\":\"[0-9a-f]{14}\",\"documents\":2,\"chunks\":4"
|
|
614
|
+
},
|
|
615
|
+
"result.fingerprint": {
|
|
616
|
+
"matches": "^[0-9a-f]{14}$"
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"name": "a duplicate name and an unsupported file are listed",
|
|
622
|
+
"inputs": {
|
|
623
|
+
"documents": [
|
|
624
|
+
{
|
|
625
|
+
"name": "a.txt",
|
|
626
|
+
"text": "one"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "a.txt",
|
|
630
|
+
"text": "two"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "x.png",
|
|
634
|
+
"text": "y",
|
|
635
|
+
"type": "image/png"
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
"expect": {
|
|
640
|
+
"result.report": {
|
|
641
|
+
"matches": "\"skipped\":\\[\\{\"name\":\"a.txt\",\"status\":\"unsupported\",\"reason\":\"a second document with this name: names must be unique, they are the citations\"\\},\\{\"name\":\"x.png\",\"status\":\"unsupported\",\"reason\":\"unsupported type image/png: use text, Markdown, HTML, PDF, DOCX or EPUB \\(images need an ocr adapter\\)\"\\}\\]"
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
"hosts": []
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"id": "search",
|
|
650
|
+
"title": "Search documents",
|
|
651
|
+
"description": "The top `k` (at most 50) chunks for a query, best first. `mode` is vector (cosine similarity of the embeddings, the default), bm25 (word statistics only: no embedder runs) or hybrid (`alpha` of the cosine score plus the rest of the BM25 score); `ann` scores only the nearest lists of a coarse list index, which is faster on big corpora and approximate. An index made with an endpoint embedder is searched with the same one: wire it into `model`. Equal scores order by document name, then position, so the same corpus and query always give the same list. Every result has its text, score and provenance ({ doc, start, end, page, headings, fingerprint }) and a one-line `citation`. `context` is the passages as one text, each marked [n] with its citation, ready to give an agent. Scores under `minScore` are dropped (a hashed embedder can match unrelated words by chance at low scores). A query with no matching words returns nothing.",
|
|
652
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M7 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM10 10l4 4\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
653
|
+
"canvas": {
|
|
654
|
+
"format": "viaframe-canvas",
|
|
655
|
+
"version": 3,
|
|
656
|
+
"name": "Search documents",
|
|
657
|
+
"panes": [
|
|
658
|
+
{
|
|
659
|
+
"id": "i_index",
|
|
660
|
+
"type": "input",
|
|
661
|
+
"name": "index",
|
|
662
|
+
"rect": {
|
|
663
|
+
"x": 0,
|
|
664
|
+
"y": 0,
|
|
665
|
+
"width": 240
|
|
666
|
+
},
|
|
667
|
+
"inputs": [],
|
|
668
|
+
"widget": {
|
|
669
|
+
"kind": "json",
|
|
670
|
+
"value": "null"
|
|
671
|
+
},
|
|
672
|
+
"control": {
|
|
673
|
+
"group": "Settings"
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"id": "i_query",
|
|
678
|
+
"type": "input",
|
|
679
|
+
"name": "query",
|
|
680
|
+
"rect": {
|
|
681
|
+
"x": 0,
|
|
682
|
+
"y": 150,
|
|
683
|
+
"width": 240
|
|
684
|
+
},
|
|
685
|
+
"inputs": [],
|
|
686
|
+
"widget": {
|
|
687
|
+
"kind": "text",
|
|
688
|
+
"value": "retention policy"
|
|
689
|
+
},
|
|
690
|
+
"control": {
|
|
691
|
+
"group": "Settings"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"id": "i_k",
|
|
696
|
+
"type": "input",
|
|
697
|
+
"name": "k",
|
|
698
|
+
"rect": {
|
|
699
|
+
"x": 0,
|
|
700
|
+
"y": 300,
|
|
701
|
+
"width": 240
|
|
702
|
+
},
|
|
703
|
+
"inputs": [],
|
|
704
|
+
"widget": {
|
|
705
|
+
"kind": "number",
|
|
706
|
+
"value": 5
|
|
707
|
+
},
|
|
708
|
+
"control": {
|
|
709
|
+
"group": "Settings"
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
"id": "i_minScore",
|
|
714
|
+
"type": "input",
|
|
715
|
+
"name": "minScore",
|
|
716
|
+
"rect": {
|
|
717
|
+
"x": 0,
|
|
718
|
+
"y": 390,
|
|
719
|
+
"width": 240
|
|
720
|
+
},
|
|
721
|
+
"inputs": [],
|
|
722
|
+
"widget": {
|
|
723
|
+
"kind": "number",
|
|
724
|
+
"value": 0.05
|
|
725
|
+
},
|
|
726
|
+
"control": {
|
|
727
|
+
"group": "Settings"
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"id": "i_mode",
|
|
732
|
+
"type": "input",
|
|
733
|
+
"name": "mode",
|
|
734
|
+
"rect": {
|
|
735
|
+
"x": 0,
|
|
736
|
+
"y": 480,
|
|
737
|
+
"width": 240
|
|
738
|
+
},
|
|
739
|
+
"inputs": [],
|
|
740
|
+
"widget": {
|
|
741
|
+
"kind": "select",
|
|
742
|
+
"value": "vector",
|
|
743
|
+
"options": "vector,hybrid,bm25"
|
|
744
|
+
},
|
|
745
|
+
"control": {
|
|
746
|
+
"group": "Options"
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"id": "i_alpha",
|
|
751
|
+
"type": "input",
|
|
752
|
+
"name": "alpha",
|
|
753
|
+
"rect": {
|
|
754
|
+
"x": 0,
|
|
755
|
+
"y": 570,
|
|
756
|
+
"width": 240
|
|
757
|
+
},
|
|
758
|
+
"inputs": [],
|
|
759
|
+
"widget": {
|
|
760
|
+
"kind": "number",
|
|
761
|
+
"value": 0.5
|
|
762
|
+
},
|
|
763
|
+
"control": {
|
|
764
|
+
"group": "Settings"
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"id": "i_ann",
|
|
769
|
+
"type": "input",
|
|
770
|
+
"name": "ann",
|
|
771
|
+
"rect": {
|
|
772
|
+
"x": 0,
|
|
773
|
+
"y": 660,
|
|
774
|
+
"width": 240
|
|
775
|
+
},
|
|
776
|
+
"inputs": [],
|
|
777
|
+
"widget": {
|
|
778
|
+
"kind": "select",
|
|
779
|
+
"value": "off",
|
|
780
|
+
"options": "off,on"
|
|
781
|
+
},
|
|
782
|
+
"control": {
|
|
783
|
+
"group": "Options"
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"id": "i_model",
|
|
788
|
+
"type": "input",
|
|
789
|
+
"name": "model",
|
|
790
|
+
"rect": {
|
|
791
|
+
"x": 0,
|
|
792
|
+
"y": 750,
|
|
793
|
+
"width": 240
|
|
794
|
+
},
|
|
795
|
+
"inputs": [],
|
|
796
|
+
"widget": {
|
|
797
|
+
"kind": "json",
|
|
798
|
+
"value": "null"
|
|
799
|
+
},
|
|
800
|
+
"control": {
|
|
801
|
+
"group": "Settings"
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
"id": "run",
|
|
806
|
+
"type": "eval",
|
|
807
|
+
"name": "result",
|
|
808
|
+
"rect": {
|
|
809
|
+
"x": 320,
|
|
810
|
+
"y": 0,
|
|
811
|
+
"width": 360
|
|
812
|
+
},
|
|
813
|
+
"inputs": [
|
|
814
|
+
{
|
|
815
|
+
"name": "index",
|
|
816
|
+
"source": "i_index"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"name": "query",
|
|
820
|
+
"source": "i_query"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"name": "k",
|
|
824
|
+
"source": "i_k"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"name": "minScore",
|
|
828
|
+
"source": "i_minScore"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"name": "mode",
|
|
832
|
+
"source": "i_mode"
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
"name": "alpha",
|
|
836
|
+
"source": "i_alpha"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"name": "ann",
|
|
840
|
+
"source": "i_ann"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"name": "model",
|
|
844
|
+
"source": "i_model"
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
"autorun": true,
|
|
848
|
+
"mode": "function",
|
|
849
|
+
"view": "auto",
|
|
850
|
+
"outputs": [
|
|
851
|
+
{
|
|
852
|
+
"name": "results"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"name": "context"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"name": "report"
|
|
859
|
+
}
|
|
860
|
+
],
|
|
861
|
+
"code": "if (!index) return skip(\"no index yet: wire a Build document index or Import corpus pane\");\nconst results = await docs.search(index, query, { k, minScore, mode, alpha, ann: ann === \"on\", embedder: model ? model : index.embedder.id.startsWith(\"on-device\") ? docs.onDeviceEmbedder({ languageModel: typeof LanguageModel === \"undefined\" ? undefined : LanguageModel, dim: index.embedder.dim }) : undefined });\nreturn { results, context: docs.contextOf(results), report: { query, mode, returned: results.length, corpus: index.fingerprint, embedder: index.embedder.id, documents: index.documents.length, chunks: index.chunks.length } };",
|
|
862
|
+
"description": "The top `k` (at most 50) chunks for a query, best first. `mode` is vector (cosine similarity of the embeddings, the default), bm25 (word statistics only: no embedder runs) or hybrid (`alpha` of the cosine score plus the rest of the BM25 score); `ann` scores only the nearest lists of a coarse list index, which is faster on big corpora and approximate. An index made with an endpoint embedder is searched with the same one: wire it into `model`. Equal scores order by document name, then position, so the same corpus and query always give the same list. Every result has its text, score and provenance ({ doc, start, end, page, headings, fingerprint }) and a one-line `citation`. `context` is the passages as one text, each marked [n] with its citation, ready to give an agent. Scores under `minScore` are dropped (a hashed embedder can match unrelated words by chance at low scores). A query with no matching words returns nothing."
|
|
863
|
+
}
|
|
864
|
+
]
|
|
865
|
+
},
|
|
866
|
+
"tests": [
|
|
867
|
+
{
|
|
868
|
+
"name": "the nearest chunk comes first, with its citation",
|
|
869
|
+
"inputs": {
|
|
870
|
+
"index": {
|
|
871
|
+
"format": "viaframe-doc-index",
|
|
872
|
+
"version": 1,
|
|
873
|
+
"embedder": {
|
|
874
|
+
"id": "hashed-bow-64",
|
|
875
|
+
"dim": 64
|
|
876
|
+
},
|
|
877
|
+
"options": {
|
|
878
|
+
"size": 80,
|
|
879
|
+
"overlap": 0
|
|
880
|
+
},
|
|
881
|
+
"documents": [
|
|
882
|
+
{
|
|
883
|
+
"name": "guide.md",
|
|
884
|
+
"kind": "markdown",
|
|
885
|
+
"status": "ok",
|
|
886
|
+
"source": "1db8ec7e8350c5",
|
|
887
|
+
"fingerprint": "16baa692b5a4ea",
|
|
888
|
+
"chars": 180,
|
|
889
|
+
"chunks": 3
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"name": "pets.txt",
|
|
893
|
+
"kind": "text",
|
|
894
|
+
"status": "ok",
|
|
895
|
+
"source": "127c50544eac5f",
|
|
896
|
+
"fingerprint": "135380ee2fb211",
|
|
897
|
+
"chars": 54,
|
|
898
|
+
"chunks": 1
|
|
899
|
+
}
|
|
900
|
+
],
|
|
901
|
+
"chunks": [
|
|
902
|
+
{
|
|
903
|
+
"id": "c_0ae5dd579108",
|
|
904
|
+
"doc": "guide.md",
|
|
905
|
+
"index": 0,
|
|
906
|
+
"start": 0,
|
|
907
|
+
"end": 76,
|
|
908
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
909
|
+
"headings": [
|
|
910
|
+
"Guide"
|
|
911
|
+
],
|
|
912
|
+
"v": [
|
|
913
|
+
0,
|
|
914
|
+
0,
|
|
915
|
+
0,
|
|
916
|
+
0,
|
|
917
|
+
-0.3333,
|
|
918
|
+
0,
|
|
919
|
+
0,
|
|
920
|
+
0,
|
|
921
|
+
-0.3333,
|
|
922
|
+
0,
|
|
923
|
+
-0.3333,
|
|
924
|
+
0.3333,
|
|
925
|
+
0,
|
|
926
|
+
0.3333,
|
|
927
|
+
0,
|
|
928
|
+
0.3333,
|
|
929
|
+
0,
|
|
930
|
+
0,
|
|
931
|
+
0,
|
|
932
|
+
0,
|
|
933
|
+
-0.3333,
|
|
934
|
+
0,
|
|
935
|
+
0,
|
|
936
|
+
0,
|
|
937
|
+
0,
|
|
938
|
+
0,
|
|
939
|
+
0,
|
|
940
|
+
0,
|
|
941
|
+
0,
|
|
942
|
+
0,
|
|
943
|
+
0,
|
|
944
|
+
0,
|
|
945
|
+
0,
|
|
946
|
+
0,
|
|
947
|
+
0,
|
|
948
|
+
0,
|
|
949
|
+
0,
|
|
950
|
+
0,
|
|
951
|
+
0,
|
|
952
|
+
0,
|
|
953
|
+
0,
|
|
954
|
+
0,
|
|
955
|
+
-0.3333,
|
|
956
|
+
0,
|
|
957
|
+
0,
|
|
958
|
+
0,
|
|
959
|
+
0,
|
|
960
|
+
0,
|
|
961
|
+
0,
|
|
962
|
+
0,
|
|
963
|
+
0,
|
|
964
|
+
0,
|
|
965
|
+
0,
|
|
966
|
+
0,
|
|
967
|
+
0,
|
|
968
|
+
0,
|
|
969
|
+
-0.3333,
|
|
970
|
+
0,
|
|
971
|
+
0,
|
|
972
|
+
0,
|
|
973
|
+
0,
|
|
974
|
+
0,
|
|
975
|
+
0,
|
|
976
|
+
0
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"id": "c_19cb7ccbf03d",
|
|
981
|
+
"doc": "guide.md",
|
|
982
|
+
"index": 1,
|
|
983
|
+
"start": 78,
|
|
984
|
+
"end": 130,
|
|
985
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
986
|
+
"headings": [
|
|
987
|
+
"Guide",
|
|
988
|
+
"Retention"
|
|
989
|
+
],
|
|
990
|
+
"v": [
|
|
991
|
+
0,
|
|
992
|
+
0,
|
|
993
|
+
-0.3536,
|
|
994
|
+
0,
|
|
995
|
+
0,
|
|
996
|
+
0,
|
|
997
|
+
0,
|
|
998
|
+
0,
|
|
999
|
+
0,
|
|
1000
|
+
0,
|
|
1001
|
+
-0.3536,
|
|
1002
|
+
0,
|
|
1003
|
+
0,
|
|
1004
|
+
0,
|
|
1005
|
+
0,
|
|
1006
|
+
0,
|
|
1007
|
+
0,
|
|
1008
|
+
0.7071,
|
|
1009
|
+
0,
|
|
1010
|
+
0,
|
|
1011
|
+
0,
|
|
1012
|
+
0,
|
|
1013
|
+
0,
|
|
1014
|
+
0,
|
|
1015
|
+
0,
|
|
1016
|
+
0,
|
|
1017
|
+
0,
|
|
1018
|
+
0,
|
|
1019
|
+
0,
|
|
1020
|
+
0,
|
|
1021
|
+
0,
|
|
1022
|
+
0,
|
|
1023
|
+
0,
|
|
1024
|
+
0,
|
|
1025
|
+
0,
|
|
1026
|
+
0,
|
|
1027
|
+
0,
|
|
1028
|
+
0.3536,
|
|
1029
|
+
0,
|
|
1030
|
+
0,
|
|
1031
|
+
0,
|
|
1032
|
+
0,
|
|
1033
|
+
0,
|
|
1034
|
+
0,
|
|
1035
|
+
0,
|
|
1036
|
+
0,
|
|
1037
|
+
0,
|
|
1038
|
+
0,
|
|
1039
|
+
0,
|
|
1040
|
+
0,
|
|
1041
|
+
0,
|
|
1042
|
+
0,
|
|
1043
|
+
0,
|
|
1044
|
+
0,
|
|
1045
|
+
0,
|
|
1046
|
+
0,
|
|
1047
|
+
0,
|
|
1048
|
+
0,
|
|
1049
|
+
0,
|
|
1050
|
+
0,
|
|
1051
|
+
0,
|
|
1052
|
+
0,
|
|
1053
|
+
-0.3536,
|
|
1054
|
+
0
|
|
1055
|
+
]
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"id": "c_060a354910f6",
|
|
1059
|
+
"doc": "guide.md",
|
|
1060
|
+
"index": 2,
|
|
1061
|
+
"start": 131,
|
|
1062
|
+
"end": 179,
|
|
1063
|
+
"text": "The retention policy decides what the log keeps.",
|
|
1064
|
+
"headings": [
|
|
1065
|
+
"Guide",
|
|
1066
|
+
"Retention"
|
|
1067
|
+
],
|
|
1068
|
+
"v": [
|
|
1069
|
+
0,
|
|
1070
|
+
0,
|
|
1071
|
+
0,
|
|
1072
|
+
0,
|
|
1073
|
+
0,
|
|
1074
|
+
0,
|
|
1075
|
+
0,
|
|
1076
|
+
0,
|
|
1077
|
+
-0.3536,
|
|
1078
|
+
0,
|
|
1079
|
+
0,
|
|
1080
|
+
0,
|
|
1081
|
+
0,
|
|
1082
|
+
0,
|
|
1083
|
+
0,
|
|
1084
|
+
0,
|
|
1085
|
+
0,
|
|
1086
|
+
0.7071,
|
|
1087
|
+
0,
|
|
1088
|
+
0,
|
|
1089
|
+
0,
|
|
1090
|
+
0,
|
|
1091
|
+
0,
|
|
1092
|
+
0,
|
|
1093
|
+
0,
|
|
1094
|
+
0,
|
|
1095
|
+
0,
|
|
1096
|
+
0,
|
|
1097
|
+
0,
|
|
1098
|
+
0,
|
|
1099
|
+
0,
|
|
1100
|
+
0,
|
|
1101
|
+
0,
|
|
1102
|
+
0.3536,
|
|
1103
|
+
0,
|
|
1104
|
+
0,
|
|
1105
|
+
0,
|
|
1106
|
+
0,
|
|
1107
|
+
0,
|
|
1108
|
+
0,
|
|
1109
|
+
0,
|
|
1110
|
+
0,
|
|
1111
|
+
0,
|
|
1112
|
+
0,
|
|
1113
|
+
0,
|
|
1114
|
+
0,
|
|
1115
|
+
0,
|
|
1116
|
+
0.3536,
|
|
1117
|
+
0,
|
|
1118
|
+
0,
|
|
1119
|
+
0,
|
|
1120
|
+
0,
|
|
1121
|
+
0,
|
|
1122
|
+
0,
|
|
1123
|
+
0,
|
|
1124
|
+
0,
|
|
1125
|
+
0,
|
|
1126
|
+
0,
|
|
1127
|
+
0,
|
|
1128
|
+
0,
|
|
1129
|
+
0,
|
|
1130
|
+
0,
|
|
1131
|
+
0,
|
|
1132
|
+
0.3536
|
|
1133
|
+
]
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
"id": "c_0f69d5c10e0f",
|
|
1137
|
+
"doc": "pets.txt",
|
|
1138
|
+
"index": 0,
|
|
1139
|
+
"start": 0,
|
|
1140
|
+
"end": 54,
|
|
1141
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
1142
|
+
"headings": [],
|
|
1143
|
+
"v": [
|
|
1144
|
+
0,
|
|
1145
|
+
0,
|
|
1146
|
+
0,
|
|
1147
|
+
0,
|
|
1148
|
+
0,
|
|
1149
|
+
0,
|
|
1150
|
+
0,
|
|
1151
|
+
0.2887,
|
|
1152
|
+
0,
|
|
1153
|
+
0.2887,
|
|
1154
|
+
0,
|
|
1155
|
+
0,
|
|
1156
|
+
0,
|
|
1157
|
+
0.2887,
|
|
1158
|
+
0,
|
|
1159
|
+
0,
|
|
1160
|
+
0,
|
|
1161
|
+
0,
|
|
1162
|
+
-0.5774,
|
|
1163
|
+
0,
|
|
1164
|
+
0,
|
|
1165
|
+
0,
|
|
1166
|
+
0,
|
|
1167
|
+
0,
|
|
1168
|
+
0,
|
|
1169
|
+
0,
|
|
1170
|
+
0,
|
|
1171
|
+
0,
|
|
1172
|
+
0,
|
|
1173
|
+
0,
|
|
1174
|
+
-0.2887,
|
|
1175
|
+
0,
|
|
1176
|
+
0,
|
|
1177
|
+
0,
|
|
1178
|
+
0,
|
|
1179
|
+
0.5774,
|
|
1180
|
+
0,
|
|
1181
|
+
0,
|
|
1182
|
+
0,
|
|
1183
|
+
0,
|
|
1184
|
+
0,
|
|
1185
|
+
0,
|
|
1186
|
+
0,
|
|
1187
|
+
0,
|
|
1188
|
+
0,
|
|
1189
|
+
0,
|
|
1190
|
+
0,
|
|
1191
|
+
0,
|
|
1192
|
+
0,
|
|
1193
|
+
0,
|
|
1194
|
+
0,
|
|
1195
|
+
0,
|
|
1196
|
+
0,
|
|
1197
|
+
0,
|
|
1198
|
+
0,
|
|
1199
|
+
0,
|
|
1200
|
+
0,
|
|
1201
|
+
0,
|
|
1202
|
+
0,
|
|
1203
|
+
0,
|
|
1204
|
+
0,
|
|
1205
|
+
0,
|
|
1206
|
+
0,
|
|
1207
|
+
0
|
|
1208
|
+
]
|
|
1209
|
+
}
|
|
1210
|
+
],
|
|
1211
|
+
"fingerprint": "0dd4e6e20683af"
|
|
1212
|
+
},
|
|
1213
|
+
"query": "retention policy",
|
|
1214
|
+
"k": 2
|
|
1215
|
+
},
|
|
1216
|
+
"expect": {
|
|
1217
|
+
"result.results": {
|
|
1218
|
+
"matches": "^\\[\\{\"rank\":1,\"score\":[0-9.]+,\"id\":\"c_[0-9a-f]{12}\",\"text\":\"The retention policy decides what the log keeps\\.\",\"provenance\":\\{\"doc\":\"guide.md\""
|
|
1219
|
+
},
|
|
1220
|
+
"result.context": {
|
|
1221
|
+
"matches": "^\\[1\\] guide\\.md § Guide > Retention \\[\\d+-\\d+\\]\\nThe retention policy"
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"name": "bm25 matches words only, and says so",
|
|
1227
|
+
"inputs": {
|
|
1228
|
+
"index": {
|
|
1229
|
+
"format": "viaframe-doc-index",
|
|
1230
|
+
"version": 1,
|
|
1231
|
+
"embedder": {
|
|
1232
|
+
"id": "hashed-bow-64",
|
|
1233
|
+
"dim": 64
|
|
1234
|
+
},
|
|
1235
|
+
"options": {
|
|
1236
|
+
"size": 80,
|
|
1237
|
+
"overlap": 0
|
|
1238
|
+
},
|
|
1239
|
+
"documents": [
|
|
1240
|
+
{
|
|
1241
|
+
"name": "guide.md",
|
|
1242
|
+
"kind": "markdown",
|
|
1243
|
+
"status": "ok",
|
|
1244
|
+
"source": "1db8ec7e8350c5",
|
|
1245
|
+
"fingerprint": "16baa692b5a4ea",
|
|
1246
|
+
"chars": 180,
|
|
1247
|
+
"chunks": 3
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"name": "pets.txt",
|
|
1251
|
+
"kind": "text",
|
|
1252
|
+
"status": "ok",
|
|
1253
|
+
"source": "127c50544eac5f",
|
|
1254
|
+
"fingerprint": "135380ee2fb211",
|
|
1255
|
+
"chars": 54,
|
|
1256
|
+
"chunks": 1
|
|
1257
|
+
}
|
|
1258
|
+
],
|
|
1259
|
+
"chunks": [
|
|
1260
|
+
{
|
|
1261
|
+
"id": "c_0ae5dd579108",
|
|
1262
|
+
"doc": "guide.md",
|
|
1263
|
+
"index": 0,
|
|
1264
|
+
"start": 0,
|
|
1265
|
+
"end": 76,
|
|
1266
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
1267
|
+
"headings": [
|
|
1268
|
+
"Guide"
|
|
1269
|
+
],
|
|
1270
|
+
"v": [
|
|
1271
|
+
0,
|
|
1272
|
+
0,
|
|
1273
|
+
0,
|
|
1274
|
+
0,
|
|
1275
|
+
-0.3333,
|
|
1276
|
+
0,
|
|
1277
|
+
0,
|
|
1278
|
+
0,
|
|
1279
|
+
-0.3333,
|
|
1280
|
+
0,
|
|
1281
|
+
-0.3333,
|
|
1282
|
+
0.3333,
|
|
1283
|
+
0,
|
|
1284
|
+
0.3333,
|
|
1285
|
+
0,
|
|
1286
|
+
0.3333,
|
|
1287
|
+
0,
|
|
1288
|
+
0,
|
|
1289
|
+
0,
|
|
1290
|
+
0,
|
|
1291
|
+
-0.3333,
|
|
1292
|
+
0,
|
|
1293
|
+
0,
|
|
1294
|
+
0,
|
|
1295
|
+
0,
|
|
1296
|
+
0,
|
|
1297
|
+
0,
|
|
1298
|
+
0,
|
|
1299
|
+
0,
|
|
1300
|
+
0,
|
|
1301
|
+
0,
|
|
1302
|
+
0,
|
|
1303
|
+
0,
|
|
1304
|
+
0,
|
|
1305
|
+
0,
|
|
1306
|
+
0,
|
|
1307
|
+
0,
|
|
1308
|
+
0,
|
|
1309
|
+
0,
|
|
1310
|
+
0,
|
|
1311
|
+
0,
|
|
1312
|
+
0,
|
|
1313
|
+
-0.3333,
|
|
1314
|
+
0,
|
|
1315
|
+
0,
|
|
1316
|
+
0,
|
|
1317
|
+
0,
|
|
1318
|
+
0,
|
|
1319
|
+
0,
|
|
1320
|
+
0,
|
|
1321
|
+
0,
|
|
1322
|
+
0,
|
|
1323
|
+
0,
|
|
1324
|
+
0,
|
|
1325
|
+
0,
|
|
1326
|
+
0,
|
|
1327
|
+
-0.3333,
|
|
1328
|
+
0,
|
|
1329
|
+
0,
|
|
1330
|
+
0,
|
|
1331
|
+
0,
|
|
1332
|
+
0,
|
|
1333
|
+
0,
|
|
1334
|
+
0
|
|
1335
|
+
]
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
"id": "c_19cb7ccbf03d",
|
|
1339
|
+
"doc": "guide.md",
|
|
1340
|
+
"index": 1,
|
|
1341
|
+
"start": 78,
|
|
1342
|
+
"end": 130,
|
|
1343
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
1344
|
+
"headings": [
|
|
1345
|
+
"Guide",
|
|
1346
|
+
"Retention"
|
|
1347
|
+
],
|
|
1348
|
+
"v": [
|
|
1349
|
+
0,
|
|
1350
|
+
0,
|
|
1351
|
+
-0.3536,
|
|
1352
|
+
0,
|
|
1353
|
+
0,
|
|
1354
|
+
0,
|
|
1355
|
+
0,
|
|
1356
|
+
0,
|
|
1357
|
+
0,
|
|
1358
|
+
0,
|
|
1359
|
+
-0.3536,
|
|
1360
|
+
0,
|
|
1361
|
+
0,
|
|
1362
|
+
0,
|
|
1363
|
+
0,
|
|
1364
|
+
0,
|
|
1365
|
+
0,
|
|
1366
|
+
0.7071,
|
|
1367
|
+
0,
|
|
1368
|
+
0,
|
|
1369
|
+
0,
|
|
1370
|
+
0,
|
|
1371
|
+
0,
|
|
1372
|
+
0,
|
|
1373
|
+
0,
|
|
1374
|
+
0,
|
|
1375
|
+
0,
|
|
1376
|
+
0,
|
|
1377
|
+
0,
|
|
1378
|
+
0,
|
|
1379
|
+
0,
|
|
1380
|
+
0,
|
|
1381
|
+
0,
|
|
1382
|
+
0,
|
|
1383
|
+
0,
|
|
1384
|
+
0,
|
|
1385
|
+
0,
|
|
1386
|
+
0.3536,
|
|
1387
|
+
0,
|
|
1388
|
+
0,
|
|
1389
|
+
0,
|
|
1390
|
+
0,
|
|
1391
|
+
0,
|
|
1392
|
+
0,
|
|
1393
|
+
0,
|
|
1394
|
+
0,
|
|
1395
|
+
0,
|
|
1396
|
+
0,
|
|
1397
|
+
0,
|
|
1398
|
+
0,
|
|
1399
|
+
0,
|
|
1400
|
+
0,
|
|
1401
|
+
0,
|
|
1402
|
+
0,
|
|
1403
|
+
0,
|
|
1404
|
+
0,
|
|
1405
|
+
0,
|
|
1406
|
+
0,
|
|
1407
|
+
0,
|
|
1408
|
+
0,
|
|
1409
|
+
0,
|
|
1410
|
+
0,
|
|
1411
|
+
-0.3536,
|
|
1412
|
+
0
|
|
1413
|
+
]
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
"id": "c_060a354910f6",
|
|
1417
|
+
"doc": "guide.md",
|
|
1418
|
+
"index": 2,
|
|
1419
|
+
"start": 131,
|
|
1420
|
+
"end": 179,
|
|
1421
|
+
"text": "The retention policy decides what the log keeps.",
|
|
1422
|
+
"headings": [
|
|
1423
|
+
"Guide",
|
|
1424
|
+
"Retention"
|
|
1425
|
+
],
|
|
1426
|
+
"v": [
|
|
1427
|
+
0,
|
|
1428
|
+
0,
|
|
1429
|
+
0,
|
|
1430
|
+
0,
|
|
1431
|
+
0,
|
|
1432
|
+
0,
|
|
1433
|
+
0,
|
|
1434
|
+
0,
|
|
1435
|
+
-0.3536,
|
|
1436
|
+
0,
|
|
1437
|
+
0,
|
|
1438
|
+
0,
|
|
1439
|
+
0,
|
|
1440
|
+
0,
|
|
1441
|
+
0,
|
|
1442
|
+
0,
|
|
1443
|
+
0,
|
|
1444
|
+
0.7071,
|
|
1445
|
+
0,
|
|
1446
|
+
0,
|
|
1447
|
+
0,
|
|
1448
|
+
0,
|
|
1449
|
+
0,
|
|
1450
|
+
0,
|
|
1451
|
+
0,
|
|
1452
|
+
0,
|
|
1453
|
+
0,
|
|
1454
|
+
0,
|
|
1455
|
+
0,
|
|
1456
|
+
0,
|
|
1457
|
+
0,
|
|
1458
|
+
0,
|
|
1459
|
+
0,
|
|
1460
|
+
0.3536,
|
|
1461
|
+
0,
|
|
1462
|
+
0,
|
|
1463
|
+
0,
|
|
1464
|
+
0,
|
|
1465
|
+
0,
|
|
1466
|
+
0,
|
|
1467
|
+
0,
|
|
1468
|
+
0,
|
|
1469
|
+
0,
|
|
1470
|
+
0,
|
|
1471
|
+
0,
|
|
1472
|
+
0,
|
|
1473
|
+
0,
|
|
1474
|
+
0.3536,
|
|
1475
|
+
0,
|
|
1476
|
+
0,
|
|
1477
|
+
0,
|
|
1478
|
+
0,
|
|
1479
|
+
0,
|
|
1480
|
+
0,
|
|
1481
|
+
0,
|
|
1482
|
+
0,
|
|
1483
|
+
0,
|
|
1484
|
+
0,
|
|
1485
|
+
0,
|
|
1486
|
+
0,
|
|
1487
|
+
0,
|
|
1488
|
+
0,
|
|
1489
|
+
0,
|
|
1490
|
+
0.3536
|
|
1491
|
+
]
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
"id": "c_0f69d5c10e0f",
|
|
1495
|
+
"doc": "pets.txt",
|
|
1496
|
+
"index": 0,
|
|
1497
|
+
"start": 0,
|
|
1498
|
+
"end": 54,
|
|
1499
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
1500
|
+
"headings": [],
|
|
1501
|
+
"v": [
|
|
1502
|
+
0,
|
|
1503
|
+
0,
|
|
1504
|
+
0,
|
|
1505
|
+
0,
|
|
1506
|
+
0,
|
|
1507
|
+
0,
|
|
1508
|
+
0,
|
|
1509
|
+
0.2887,
|
|
1510
|
+
0,
|
|
1511
|
+
0.2887,
|
|
1512
|
+
0,
|
|
1513
|
+
0,
|
|
1514
|
+
0,
|
|
1515
|
+
0.2887,
|
|
1516
|
+
0,
|
|
1517
|
+
0,
|
|
1518
|
+
0,
|
|
1519
|
+
0,
|
|
1520
|
+
-0.5774,
|
|
1521
|
+
0,
|
|
1522
|
+
0,
|
|
1523
|
+
0,
|
|
1524
|
+
0,
|
|
1525
|
+
0,
|
|
1526
|
+
0,
|
|
1527
|
+
0,
|
|
1528
|
+
0,
|
|
1529
|
+
0,
|
|
1530
|
+
0,
|
|
1531
|
+
0,
|
|
1532
|
+
-0.2887,
|
|
1533
|
+
0,
|
|
1534
|
+
0,
|
|
1535
|
+
0,
|
|
1536
|
+
0,
|
|
1537
|
+
0.5774,
|
|
1538
|
+
0,
|
|
1539
|
+
0,
|
|
1540
|
+
0,
|
|
1541
|
+
0,
|
|
1542
|
+
0,
|
|
1543
|
+
0,
|
|
1544
|
+
0,
|
|
1545
|
+
0,
|
|
1546
|
+
0,
|
|
1547
|
+
0,
|
|
1548
|
+
0,
|
|
1549
|
+
0,
|
|
1550
|
+
0,
|
|
1551
|
+
0,
|
|
1552
|
+
0,
|
|
1553
|
+
0,
|
|
1554
|
+
0,
|
|
1555
|
+
0,
|
|
1556
|
+
0,
|
|
1557
|
+
0,
|
|
1558
|
+
0,
|
|
1559
|
+
0,
|
|
1560
|
+
0,
|
|
1561
|
+
0,
|
|
1562
|
+
0,
|
|
1563
|
+
0,
|
|
1564
|
+
0,
|
|
1565
|
+
0
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
1568
|
+
],
|
|
1569
|
+
"fingerprint": "0dd4e6e20683af"
|
|
1570
|
+
},
|
|
1571
|
+
"query": "mailman",
|
|
1572
|
+
"mode": "bm25",
|
|
1573
|
+
"k": 1
|
|
1574
|
+
},
|
|
1575
|
+
"expect": {
|
|
1576
|
+
"result.results": {
|
|
1577
|
+
"matches": "^\\[\\{\"rank\":1,\"score\":1,\"id\":\"c_[0-9a-f]{12}\",\"text\":\"Cats purr\\. Dogs bark loudly at the mailman\\. Fish swim\\.\""
|
|
1578
|
+
},
|
|
1579
|
+
"result.report": {
|
|
1580
|
+
"matches": "\"mode\":\"bm25\""
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
"name": "hybrid with the list index finds the same first answer",
|
|
1586
|
+
"inputs": {
|
|
1587
|
+
"index": {
|
|
1588
|
+
"format": "viaframe-doc-index",
|
|
1589
|
+
"version": 1,
|
|
1590
|
+
"embedder": {
|
|
1591
|
+
"id": "hashed-bow-64",
|
|
1592
|
+
"dim": 64
|
|
1593
|
+
},
|
|
1594
|
+
"options": {
|
|
1595
|
+
"size": 80,
|
|
1596
|
+
"overlap": 0
|
|
1597
|
+
},
|
|
1598
|
+
"documents": [
|
|
1599
|
+
{
|
|
1600
|
+
"name": "guide.md",
|
|
1601
|
+
"kind": "markdown",
|
|
1602
|
+
"status": "ok",
|
|
1603
|
+
"source": "1db8ec7e8350c5",
|
|
1604
|
+
"fingerprint": "16baa692b5a4ea",
|
|
1605
|
+
"chars": 180,
|
|
1606
|
+
"chunks": 3
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"name": "pets.txt",
|
|
1610
|
+
"kind": "text",
|
|
1611
|
+
"status": "ok",
|
|
1612
|
+
"source": "127c50544eac5f",
|
|
1613
|
+
"fingerprint": "135380ee2fb211",
|
|
1614
|
+
"chars": 54,
|
|
1615
|
+
"chunks": 1
|
|
1616
|
+
}
|
|
1617
|
+
],
|
|
1618
|
+
"chunks": [
|
|
1619
|
+
{
|
|
1620
|
+
"id": "c_0ae5dd579108",
|
|
1621
|
+
"doc": "guide.md",
|
|
1622
|
+
"index": 0,
|
|
1623
|
+
"start": 0,
|
|
1624
|
+
"end": 76,
|
|
1625
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
1626
|
+
"headings": [
|
|
1627
|
+
"Guide"
|
|
1628
|
+
],
|
|
1629
|
+
"v": [
|
|
1630
|
+
0,
|
|
1631
|
+
0,
|
|
1632
|
+
0,
|
|
1633
|
+
0,
|
|
1634
|
+
-0.3333,
|
|
1635
|
+
0,
|
|
1636
|
+
0,
|
|
1637
|
+
0,
|
|
1638
|
+
-0.3333,
|
|
1639
|
+
0,
|
|
1640
|
+
-0.3333,
|
|
1641
|
+
0.3333,
|
|
1642
|
+
0,
|
|
1643
|
+
0.3333,
|
|
1644
|
+
0,
|
|
1645
|
+
0.3333,
|
|
1646
|
+
0,
|
|
1647
|
+
0,
|
|
1648
|
+
0,
|
|
1649
|
+
0,
|
|
1650
|
+
-0.3333,
|
|
1651
|
+
0,
|
|
1652
|
+
0,
|
|
1653
|
+
0,
|
|
1654
|
+
0,
|
|
1655
|
+
0,
|
|
1656
|
+
0,
|
|
1657
|
+
0,
|
|
1658
|
+
0,
|
|
1659
|
+
0,
|
|
1660
|
+
0,
|
|
1661
|
+
0,
|
|
1662
|
+
0,
|
|
1663
|
+
0,
|
|
1664
|
+
0,
|
|
1665
|
+
0,
|
|
1666
|
+
0,
|
|
1667
|
+
0,
|
|
1668
|
+
0,
|
|
1669
|
+
0,
|
|
1670
|
+
0,
|
|
1671
|
+
0,
|
|
1672
|
+
-0.3333,
|
|
1673
|
+
0,
|
|
1674
|
+
0,
|
|
1675
|
+
0,
|
|
1676
|
+
0,
|
|
1677
|
+
0,
|
|
1678
|
+
0,
|
|
1679
|
+
0,
|
|
1680
|
+
0,
|
|
1681
|
+
0,
|
|
1682
|
+
0,
|
|
1683
|
+
0,
|
|
1684
|
+
0,
|
|
1685
|
+
0,
|
|
1686
|
+
-0.3333,
|
|
1687
|
+
0,
|
|
1688
|
+
0,
|
|
1689
|
+
0,
|
|
1690
|
+
0,
|
|
1691
|
+
0,
|
|
1692
|
+
0,
|
|
1693
|
+
0
|
|
1694
|
+
]
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
"id": "c_19cb7ccbf03d",
|
|
1698
|
+
"doc": "guide.md",
|
|
1699
|
+
"index": 1,
|
|
1700
|
+
"start": 78,
|
|
1701
|
+
"end": 130,
|
|
1702
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
1703
|
+
"headings": [
|
|
1704
|
+
"Guide",
|
|
1705
|
+
"Retention"
|
|
1706
|
+
],
|
|
1707
|
+
"v": [
|
|
1708
|
+
0,
|
|
1709
|
+
0,
|
|
1710
|
+
-0.3536,
|
|
1711
|
+
0,
|
|
1712
|
+
0,
|
|
1713
|
+
0,
|
|
1714
|
+
0,
|
|
1715
|
+
0,
|
|
1716
|
+
0,
|
|
1717
|
+
0,
|
|
1718
|
+
-0.3536,
|
|
1719
|
+
0,
|
|
1720
|
+
0,
|
|
1721
|
+
0,
|
|
1722
|
+
0,
|
|
1723
|
+
0,
|
|
1724
|
+
0,
|
|
1725
|
+
0.7071,
|
|
1726
|
+
0,
|
|
1727
|
+
0,
|
|
1728
|
+
0,
|
|
1729
|
+
0,
|
|
1730
|
+
0,
|
|
1731
|
+
0,
|
|
1732
|
+
0,
|
|
1733
|
+
0,
|
|
1734
|
+
0,
|
|
1735
|
+
0,
|
|
1736
|
+
0,
|
|
1737
|
+
0,
|
|
1738
|
+
0,
|
|
1739
|
+
0,
|
|
1740
|
+
0,
|
|
1741
|
+
0,
|
|
1742
|
+
0,
|
|
1743
|
+
0,
|
|
1744
|
+
0,
|
|
1745
|
+
0.3536,
|
|
1746
|
+
0,
|
|
1747
|
+
0,
|
|
1748
|
+
0,
|
|
1749
|
+
0,
|
|
1750
|
+
0,
|
|
1751
|
+
0,
|
|
1752
|
+
0,
|
|
1753
|
+
0,
|
|
1754
|
+
0,
|
|
1755
|
+
0,
|
|
1756
|
+
0,
|
|
1757
|
+
0,
|
|
1758
|
+
0,
|
|
1759
|
+
0,
|
|
1760
|
+
0,
|
|
1761
|
+
0,
|
|
1762
|
+
0,
|
|
1763
|
+
0,
|
|
1764
|
+
0,
|
|
1765
|
+
0,
|
|
1766
|
+
0,
|
|
1767
|
+
0,
|
|
1768
|
+
0,
|
|
1769
|
+
0,
|
|
1770
|
+
-0.3536,
|
|
1771
|
+
0
|
|
1772
|
+
]
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"id": "c_060a354910f6",
|
|
1776
|
+
"doc": "guide.md",
|
|
1777
|
+
"index": 2,
|
|
1778
|
+
"start": 131,
|
|
1779
|
+
"end": 179,
|
|
1780
|
+
"text": "The retention policy decides what the log keeps.",
|
|
1781
|
+
"headings": [
|
|
1782
|
+
"Guide",
|
|
1783
|
+
"Retention"
|
|
1784
|
+
],
|
|
1785
|
+
"v": [
|
|
1786
|
+
0,
|
|
1787
|
+
0,
|
|
1788
|
+
0,
|
|
1789
|
+
0,
|
|
1790
|
+
0,
|
|
1791
|
+
0,
|
|
1792
|
+
0,
|
|
1793
|
+
0,
|
|
1794
|
+
-0.3536,
|
|
1795
|
+
0,
|
|
1796
|
+
0,
|
|
1797
|
+
0,
|
|
1798
|
+
0,
|
|
1799
|
+
0,
|
|
1800
|
+
0,
|
|
1801
|
+
0,
|
|
1802
|
+
0,
|
|
1803
|
+
0.7071,
|
|
1804
|
+
0,
|
|
1805
|
+
0,
|
|
1806
|
+
0,
|
|
1807
|
+
0,
|
|
1808
|
+
0,
|
|
1809
|
+
0,
|
|
1810
|
+
0,
|
|
1811
|
+
0,
|
|
1812
|
+
0,
|
|
1813
|
+
0,
|
|
1814
|
+
0,
|
|
1815
|
+
0,
|
|
1816
|
+
0,
|
|
1817
|
+
0,
|
|
1818
|
+
0,
|
|
1819
|
+
0.3536,
|
|
1820
|
+
0,
|
|
1821
|
+
0,
|
|
1822
|
+
0,
|
|
1823
|
+
0,
|
|
1824
|
+
0,
|
|
1825
|
+
0,
|
|
1826
|
+
0,
|
|
1827
|
+
0,
|
|
1828
|
+
0,
|
|
1829
|
+
0,
|
|
1830
|
+
0,
|
|
1831
|
+
0,
|
|
1832
|
+
0,
|
|
1833
|
+
0.3536,
|
|
1834
|
+
0,
|
|
1835
|
+
0,
|
|
1836
|
+
0,
|
|
1837
|
+
0,
|
|
1838
|
+
0,
|
|
1839
|
+
0,
|
|
1840
|
+
0,
|
|
1841
|
+
0,
|
|
1842
|
+
0,
|
|
1843
|
+
0,
|
|
1844
|
+
0,
|
|
1845
|
+
0,
|
|
1846
|
+
0,
|
|
1847
|
+
0,
|
|
1848
|
+
0,
|
|
1849
|
+
0.3536
|
|
1850
|
+
]
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"id": "c_0f69d5c10e0f",
|
|
1854
|
+
"doc": "pets.txt",
|
|
1855
|
+
"index": 0,
|
|
1856
|
+
"start": 0,
|
|
1857
|
+
"end": 54,
|
|
1858
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
1859
|
+
"headings": [],
|
|
1860
|
+
"v": [
|
|
1861
|
+
0,
|
|
1862
|
+
0,
|
|
1863
|
+
0,
|
|
1864
|
+
0,
|
|
1865
|
+
0,
|
|
1866
|
+
0,
|
|
1867
|
+
0,
|
|
1868
|
+
0.2887,
|
|
1869
|
+
0,
|
|
1870
|
+
0.2887,
|
|
1871
|
+
0,
|
|
1872
|
+
0,
|
|
1873
|
+
0,
|
|
1874
|
+
0.2887,
|
|
1875
|
+
0,
|
|
1876
|
+
0,
|
|
1877
|
+
0,
|
|
1878
|
+
0,
|
|
1879
|
+
-0.5774,
|
|
1880
|
+
0,
|
|
1881
|
+
0,
|
|
1882
|
+
0,
|
|
1883
|
+
0,
|
|
1884
|
+
0,
|
|
1885
|
+
0,
|
|
1886
|
+
0,
|
|
1887
|
+
0,
|
|
1888
|
+
0,
|
|
1889
|
+
0,
|
|
1890
|
+
0,
|
|
1891
|
+
-0.2887,
|
|
1892
|
+
0,
|
|
1893
|
+
0,
|
|
1894
|
+
0,
|
|
1895
|
+
0,
|
|
1896
|
+
0.5774,
|
|
1897
|
+
0,
|
|
1898
|
+
0,
|
|
1899
|
+
0,
|
|
1900
|
+
0,
|
|
1901
|
+
0,
|
|
1902
|
+
0,
|
|
1903
|
+
0,
|
|
1904
|
+
0,
|
|
1905
|
+
0,
|
|
1906
|
+
0,
|
|
1907
|
+
0,
|
|
1908
|
+
0,
|
|
1909
|
+
0,
|
|
1910
|
+
0,
|
|
1911
|
+
0,
|
|
1912
|
+
0,
|
|
1913
|
+
0,
|
|
1914
|
+
0,
|
|
1915
|
+
0,
|
|
1916
|
+
0,
|
|
1917
|
+
0,
|
|
1918
|
+
0,
|
|
1919
|
+
0,
|
|
1920
|
+
0,
|
|
1921
|
+
0,
|
|
1922
|
+
0,
|
|
1923
|
+
0,
|
|
1924
|
+
0
|
|
1925
|
+
]
|
|
1926
|
+
}
|
|
1927
|
+
],
|
|
1928
|
+
"fingerprint": "0dd4e6e20683af"
|
|
1929
|
+
},
|
|
1930
|
+
"query": "retention policy",
|
|
1931
|
+
"mode": "hybrid",
|
|
1932
|
+
"ann": "on",
|
|
1933
|
+
"k": 1
|
|
1934
|
+
},
|
|
1935
|
+
"expect": {
|
|
1936
|
+
"result.results": {
|
|
1937
|
+
"matches": "\"doc\":\"guide\\.md\""
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
"name": "no matching words, no results",
|
|
1943
|
+
"inputs": {
|
|
1944
|
+
"index": {
|
|
1945
|
+
"format": "viaframe-doc-index",
|
|
1946
|
+
"version": 1,
|
|
1947
|
+
"embedder": {
|
|
1948
|
+
"id": "hashed-bow-64",
|
|
1949
|
+
"dim": 64
|
|
1950
|
+
},
|
|
1951
|
+
"options": {
|
|
1952
|
+
"size": 80,
|
|
1953
|
+
"overlap": 0
|
|
1954
|
+
},
|
|
1955
|
+
"documents": [
|
|
1956
|
+
{
|
|
1957
|
+
"name": "guide.md",
|
|
1958
|
+
"kind": "markdown",
|
|
1959
|
+
"status": "ok",
|
|
1960
|
+
"source": "1db8ec7e8350c5",
|
|
1961
|
+
"fingerprint": "16baa692b5a4ea",
|
|
1962
|
+
"chars": 180,
|
|
1963
|
+
"chunks": 3
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
"name": "pets.txt",
|
|
1967
|
+
"kind": "text",
|
|
1968
|
+
"status": "ok",
|
|
1969
|
+
"source": "127c50544eac5f",
|
|
1970
|
+
"fingerprint": "135380ee2fb211",
|
|
1971
|
+
"chars": 54,
|
|
1972
|
+
"chunks": 1
|
|
1973
|
+
}
|
|
1974
|
+
],
|
|
1975
|
+
"chunks": [
|
|
1976
|
+
{
|
|
1977
|
+
"id": "c_0ae5dd579108",
|
|
1978
|
+
"doc": "guide.md",
|
|
1979
|
+
"index": 0,
|
|
1980
|
+
"start": 0,
|
|
1981
|
+
"end": 76,
|
|
1982
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
1983
|
+
"headings": [
|
|
1984
|
+
"Guide"
|
|
1985
|
+
],
|
|
1986
|
+
"v": [
|
|
1987
|
+
0,
|
|
1988
|
+
0,
|
|
1989
|
+
0,
|
|
1990
|
+
0,
|
|
1991
|
+
-0.3333,
|
|
1992
|
+
0,
|
|
1993
|
+
0,
|
|
1994
|
+
0,
|
|
1995
|
+
-0.3333,
|
|
1996
|
+
0,
|
|
1997
|
+
-0.3333,
|
|
1998
|
+
0.3333,
|
|
1999
|
+
0,
|
|
2000
|
+
0.3333,
|
|
2001
|
+
0,
|
|
2002
|
+
0.3333,
|
|
2003
|
+
0,
|
|
2004
|
+
0,
|
|
2005
|
+
0,
|
|
2006
|
+
0,
|
|
2007
|
+
-0.3333,
|
|
2008
|
+
0,
|
|
2009
|
+
0,
|
|
2010
|
+
0,
|
|
2011
|
+
0,
|
|
2012
|
+
0,
|
|
2013
|
+
0,
|
|
2014
|
+
0,
|
|
2015
|
+
0,
|
|
2016
|
+
0,
|
|
2017
|
+
0,
|
|
2018
|
+
0,
|
|
2019
|
+
0,
|
|
2020
|
+
0,
|
|
2021
|
+
0,
|
|
2022
|
+
0,
|
|
2023
|
+
0,
|
|
2024
|
+
0,
|
|
2025
|
+
0,
|
|
2026
|
+
0,
|
|
2027
|
+
0,
|
|
2028
|
+
0,
|
|
2029
|
+
-0.3333,
|
|
2030
|
+
0,
|
|
2031
|
+
0,
|
|
2032
|
+
0,
|
|
2033
|
+
0,
|
|
2034
|
+
0,
|
|
2035
|
+
0,
|
|
2036
|
+
0,
|
|
2037
|
+
0,
|
|
2038
|
+
0,
|
|
2039
|
+
0,
|
|
2040
|
+
0,
|
|
2041
|
+
0,
|
|
2042
|
+
0,
|
|
2043
|
+
-0.3333,
|
|
2044
|
+
0,
|
|
2045
|
+
0,
|
|
2046
|
+
0,
|
|
2047
|
+
0,
|
|
2048
|
+
0,
|
|
2049
|
+
0,
|
|
2050
|
+
0
|
|
2051
|
+
]
|
|
2052
|
+
},
|
|
2053
|
+
{
|
|
2054
|
+
"id": "c_19cb7ccbf03d",
|
|
2055
|
+
"doc": "guide.md",
|
|
2056
|
+
"index": 1,
|
|
2057
|
+
"start": 78,
|
|
2058
|
+
"end": 130,
|
|
2059
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
2060
|
+
"headings": [
|
|
2061
|
+
"Guide",
|
|
2062
|
+
"Retention"
|
|
2063
|
+
],
|
|
2064
|
+
"v": [
|
|
2065
|
+
0,
|
|
2066
|
+
0,
|
|
2067
|
+
-0.3536,
|
|
2068
|
+
0,
|
|
2069
|
+
0,
|
|
2070
|
+
0,
|
|
2071
|
+
0,
|
|
2072
|
+
0,
|
|
2073
|
+
0,
|
|
2074
|
+
0,
|
|
2075
|
+
-0.3536,
|
|
2076
|
+
0,
|
|
2077
|
+
0,
|
|
2078
|
+
0,
|
|
2079
|
+
0,
|
|
2080
|
+
0,
|
|
2081
|
+
0,
|
|
2082
|
+
0.7071,
|
|
2083
|
+
0,
|
|
2084
|
+
0,
|
|
2085
|
+
0,
|
|
2086
|
+
0,
|
|
2087
|
+
0,
|
|
2088
|
+
0,
|
|
2089
|
+
0,
|
|
2090
|
+
0,
|
|
2091
|
+
0,
|
|
2092
|
+
0,
|
|
2093
|
+
0,
|
|
2094
|
+
0,
|
|
2095
|
+
0,
|
|
2096
|
+
0,
|
|
2097
|
+
0,
|
|
2098
|
+
0,
|
|
2099
|
+
0,
|
|
2100
|
+
0,
|
|
2101
|
+
0,
|
|
2102
|
+
0.3536,
|
|
2103
|
+
0,
|
|
2104
|
+
0,
|
|
2105
|
+
0,
|
|
2106
|
+
0,
|
|
2107
|
+
0,
|
|
2108
|
+
0,
|
|
2109
|
+
0,
|
|
2110
|
+
0,
|
|
2111
|
+
0,
|
|
2112
|
+
0,
|
|
2113
|
+
0,
|
|
2114
|
+
0,
|
|
2115
|
+
0,
|
|
2116
|
+
0,
|
|
2117
|
+
0,
|
|
2118
|
+
0,
|
|
2119
|
+
0,
|
|
2120
|
+
0,
|
|
2121
|
+
0,
|
|
2122
|
+
0,
|
|
2123
|
+
0,
|
|
2124
|
+
0,
|
|
2125
|
+
0,
|
|
2126
|
+
0,
|
|
2127
|
+
-0.3536,
|
|
2128
|
+
0
|
|
2129
|
+
]
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
"id": "c_060a354910f6",
|
|
2133
|
+
"doc": "guide.md",
|
|
2134
|
+
"index": 2,
|
|
2135
|
+
"start": 131,
|
|
2136
|
+
"end": 179,
|
|
2137
|
+
"text": "The retention policy decides what the log keeps.",
|
|
2138
|
+
"headings": [
|
|
2139
|
+
"Guide",
|
|
2140
|
+
"Retention"
|
|
2141
|
+
],
|
|
2142
|
+
"v": [
|
|
2143
|
+
0,
|
|
2144
|
+
0,
|
|
2145
|
+
0,
|
|
2146
|
+
0,
|
|
2147
|
+
0,
|
|
2148
|
+
0,
|
|
2149
|
+
0,
|
|
2150
|
+
0,
|
|
2151
|
+
-0.3536,
|
|
2152
|
+
0,
|
|
2153
|
+
0,
|
|
2154
|
+
0,
|
|
2155
|
+
0,
|
|
2156
|
+
0,
|
|
2157
|
+
0,
|
|
2158
|
+
0,
|
|
2159
|
+
0,
|
|
2160
|
+
0.7071,
|
|
2161
|
+
0,
|
|
2162
|
+
0,
|
|
2163
|
+
0,
|
|
2164
|
+
0,
|
|
2165
|
+
0,
|
|
2166
|
+
0,
|
|
2167
|
+
0,
|
|
2168
|
+
0,
|
|
2169
|
+
0,
|
|
2170
|
+
0,
|
|
2171
|
+
0,
|
|
2172
|
+
0,
|
|
2173
|
+
0,
|
|
2174
|
+
0,
|
|
2175
|
+
0,
|
|
2176
|
+
0.3536,
|
|
2177
|
+
0,
|
|
2178
|
+
0,
|
|
2179
|
+
0,
|
|
2180
|
+
0,
|
|
2181
|
+
0,
|
|
2182
|
+
0,
|
|
2183
|
+
0,
|
|
2184
|
+
0,
|
|
2185
|
+
0,
|
|
2186
|
+
0,
|
|
2187
|
+
0,
|
|
2188
|
+
0,
|
|
2189
|
+
0,
|
|
2190
|
+
0.3536,
|
|
2191
|
+
0,
|
|
2192
|
+
0,
|
|
2193
|
+
0,
|
|
2194
|
+
0,
|
|
2195
|
+
0,
|
|
2196
|
+
0,
|
|
2197
|
+
0,
|
|
2198
|
+
0,
|
|
2199
|
+
0,
|
|
2200
|
+
0,
|
|
2201
|
+
0,
|
|
2202
|
+
0,
|
|
2203
|
+
0,
|
|
2204
|
+
0,
|
|
2205
|
+
0,
|
|
2206
|
+
0.3536
|
|
2207
|
+
]
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
"id": "c_0f69d5c10e0f",
|
|
2211
|
+
"doc": "pets.txt",
|
|
2212
|
+
"index": 0,
|
|
2213
|
+
"start": 0,
|
|
2214
|
+
"end": 54,
|
|
2215
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
2216
|
+
"headings": [],
|
|
2217
|
+
"v": [
|
|
2218
|
+
0,
|
|
2219
|
+
0,
|
|
2220
|
+
0,
|
|
2221
|
+
0,
|
|
2222
|
+
0,
|
|
2223
|
+
0,
|
|
2224
|
+
0,
|
|
2225
|
+
0.2887,
|
|
2226
|
+
0,
|
|
2227
|
+
0.2887,
|
|
2228
|
+
0,
|
|
2229
|
+
0,
|
|
2230
|
+
0,
|
|
2231
|
+
0.2887,
|
|
2232
|
+
0,
|
|
2233
|
+
0,
|
|
2234
|
+
0,
|
|
2235
|
+
0,
|
|
2236
|
+
-0.5774,
|
|
2237
|
+
0,
|
|
2238
|
+
0,
|
|
2239
|
+
0,
|
|
2240
|
+
0,
|
|
2241
|
+
0,
|
|
2242
|
+
0,
|
|
2243
|
+
0,
|
|
2244
|
+
0,
|
|
2245
|
+
0,
|
|
2246
|
+
0,
|
|
2247
|
+
0,
|
|
2248
|
+
-0.2887,
|
|
2249
|
+
0,
|
|
2250
|
+
0,
|
|
2251
|
+
0,
|
|
2252
|
+
0,
|
|
2253
|
+
0.5774,
|
|
2254
|
+
0,
|
|
2255
|
+
0,
|
|
2256
|
+
0,
|
|
2257
|
+
0,
|
|
2258
|
+
0,
|
|
2259
|
+
0,
|
|
2260
|
+
0,
|
|
2261
|
+
0,
|
|
2262
|
+
0,
|
|
2263
|
+
0,
|
|
2264
|
+
0,
|
|
2265
|
+
0,
|
|
2266
|
+
0,
|
|
2267
|
+
0,
|
|
2268
|
+
0,
|
|
2269
|
+
0,
|
|
2270
|
+
0,
|
|
2271
|
+
0,
|
|
2272
|
+
0,
|
|
2273
|
+
0,
|
|
2274
|
+
0,
|
|
2275
|
+
0,
|
|
2276
|
+
0,
|
|
2277
|
+
0,
|
|
2278
|
+
0,
|
|
2279
|
+
0,
|
|
2280
|
+
0,
|
|
2281
|
+
0
|
|
2282
|
+
]
|
|
2283
|
+
}
|
|
2284
|
+
],
|
|
2285
|
+
"fingerprint": "0dd4e6e20683af"
|
|
2286
|
+
},
|
|
2287
|
+
"query": "zzqx"
|
|
2288
|
+
},
|
|
2289
|
+
"expect": {
|
|
2290
|
+
"result.results": [],
|
|
2291
|
+
"result.context": ""
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
],
|
|
2295
|
+
"hosts": []
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
"id": "export-corpus",
|
|
2299
|
+
"title": "Export corpus",
|
|
2300
|
+
"description": "The corpus as one portable file (a media value, `corpus.viaframe-corpus.json`): documents' names, kinds, statuses and fingerprints, and chunks with text, positions, headings and vectors. Only those fields are written: no provider settings, keys, permissions or browser-store contents. `vectors: compact` stores each vector as 8-bit numbers (about a third of the size, scores within 1%), the form that fits a browser store. Download it from the output, or keep it in a canvas that is not shared: it holds your documents' text.",
|
|
2301
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M2 3h12M2 7h12M2 11h8M12 11l2 2\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
2302
|
+
"canvas": {
|
|
2303
|
+
"format": "viaframe-canvas",
|
|
2304
|
+
"version": 3,
|
|
2305
|
+
"name": "Export corpus",
|
|
2306
|
+
"panes": [
|
|
2307
|
+
{
|
|
2308
|
+
"id": "i_index",
|
|
2309
|
+
"type": "input",
|
|
2310
|
+
"name": "index",
|
|
2311
|
+
"rect": {
|
|
2312
|
+
"x": 0,
|
|
2313
|
+
"y": 0,
|
|
2314
|
+
"width": 240
|
|
2315
|
+
},
|
|
2316
|
+
"inputs": [],
|
|
2317
|
+
"widget": {
|
|
2318
|
+
"kind": "json",
|
|
2319
|
+
"value": "null"
|
|
2320
|
+
},
|
|
2321
|
+
"control": {
|
|
2322
|
+
"group": "Settings"
|
|
2323
|
+
}
|
|
2324
|
+
},
|
|
2325
|
+
{
|
|
2326
|
+
"id": "i_vectors",
|
|
2327
|
+
"type": "input",
|
|
2328
|
+
"name": "vectors",
|
|
2329
|
+
"rect": {
|
|
2330
|
+
"x": 0,
|
|
2331
|
+
"y": 150,
|
|
2332
|
+
"width": 240
|
|
2333
|
+
},
|
|
2334
|
+
"inputs": [],
|
|
2335
|
+
"widget": {
|
|
2336
|
+
"kind": "select",
|
|
2337
|
+
"value": "full",
|
|
2338
|
+
"options": "full,compact"
|
|
2339
|
+
},
|
|
2340
|
+
"control": {
|
|
2341
|
+
"group": "Options"
|
|
2342
|
+
}
|
|
2343
|
+
},
|
|
2344
|
+
{
|
|
2345
|
+
"id": "run",
|
|
2346
|
+
"type": "eval",
|
|
2347
|
+
"name": "result",
|
|
2348
|
+
"rect": {
|
|
2349
|
+
"x": 320,
|
|
2350
|
+
"y": 0,
|
|
2351
|
+
"width": 360
|
|
2352
|
+
},
|
|
2353
|
+
"inputs": [
|
|
2354
|
+
{
|
|
2355
|
+
"name": "index",
|
|
2356
|
+
"source": "i_index"
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
"name": "vectors",
|
|
2360
|
+
"source": "i_vectors"
|
|
2361
|
+
}
|
|
2362
|
+
],
|
|
2363
|
+
"autorun": true,
|
|
2364
|
+
"mode": "function",
|
|
2365
|
+
"view": "auto",
|
|
2366
|
+
"outputs": [
|
|
2367
|
+
{
|
|
2368
|
+
"name": "corpus"
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
"name": "bytes"
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
"name": "fingerprint"
|
|
2375
|
+
}
|
|
2376
|
+
],
|
|
2377
|
+
"code": "if (!index) return skip(\"no index yet: wire a Build document index pane\");\nconst text = docs.exportCorpus(index, { compact: vectors === \"compact\" });\nreturn { corpus: await file(new Blob([text], { type: \"application/json\" }), { name: \"corpus.viaframe-corpus.json\" }), bytes: text.length, fingerprint: index.fingerprint };",
|
|
2378
|
+
"description": "The corpus as one portable file (a media value, `corpus.viaframe-corpus.json`): documents' names, kinds, statuses and fingerprints, and chunks with text, positions, headings and vectors. Only those fields are written: no provider settings, keys, permissions or browser-store contents. `vectors: compact` stores each vector as 8-bit numbers (about a third of the size, scores within 1%), the form that fits a browser store. Download it from the output, or keep it in a canvas that is not shared: it holds your documents' text."
|
|
2379
|
+
}
|
|
2380
|
+
]
|
|
2381
|
+
},
|
|
2382
|
+
"tests": [
|
|
2383
|
+
{
|
|
2384
|
+
"name": "a file the import reads back",
|
|
2385
|
+
"inputs": {
|
|
2386
|
+
"index": {
|
|
2387
|
+
"format": "viaframe-doc-index",
|
|
2388
|
+
"version": 1,
|
|
2389
|
+
"embedder": {
|
|
2390
|
+
"id": "hashed-bow-64",
|
|
2391
|
+
"dim": 64
|
|
2392
|
+
},
|
|
2393
|
+
"options": {
|
|
2394
|
+
"size": 80,
|
|
2395
|
+
"overlap": 0
|
|
2396
|
+
},
|
|
2397
|
+
"documents": [
|
|
2398
|
+
{
|
|
2399
|
+
"name": "guide.md",
|
|
2400
|
+
"kind": "markdown",
|
|
2401
|
+
"status": "ok",
|
|
2402
|
+
"source": "1db8ec7e8350c5",
|
|
2403
|
+
"fingerprint": "16baa692b5a4ea",
|
|
2404
|
+
"chars": 180,
|
|
2405
|
+
"chunks": 3
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
"name": "pets.txt",
|
|
2409
|
+
"kind": "text",
|
|
2410
|
+
"status": "ok",
|
|
2411
|
+
"source": "127c50544eac5f",
|
|
2412
|
+
"fingerprint": "135380ee2fb211",
|
|
2413
|
+
"chars": 54,
|
|
2414
|
+
"chunks": 1
|
|
2415
|
+
}
|
|
2416
|
+
],
|
|
2417
|
+
"chunks": [
|
|
2418
|
+
{
|
|
2419
|
+
"id": "c_0ae5dd579108",
|
|
2420
|
+
"doc": "guide.md",
|
|
2421
|
+
"index": 0,
|
|
2422
|
+
"start": 0,
|
|
2423
|
+
"end": 76,
|
|
2424
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
2425
|
+
"headings": [
|
|
2426
|
+
"Guide"
|
|
2427
|
+
],
|
|
2428
|
+
"v": [
|
|
2429
|
+
0,
|
|
2430
|
+
0,
|
|
2431
|
+
0,
|
|
2432
|
+
0,
|
|
2433
|
+
-0.3333,
|
|
2434
|
+
0,
|
|
2435
|
+
0,
|
|
2436
|
+
0,
|
|
2437
|
+
-0.3333,
|
|
2438
|
+
0,
|
|
2439
|
+
-0.3333,
|
|
2440
|
+
0.3333,
|
|
2441
|
+
0,
|
|
2442
|
+
0.3333,
|
|
2443
|
+
0,
|
|
2444
|
+
0.3333,
|
|
2445
|
+
0,
|
|
2446
|
+
0,
|
|
2447
|
+
0,
|
|
2448
|
+
0,
|
|
2449
|
+
-0.3333,
|
|
2450
|
+
0,
|
|
2451
|
+
0,
|
|
2452
|
+
0,
|
|
2453
|
+
0,
|
|
2454
|
+
0,
|
|
2455
|
+
0,
|
|
2456
|
+
0,
|
|
2457
|
+
0,
|
|
2458
|
+
0,
|
|
2459
|
+
0,
|
|
2460
|
+
0,
|
|
2461
|
+
0,
|
|
2462
|
+
0,
|
|
2463
|
+
0,
|
|
2464
|
+
0,
|
|
2465
|
+
0,
|
|
2466
|
+
0,
|
|
2467
|
+
0,
|
|
2468
|
+
0,
|
|
2469
|
+
0,
|
|
2470
|
+
0,
|
|
2471
|
+
-0.3333,
|
|
2472
|
+
0,
|
|
2473
|
+
0,
|
|
2474
|
+
0,
|
|
2475
|
+
0,
|
|
2476
|
+
0,
|
|
2477
|
+
0,
|
|
2478
|
+
0,
|
|
2479
|
+
0,
|
|
2480
|
+
0,
|
|
2481
|
+
0,
|
|
2482
|
+
0,
|
|
2483
|
+
0,
|
|
2484
|
+
0,
|
|
2485
|
+
-0.3333,
|
|
2486
|
+
0,
|
|
2487
|
+
0,
|
|
2488
|
+
0,
|
|
2489
|
+
0,
|
|
2490
|
+
0,
|
|
2491
|
+
0,
|
|
2492
|
+
0
|
|
2493
|
+
]
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
"id": "c_19cb7ccbf03d",
|
|
2497
|
+
"doc": "guide.md",
|
|
2498
|
+
"index": 1,
|
|
2499
|
+
"start": 78,
|
|
2500
|
+
"end": 130,
|
|
2501
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
2502
|
+
"headings": [
|
|
2503
|
+
"Guide",
|
|
2504
|
+
"Retention"
|
|
2505
|
+
],
|
|
2506
|
+
"v": [
|
|
2507
|
+
0,
|
|
2508
|
+
0,
|
|
2509
|
+
-0.3536,
|
|
2510
|
+
0,
|
|
2511
|
+
0,
|
|
2512
|
+
0,
|
|
2513
|
+
0,
|
|
2514
|
+
0,
|
|
2515
|
+
0,
|
|
2516
|
+
0,
|
|
2517
|
+
-0.3536,
|
|
2518
|
+
0,
|
|
2519
|
+
0,
|
|
2520
|
+
0,
|
|
2521
|
+
0,
|
|
2522
|
+
0,
|
|
2523
|
+
0,
|
|
2524
|
+
0.7071,
|
|
2525
|
+
0,
|
|
2526
|
+
0,
|
|
2527
|
+
0,
|
|
2528
|
+
0,
|
|
2529
|
+
0,
|
|
2530
|
+
0,
|
|
2531
|
+
0,
|
|
2532
|
+
0,
|
|
2533
|
+
0,
|
|
2534
|
+
0,
|
|
2535
|
+
0,
|
|
2536
|
+
0,
|
|
2537
|
+
0,
|
|
2538
|
+
0,
|
|
2539
|
+
0,
|
|
2540
|
+
0,
|
|
2541
|
+
0,
|
|
2542
|
+
0,
|
|
2543
|
+
0,
|
|
2544
|
+
0.3536,
|
|
2545
|
+
0,
|
|
2546
|
+
0,
|
|
2547
|
+
0,
|
|
2548
|
+
0,
|
|
2549
|
+
0,
|
|
2550
|
+
0,
|
|
2551
|
+
0,
|
|
2552
|
+
0,
|
|
2553
|
+
0,
|
|
2554
|
+
0,
|
|
2555
|
+
0,
|
|
2556
|
+
0,
|
|
2557
|
+
0,
|
|
2558
|
+
0,
|
|
2559
|
+
0,
|
|
2560
|
+
0,
|
|
2561
|
+
0,
|
|
2562
|
+
0,
|
|
2563
|
+
0,
|
|
2564
|
+
0,
|
|
2565
|
+
0,
|
|
2566
|
+
0,
|
|
2567
|
+
0,
|
|
2568
|
+
0,
|
|
2569
|
+
-0.3536,
|
|
2570
|
+
0
|
|
2571
|
+
]
|
|
2572
|
+
},
|
|
2573
|
+
{
|
|
2574
|
+
"id": "c_060a354910f6",
|
|
2575
|
+
"doc": "guide.md",
|
|
2576
|
+
"index": 2,
|
|
2577
|
+
"start": 131,
|
|
2578
|
+
"end": 179,
|
|
2579
|
+
"text": "The retention policy decides what the log keeps.",
|
|
2580
|
+
"headings": [
|
|
2581
|
+
"Guide",
|
|
2582
|
+
"Retention"
|
|
2583
|
+
],
|
|
2584
|
+
"v": [
|
|
2585
|
+
0,
|
|
2586
|
+
0,
|
|
2587
|
+
0,
|
|
2588
|
+
0,
|
|
2589
|
+
0,
|
|
2590
|
+
0,
|
|
2591
|
+
0,
|
|
2592
|
+
0,
|
|
2593
|
+
-0.3536,
|
|
2594
|
+
0,
|
|
2595
|
+
0,
|
|
2596
|
+
0,
|
|
2597
|
+
0,
|
|
2598
|
+
0,
|
|
2599
|
+
0,
|
|
2600
|
+
0,
|
|
2601
|
+
0,
|
|
2602
|
+
0.7071,
|
|
2603
|
+
0,
|
|
2604
|
+
0,
|
|
2605
|
+
0,
|
|
2606
|
+
0,
|
|
2607
|
+
0,
|
|
2608
|
+
0,
|
|
2609
|
+
0,
|
|
2610
|
+
0,
|
|
2611
|
+
0,
|
|
2612
|
+
0,
|
|
2613
|
+
0,
|
|
2614
|
+
0,
|
|
2615
|
+
0,
|
|
2616
|
+
0,
|
|
2617
|
+
0,
|
|
2618
|
+
0.3536,
|
|
2619
|
+
0,
|
|
2620
|
+
0,
|
|
2621
|
+
0,
|
|
2622
|
+
0,
|
|
2623
|
+
0,
|
|
2624
|
+
0,
|
|
2625
|
+
0,
|
|
2626
|
+
0,
|
|
2627
|
+
0,
|
|
2628
|
+
0,
|
|
2629
|
+
0,
|
|
2630
|
+
0,
|
|
2631
|
+
0,
|
|
2632
|
+
0.3536,
|
|
2633
|
+
0,
|
|
2634
|
+
0,
|
|
2635
|
+
0,
|
|
2636
|
+
0,
|
|
2637
|
+
0,
|
|
2638
|
+
0,
|
|
2639
|
+
0,
|
|
2640
|
+
0,
|
|
2641
|
+
0,
|
|
2642
|
+
0,
|
|
2643
|
+
0,
|
|
2644
|
+
0,
|
|
2645
|
+
0,
|
|
2646
|
+
0,
|
|
2647
|
+
0,
|
|
2648
|
+
0.3536
|
|
2649
|
+
]
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
"id": "c_0f69d5c10e0f",
|
|
2653
|
+
"doc": "pets.txt",
|
|
2654
|
+
"index": 0,
|
|
2655
|
+
"start": 0,
|
|
2656
|
+
"end": 54,
|
|
2657
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
2658
|
+
"headings": [],
|
|
2659
|
+
"v": [
|
|
2660
|
+
0,
|
|
2661
|
+
0,
|
|
2662
|
+
0,
|
|
2663
|
+
0,
|
|
2664
|
+
0,
|
|
2665
|
+
0,
|
|
2666
|
+
0,
|
|
2667
|
+
0.2887,
|
|
2668
|
+
0,
|
|
2669
|
+
0.2887,
|
|
2670
|
+
0,
|
|
2671
|
+
0,
|
|
2672
|
+
0,
|
|
2673
|
+
0.2887,
|
|
2674
|
+
0,
|
|
2675
|
+
0,
|
|
2676
|
+
0,
|
|
2677
|
+
0,
|
|
2678
|
+
-0.5774,
|
|
2679
|
+
0,
|
|
2680
|
+
0,
|
|
2681
|
+
0,
|
|
2682
|
+
0,
|
|
2683
|
+
0,
|
|
2684
|
+
0,
|
|
2685
|
+
0,
|
|
2686
|
+
0,
|
|
2687
|
+
0,
|
|
2688
|
+
0,
|
|
2689
|
+
0,
|
|
2690
|
+
-0.2887,
|
|
2691
|
+
0,
|
|
2692
|
+
0,
|
|
2693
|
+
0,
|
|
2694
|
+
0,
|
|
2695
|
+
0.5774,
|
|
2696
|
+
0,
|
|
2697
|
+
0,
|
|
2698
|
+
0,
|
|
2699
|
+
0,
|
|
2700
|
+
0,
|
|
2701
|
+
0,
|
|
2702
|
+
0,
|
|
2703
|
+
0,
|
|
2704
|
+
0,
|
|
2705
|
+
0,
|
|
2706
|
+
0,
|
|
2707
|
+
0,
|
|
2708
|
+
0,
|
|
2709
|
+
0,
|
|
2710
|
+
0,
|
|
2711
|
+
0,
|
|
2712
|
+
0,
|
|
2713
|
+
0,
|
|
2714
|
+
0,
|
|
2715
|
+
0,
|
|
2716
|
+
0,
|
|
2717
|
+
0,
|
|
2718
|
+
0,
|
|
2719
|
+
0,
|
|
2720
|
+
0,
|
|
2721
|
+
0,
|
|
2722
|
+
0,
|
|
2723
|
+
0
|
|
2724
|
+
]
|
|
2725
|
+
}
|
|
2726
|
+
],
|
|
2727
|
+
"fingerprint": "0dd4e6e20683af"
|
|
2728
|
+
}
|
|
2729
|
+
},
|
|
2730
|
+
"expect": {
|
|
2731
|
+
"result.fingerprint": {
|
|
2732
|
+
"matches": "^[0-9a-f]{14}$"
|
|
2733
|
+
},
|
|
2734
|
+
"result.bytes": {
|
|
2735
|
+
"type": "number"
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
"name": "compact vectors make a smaller file",
|
|
2741
|
+
"inputs": {
|
|
2742
|
+
"index": {
|
|
2743
|
+
"format": "viaframe-doc-index",
|
|
2744
|
+
"version": 1,
|
|
2745
|
+
"embedder": {
|
|
2746
|
+
"id": "hashed-bow-64",
|
|
2747
|
+
"dim": 64
|
|
2748
|
+
},
|
|
2749
|
+
"options": {
|
|
2750
|
+
"size": 80,
|
|
2751
|
+
"overlap": 0
|
|
2752
|
+
},
|
|
2753
|
+
"documents": [
|
|
2754
|
+
{
|
|
2755
|
+
"name": "guide.md",
|
|
2756
|
+
"kind": "markdown",
|
|
2757
|
+
"status": "ok",
|
|
2758
|
+
"source": "1db8ec7e8350c5",
|
|
2759
|
+
"fingerprint": "16baa692b5a4ea",
|
|
2760
|
+
"chars": 180,
|
|
2761
|
+
"chunks": 3
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
"name": "pets.txt",
|
|
2765
|
+
"kind": "text",
|
|
2766
|
+
"status": "ok",
|
|
2767
|
+
"source": "127c50544eac5f",
|
|
2768
|
+
"fingerprint": "135380ee2fb211",
|
|
2769
|
+
"chars": 54,
|
|
2770
|
+
"chunks": 1
|
|
2771
|
+
}
|
|
2772
|
+
],
|
|
2773
|
+
"chunks": [
|
|
2774
|
+
{
|
|
2775
|
+
"id": "c_0ae5dd579108",
|
|
2776
|
+
"doc": "guide.md",
|
|
2777
|
+
"index": 0,
|
|
2778
|
+
"start": 0,
|
|
2779
|
+
"end": 76,
|
|
2780
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
2781
|
+
"headings": [
|
|
2782
|
+
"Guide"
|
|
2783
|
+
],
|
|
2784
|
+
"v": [
|
|
2785
|
+
0,
|
|
2786
|
+
0,
|
|
2787
|
+
0,
|
|
2788
|
+
0,
|
|
2789
|
+
-0.3333,
|
|
2790
|
+
0,
|
|
2791
|
+
0,
|
|
2792
|
+
0,
|
|
2793
|
+
-0.3333,
|
|
2794
|
+
0,
|
|
2795
|
+
-0.3333,
|
|
2796
|
+
0.3333,
|
|
2797
|
+
0,
|
|
2798
|
+
0.3333,
|
|
2799
|
+
0,
|
|
2800
|
+
0.3333,
|
|
2801
|
+
0,
|
|
2802
|
+
0,
|
|
2803
|
+
0,
|
|
2804
|
+
0,
|
|
2805
|
+
-0.3333,
|
|
2806
|
+
0,
|
|
2807
|
+
0,
|
|
2808
|
+
0,
|
|
2809
|
+
0,
|
|
2810
|
+
0,
|
|
2811
|
+
0,
|
|
2812
|
+
0,
|
|
2813
|
+
0,
|
|
2814
|
+
0,
|
|
2815
|
+
0,
|
|
2816
|
+
0,
|
|
2817
|
+
0,
|
|
2818
|
+
0,
|
|
2819
|
+
0,
|
|
2820
|
+
0,
|
|
2821
|
+
0,
|
|
2822
|
+
0,
|
|
2823
|
+
0,
|
|
2824
|
+
0,
|
|
2825
|
+
0,
|
|
2826
|
+
0,
|
|
2827
|
+
-0.3333,
|
|
2828
|
+
0,
|
|
2829
|
+
0,
|
|
2830
|
+
0,
|
|
2831
|
+
0,
|
|
2832
|
+
0,
|
|
2833
|
+
0,
|
|
2834
|
+
0,
|
|
2835
|
+
0,
|
|
2836
|
+
0,
|
|
2837
|
+
0,
|
|
2838
|
+
0,
|
|
2839
|
+
0,
|
|
2840
|
+
0,
|
|
2841
|
+
-0.3333,
|
|
2842
|
+
0,
|
|
2843
|
+
0,
|
|
2844
|
+
0,
|
|
2845
|
+
0,
|
|
2846
|
+
0,
|
|
2847
|
+
0,
|
|
2848
|
+
0
|
|
2849
|
+
]
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
"id": "c_19cb7ccbf03d",
|
|
2853
|
+
"doc": "guide.md",
|
|
2854
|
+
"index": 1,
|
|
2855
|
+
"start": 78,
|
|
2856
|
+
"end": 130,
|
|
2857
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
2858
|
+
"headings": [
|
|
2859
|
+
"Guide",
|
|
2860
|
+
"Retention"
|
|
2861
|
+
],
|
|
2862
|
+
"v": [
|
|
2863
|
+
0,
|
|
2864
|
+
0,
|
|
2865
|
+
-0.3536,
|
|
2866
|
+
0,
|
|
2867
|
+
0,
|
|
2868
|
+
0,
|
|
2869
|
+
0,
|
|
2870
|
+
0,
|
|
2871
|
+
0,
|
|
2872
|
+
0,
|
|
2873
|
+
-0.3536,
|
|
2874
|
+
0,
|
|
2875
|
+
0,
|
|
2876
|
+
0,
|
|
2877
|
+
0,
|
|
2878
|
+
0,
|
|
2879
|
+
0,
|
|
2880
|
+
0.7071,
|
|
2881
|
+
0,
|
|
2882
|
+
0,
|
|
2883
|
+
0,
|
|
2884
|
+
0,
|
|
2885
|
+
0,
|
|
2886
|
+
0,
|
|
2887
|
+
0,
|
|
2888
|
+
0,
|
|
2889
|
+
0,
|
|
2890
|
+
0,
|
|
2891
|
+
0,
|
|
2892
|
+
0,
|
|
2893
|
+
0,
|
|
2894
|
+
0,
|
|
2895
|
+
0,
|
|
2896
|
+
0,
|
|
2897
|
+
0,
|
|
2898
|
+
0,
|
|
2899
|
+
0,
|
|
2900
|
+
0.3536,
|
|
2901
|
+
0,
|
|
2902
|
+
0,
|
|
2903
|
+
0,
|
|
2904
|
+
0,
|
|
2905
|
+
0,
|
|
2906
|
+
0,
|
|
2907
|
+
0,
|
|
2908
|
+
0,
|
|
2909
|
+
0,
|
|
2910
|
+
0,
|
|
2911
|
+
0,
|
|
2912
|
+
0,
|
|
2913
|
+
0,
|
|
2914
|
+
0,
|
|
2915
|
+
0,
|
|
2916
|
+
0,
|
|
2917
|
+
0,
|
|
2918
|
+
0,
|
|
2919
|
+
0,
|
|
2920
|
+
0,
|
|
2921
|
+
0,
|
|
2922
|
+
0,
|
|
2923
|
+
0,
|
|
2924
|
+
0,
|
|
2925
|
+
-0.3536,
|
|
2926
|
+
0
|
|
2927
|
+
]
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
"id": "c_060a354910f6",
|
|
2931
|
+
"doc": "guide.md",
|
|
2932
|
+
"index": 2,
|
|
2933
|
+
"start": 131,
|
|
2934
|
+
"end": 179,
|
|
2935
|
+
"text": "The retention policy decides what the log keeps.",
|
|
2936
|
+
"headings": [
|
|
2937
|
+
"Guide",
|
|
2938
|
+
"Retention"
|
|
2939
|
+
],
|
|
2940
|
+
"v": [
|
|
2941
|
+
0,
|
|
2942
|
+
0,
|
|
2943
|
+
0,
|
|
2944
|
+
0,
|
|
2945
|
+
0,
|
|
2946
|
+
0,
|
|
2947
|
+
0,
|
|
2948
|
+
0,
|
|
2949
|
+
-0.3536,
|
|
2950
|
+
0,
|
|
2951
|
+
0,
|
|
2952
|
+
0,
|
|
2953
|
+
0,
|
|
2954
|
+
0,
|
|
2955
|
+
0,
|
|
2956
|
+
0,
|
|
2957
|
+
0,
|
|
2958
|
+
0.7071,
|
|
2959
|
+
0,
|
|
2960
|
+
0,
|
|
2961
|
+
0,
|
|
2962
|
+
0,
|
|
2963
|
+
0,
|
|
2964
|
+
0,
|
|
2965
|
+
0,
|
|
2966
|
+
0,
|
|
2967
|
+
0,
|
|
2968
|
+
0,
|
|
2969
|
+
0,
|
|
2970
|
+
0,
|
|
2971
|
+
0,
|
|
2972
|
+
0,
|
|
2973
|
+
0,
|
|
2974
|
+
0.3536,
|
|
2975
|
+
0,
|
|
2976
|
+
0,
|
|
2977
|
+
0,
|
|
2978
|
+
0,
|
|
2979
|
+
0,
|
|
2980
|
+
0,
|
|
2981
|
+
0,
|
|
2982
|
+
0,
|
|
2983
|
+
0,
|
|
2984
|
+
0,
|
|
2985
|
+
0,
|
|
2986
|
+
0,
|
|
2987
|
+
0,
|
|
2988
|
+
0.3536,
|
|
2989
|
+
0,
|
|
2990
|
+
0,
|
|
2991
|
+
0,
|
|
2992
|
+
0,
|
|
2993
|
+
0,
|
|
2994
|
+
0,
|
|
2995
|
+
0,
|
|
2996
|
+
0,
|
|
2997
|
+
0,
|
|
2998
|
+
0,
|
|
2999
|
+
0,
|
|
3000
|
+
0,
|
|
3001
|
+
0,
|
|
3002
|
+
0,
|
|
3003
|
+
0,
|
|
3004
|
+
0.3536
|
|
3005
|
+
]
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
"id": "c_0f69d5c10e0f",
|
|
3009
|
+
"doc": "pets.txt",
|
|
3010
|
+
"index": 0,
|
|
3011
|
+
"start": 0,
|
|
3012
|
+
"end": 54,
|
|
3013
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
3014
|
+
"headings": [],
|
|
3015
|
+
"v": [
|
|
3016
|
+
0,
|
|
3017
|
+
0,
|
|
3018
|
+
0,
|
|
3019
|
+
0,
|
|
3020
|
+
0,
|
|
3021
|
+
0,
|
|
3022
|
+
0,
|
|
3023
|
+
0.2887,
|
|
3024
|
+
0,
|
|
3025
|
+
0.2887,
|
|
3026
|
+
0,
|
|
3027
|
+
0,
|
|
3028
|
+
0,
|
|
3029
|
+
0.2887,
|
|
3030
|
+
0,
|
|
3031
|
+
0,
|
|
3032
|
+
0,
|
|
3033
|
+
0,
|
|
3034
|
+
-0.5774,
|
|
3035
|
+
0,
|
|
3036
|
+
0,
|
|
3037
|
+
0,
|
|
3038
|
+
0,
|
|
3039
|
+
0,
|
|
3040
|
+
0,
|
|
3041
|
+
0,
|
|
3042
|
+
0,
|
|
3043
|
+
0,
|
|
3044
|
+
0,
|
|
3045
|
+
0,
|
|
3046
|
+
-0.2887,
|
|
3047
|
+
0,
|
|
3048
|
+
0,
|
|
3049
|
+
0,
|
|
3050
|
+
0,
|
|
3051
|
+
0.5774,
|
|
3052
|
+
0,
|
|
3053
|
+
0,
|
|
3054
|
+
0,
|
|
3055
|
+
0,
|
|
3056
|
+
0,
|
|
3057
|
+
0,
|
|
3058
|
+
0,
|
|
3059
|
+
0,
|
|
3060
|
+
0,
|
|
3061
|
+
0,
|
|
3062
|
+
0,
|
|
3063
|
+
0,
|
|
3064
|
+
0,
|
|
3065
|
+
0,
|
|
3066
|
+
0,
|
|
3067
|
+
0,
|
|
3068
|
+
0,
|
|
3069
|
+
0,
|
|
3070
|
+
0,
|
|
3071
|
+
0,
|
|
3072
|
+
0,
|
|
3073
|
+
0,
|
|
3074
|
+
0,
|
|
3075
|
+
0,
|
|
3076
|
+
0,
|
|
3077
|
+
0,
|
|
3078
|
+
0,
|
|
3079
|
+
0
|
|
3080
|
+
]
|
|
3081
|
+
}
|
|
3082
|
+
],
|
|
3083
|
+
"fingerprint": "0dd4e6e20683af"
|
|
3084
|
+
},
|
|
3085
|
+
"vectors": "compact"
|
|
3086
|
+
},
|
|
3087
|
+
"expect": {
|
|
3088
|
+
"result.fingerprint": {
|
|
3089
|
+
"matches": "^[0-9a-f]{14}$"
|
|
3090
|
+
},
|
|
3091
|
+
"result.bytes": {
|
|
3092
|
+
"type": "number"
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
],
|
|
3097
|
+
"hosts": []
|
|
3098
|
+
},
|
|
3099
|
+
{
|
|
3100
|
+
"id": "import-corpus",
|
|
3101
|
+
"title": "Import corpus",
|
|
3102
|
+
"description": "Read a corpus file (a media value, its text or the parsed object; full or compact) back into an index, checking it first: the format and version, every chunk's span and vector, unique ids, documents that exist, and a fingerprint that matches. A file that carries anything credential-shaped (api keys, tokens, secrets) is refused. Wire the index into Search, or into Build document index's `previous` so that only changed documents are read again.",
|
|
3103
|
+
"icon": "<svg viewBox=\"0 0 16 16\"><path d=\"M2 3h12M2 7h12M2 11h8M12 11l2 2\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1.2\"/></svg>",
|
|
3104
|
+
"canvas": {
|
|
3105
|
+
"format": "viaframe-canvas",
|
|
3106
|
+
"version": 3,
|
|
3107
|
+
"name": "Import corpus",
|
|
3108
|
+
"panes": [
|
|
3109
|
+
{
|
|
3110
|
+
"id": "i_corpus",
|
|
3111
|
+
"type": "input",
|
|
3112
|
+
"name": "corpus",
|
|
3113
|
+
"rect": {
|
|
3114
|
+
"x": 0,
|
|
3115
|
+
"y": 0,
|
|
3116
|
+
"width": 240
|
|
3117
|
+
},
|
|
3118
|
+
"inputs": [],
|
|
3119
|
+
"widget": {
|
|
3120
|
+
"kind": "json",
|
|
3121
|
+
"value": "null"
|
|
3122
|
+
},
|
|
3123
|
+
"control": {
|
|
3124
|
+
"group": "Settings"
|
|
3125
|
+
}
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
"id": "run",
|
|
3129
|
+
"type": "eval",
|
|
3130
|
+
"name": "result",
|
|
3131
|
+
"rect": {
|
|
3132
|
+
"x": 320,
|
|
3133
|
+
"y": 0,
|
|
3134
|
+
"width": 360
|
|
3135
|
+
},
|
|
3136
|
+
"inputs": [
|
|
3137
|
+
{
|
|
3138
|
+
"name": "corpus",
|
|
3139
|
+
"source": "i_corpus"
|
|
3140
|
+
}
|
|
3141
|
+
],
|
|
3142
|
+
"autorun": true,
|
|
3143
|
+
"mode": "function",
|
|
3144
|
+
"view": "auto",
|
|
3145
|
+
"outputs": [
|
|
3146
|
+
{
|
|
3147
|
+
"name": "index"
|
|
3148
|
+
},
|
|
3149
|
+
{
|
|
3150
|
+
"name": "report"
|
|
3151
|
+
}
|
|
3152
|
+
],
|
|
3153
|
+
"code": "if (!corpus) return skip(\"no corpus file yet: choose one in a media pane\");\nconst raw = corpus.$media && corpus.blob ? await corpus.blob.text() : corpus instanceof Blob ? await corpus.text() : corpus;\nconst index = docs.importCorpus(raw);\nreturn { index, report: { fingerprint: index.fingerprint, embedder: index.embedder.id, documents: index.documents.map((d) => ({ name: d.name, kind: d.kind, status: d.status, chunks: d.chunks })), chunks: index.chunks.length } };",
|
|
3154
|
+
"description": "Read a corpus file (a media value, its text or the parsed object; full or compact) back into an index, checking it first: the format and version, every chunk's span and vector, unique ids, documents that exist, and a fingerprint that matches. A file that carries anything credential-shaped (api keys, tokens, secrets) is refused. Wire the index into Search, or into Build document index's `previous` so that only changed documents are read again."
|
|
3155
|
+
}
|
|
3156
|
+
]
|
|
3157
|
+
},
|
|
3158
|
+
"tests": [
|
|
3159
|
+
{
|
|
3160
|
+
"name": "a corpus file reads back as the index it was made from",
|
|
3161
|
+
"inputs": {
|
|
3162
|
+
"corpus": {
|
|
3163
|
+
"format": "viaframe-doc-index",
|
|
3164
|
+
"version": 1,
|
|
3165
|
+
"fingerprint": "0dd4e6e20683af",
|
|
3166
|
+
"embedder": {
|
|
3167
|
+
"id": "hashed-bow-64",
|
|
3168
|
+
"dim": 64
|
|
3169
|
+
},
|
|
3170
|
+
"options": {
|
|
3171
|
+
"size": 80,
|
|
3172
|
+
"overlap": 0
|
|
3173
|
+
},
|
|
3174
|
+
"documents": [
|
|
3175
|
+
{
|
|
3176
|
+
"name": "guide.md",
|
|
3177
|
+
"kind": "markdown",
|
|
3178
|
+
"status": "ok",
|
|
3179
|
+
"source": "1db8ec7e8350c5",
|
|
3180
|
+
"fingerprint": "16baa692b5a4ea",
|
|
3181
|
+
"chars": 180,
|
|
3182
|
+
"chunks": 3
|
|
3183
|
+
},
|
|
3184
|
+
{
|
|
3185
|
+
"name": "pets.txt",
|
|
3186
|
+
"kind": "text",
|
|
3187
|
+
"status": "ok",
|
|
3188
|
+
"source": "127c50544eac5f",
|
|
3189
|
+
"fingerprint": "135380ee2fb211",
|
|
3190
|
+
"chars": 54,
|
|
3191
|
+
"chunks": 1
|
|
3192
|
+
}
|
|
3193
|
+
],
|
|
3194
|
+
"chunks": [
|
|
3195
|
+
{
|
|
3196
|
+
"id": "c_0ae5dd579108",
|
|
3197
|
+
"doc": "guide.md",
|
|
3198
|
+
"index": 0,
|
|
3199
|
+
"start": 0,
|
|
3200
|
+
"end": 76,
|
|
3201
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
3202
|
+
"headings": [
|
|
3203
|
+
"Guide"
|
|
3204
|
+
],
|
|
3205
|
+
"v": [
|
|
3206
|
+
0,
|
|
3207
|
+
0,
|
|
3208
|
+
0,
|
|
3209
|
+
0,
|
|
3210
|
+
-0.3333,
|
|
3211
|
+
0,
|
|
3212
|
+
0,
|
|
3213
|
+
0,
|
|
3214
|
+
-0.3333,
|
|
3215
|
+
0,
|
|
3216
|
+
-0.3333,
|
|
3217
|
+
0.3333,
|
|
3218
|
+
0,
|
|
3219
|
+
0.3333,
|
|
3220
|
+
0,
|
|
3221
|
+
0.3333,
|
|
3222
|
+
0,
|
|
3223
|
+
0,
|
|
3224
|
+
0,
|
|
3225
|
+
0,
|
|
3226
|
+
-0.3333,
|
|
3227
|
+
0,
|
|
3228
|
+
0,
|
|
3229
|
+
0,
|
|
3230
|
+
0,
|
|
3231
|
+
0,
|
|
3232
|
+
0,
|
|
3233
|
+
0,
|
|
3234
|
+
0,
|
|
3235
|
+
0,
|
|
3236
|
+
0,
|
|
3237
|
+
0,
|
|
3238
|
+
0,
|
|
3239
|
+
0,
|
|
3240
|
+
0,
|
|
3241
|
+
0,
|
|
3242
|
+
0,
|
|
3243
|
+
0,
|
|
3244
|
+
0,
|
|
3245
|
+
0,
|
|
3246
|
+
0,
|
|
3247
|
+
0,
|
|
3248
|
+
-0.3333,
|
|
3249
|
+
0,
|
|
3250
|
+
0,
|
|
3251
|
+
0,
|
|
3252
|
+
0,
|
|
3253
|
+
0,
|
|
3254
|
+
0,
|
|
3255
|
+
0,
|
|
3256
|
+
0,
|
|
3257
|
+
0,
|
|
3258
|
+
0,
|
|
3259
|
+
0,
|
|
3260
|
+
0,
|
|
3261
|
+
0,
|
|
3262
|
+
-0.3333,
|
|
3263
|
+
0,
|
|
3264
|
+
0,
|
|
3265
|
+
0,
|
|
3266
|
+
0,
|
|
3267
|
+
0,
|
|
3268
|
+
0,
|
|
3269
|
+
0
|
|
3270
|
+
]
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
"id": "c_19cb7ccbf03d",
|
|
3274
|
+
"doc": "guide.md",
|
|
3275
|
+
"index": 1,
|
|
3276
|
+
"start": 78,
|
|
3277
|
+
"end": 130,
|
|
3278
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
3279
|
+
"headings": [
|
|
3280
|
+
"Guide",
|
|
3281
|
+
"Retention"
|
|
3282
|
+
],
|
|
3283
|
+
"v": [
|
|
3284
|
+
0,
|
|
3285
|
+
0,
|
|
3286
|
+
-0.3536,
|
|
3287
|
+
0,
|
|
3288
|
+
0,
|
|
3289
|
+
0,
|
|
3290
|
+
0,
|
|
3291
|
+
0,
|
|
3292
|
+
0,
|
|
3293
|
+
0,
|
|
3294
|
+
-0.3536,
|
|
3295
|
+
0,
|
|
3296
|
+
0,
|
|
3297
|
+
0,
|
|
3298
|
+
0,
|
|
3299
|
+
0,
|
|
3300
|
+
0,
|
|
3301
|
+
0.7071,
|
|
3302
|
+
0,
|
|
3303
|
+
0,
|
|
3304
|
+
0,
|
|
3305
|
+
0,
|
|
3306
|
+
0,
|
|
3307
|
+
0,
|
|
3308
|
+
0,
|
|
3309
|
+
0,
|
|
3310
|
+
0,
|
|
3311
|
+
0,
|
|
3312
|
+
0,
|
|
3313
|
+
0,
|
|
3314
|
+
0,
|
|
3315
|
+
0,
|
|
3316
|
+
0,
|
|
3317
|
+
0,
|
|
3318
|
+
0,
|
|
3319
|
+
0,
|
|
3320
|
+
0,
|
|
3321
|
+
0.3536,
|
|
3322
|
+
0,
|
|
3323
|
+
0,
|
|
3324
|
+
0,
|
|
3325
|
+
0,
|
|
3326
|
+
0,
|
|
3327
|
+
0,
|
|
3328
|
+
0,
|
|
3329
|
+
0,
|
|
3330
|
+
0,
|
|
3331
|
+
0,
|
|
3332
|
+
0,
|
|
3333
|
+
0,
|
|
3334
|
+
0,
|
|
3335
|
+
0,
|
|
3336
|
+
0,
|
|
3337
|
+
0,
|
|
3338
|
+
0,
|
|
3339
|
+
0,
|
|
3340
|
+
0,
|
|
3341
|
+
0,
|
|
3342
|
+
0,
|
|
3343
|
+
0,
|
|
3344
|
+
0,
|
|
3345
|
+
0,
|
|
3346
|
+
-0.3536,
|
|
3347
|
+
0
|
|
3348
|
+
]
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
"id": "c_060a354910f6",
|
|
3352
|
+
"doc": "guide.md",
|
|
3353
|
+
"index": 2,
|
|
3354
|
+
"start": 131,
|
|
3355
|
+
"end": 179,
|
|
3356
|
+
"text": "The retention policy decides what the log keeps.",
|
|
3357
|
+
"headings": [
|
|
3358
|
+
"Guide",
|
|
3359
|
+
"Retention"
|
|
3360
|
+
],
|
|
3361
|
+
"v": [
|
|
3362
|
+
0,
|
|
3363
|
+
0,
|
|
3364
|
+
0,
|
|
3365
|
+
0,
|
|
3366
|
+
0,
|
|
3367
|
+
0,
|
|
3368
|
+
0,
|
|
3369
|
+
0,
|
|
3370
|
+
-0.3536,
|
|
3371
|
+
0,
|
|
3372
|
+
0,
|
|
3373
|
+
0,
|
|
3374
|
+
0,
|
|
3375
|
+
0,
|
|
3376
|
+
0,
|
|
3377
|
+
0,
|
|
3378
|
+
0,
|
|
3379
|
+
0.7071,
|
|
3380
|
+
0,
|
|
3381
|
+
0,
|
|
3382
|
+
0,
|
|
3383
|
+
0,
|
|
3384
|
+
0,
|
|
3385
|
+
0,
|
|
3386
|
+
0,
|
|
3387
|
+
0,
|
|
3388
|
+
0,
|
|
3389
|
+
0,
|
|
3390
|
+
0,
|
|
3391
|
+
0,
|
|
3392
|
+
0,
|
|
3393
|
+
0,
|
|
3394
|
+
0,
|
|
3395
|
+
0.3536,
|
|
3396
|
+
0,
|
|
3397
|
+
0,
|
|
3398
|
+
0,
|
|
3399
|
+
0,
|
|
3400
|
+
0,
|
|
3401
|
+
0,
|
|
3402
|
+
0,
|
|
3403
|
+
0,
|
|
3404
|
+
0,
|
|
3405
|
+
0,
|
|
3406
|
+
0,
|
|
3407
|
+
0,
|
|
3408
|
+
0,
|
|
3409
|
+
0.3536,
|
|
3410
|
+
0,
|
|
3411
|
+
0,
|
|
3412
|
+
0,
|
|
3413
|
+
0,
|
|
3414
|
+
0,
|
|
3415
|
+
0,
|
|
3416
|
+
0,
|
|
3417
|
+
0,
|
|
3418
|
+
0,
|
|
3419
|
+
0,
|
|
3420
|
+
0,
|
|
3421
|
+
0,
|
|
3422
|
+
0,
|
|
3423
|
+
0,
|
|
3424
|
+
0,
|
|
3425
|
+
0.3536
|
|
3426
|
+
]
|
|
3427
|
+
},
|
|
3428
|
+
{
|
|
3429
|
+
"id": "c_0f69d5c10e0f",
|
|
3430
|
+
"doc": "pets.txt",
|
|
3431
|
+
"index": 0,
|
|
3432
|
+
"start": 0,
|
|
3433
|
+
"end": 54,
|
|
3434
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
3435
|
+
"headings": [],
|
|
3436
|
+
"v": [
|
|
3437
|
+
0,
|
|
3438
|
+
0,
|
|
3439
|
+
0,
|
|
3440
|
+
0,
|
|
3441
|
+
0,
|
|
3442
|
+
0,
|
|
3443
|
+
0,
|
|
3444
|
+
0.2887,
|
|
3445
|
+
0,
|
|
3446
|
+
0.2887,
|
|
3447
|
+
0,
|
|
3448
|
+
0,
|
|
3449
|
+
0,
|
|
3450
|
+
0.2887,
|
|
3451
|
+
0,
|
|
3452
|
+
0,
|
|
3453
|
+
0,
|
|
3454
|
+
0,
|
|
3455
|
+
-0.5774,
|
|
3456
|
+
0,
|
|
3457
|
+
0,
|
|
3458
|
+
0,
|
|
3459
|
+
0,
|
|
3460
|
+
0,
|
|
3461
|
+
0,
|
|
3462
|
+
0,
|
|
3463
|
+
0,
|
|
3464
|
+
0,
|
|
3465
|
+
0,
|
|
3466
|
+
0,
|
|
3467
|
+
-0.2887,
|
|
3468
|
+
0,
|
|
3469
|
+
0,
|
|
3470
|
+
0,
|
|
3471
|
+
0,
|
|
3472
|
+
0.5774,
|
|
3473
|
+
0,
|
|
3474
|
+
0,
|
|
3475
|
+
0,
|
|
3476
|
+
0,
|
|
3477
|
+
0,
|
|
3478
|
+
0,
|
|
3479
|
+
0,
|
|
3480
|
+
0,
|
|
3481
|
+
0,
|
|
3482
|
+
0,
|
|
3483
|
+
0,
|
|
3484
|
+
0,
|
|
3485
|
+
0,
|
|
3486
|
+
0,
|
|
3487
|
+
0,
|
|
3488
|
+
0,
|
|
3489
|
+
0,
|
|
3490
|
+
0,
|
|
3491
|
+
0,
|
|
3492
|
+
0,
|
|
3493
|
+
0,
|
|
3494
|
+
0,
|
|
3495
|
+
0,
|
|
3496
|
+
0,
|
|
3497
|
+
0,
|
|
3498
|
+
0,
|
|
3499
|
+
0,
|
|
3500
|
+
0
|
|
3501
|
+
]
|
|
3502
|
+
}
|
|
3503
|
+
]
|
|
3504
|
+
}
|
|
3505
|
+
},
|
|
3506
|
+
"expect": {
|
|
3507
|
+
"result.report": {
|
|
3508
|
+
"matches": "\"chunks\":4\\}$"
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
},
|
|
3512
|
+
{
|
|
3513
|
+
"name": "a compact corpus file reads back too",
|
|
3514
|
+
"inputs": {
|
|
3515
|
+
"corpus": {
|
|
3516
|
+
"format": "viaframe-doc-index",
|
|
3517
|
+
"version": 2,
|
|
3518
|
+
"fingerprint": "0dd4e6e20683af",
|
|
3519
|
+
"embedder": {
|
|
3520
|
+
"id": "hashed-bow-64",
|
|
3521
|
+
"dim": 64
|
|
3522
|
+
},
|
|
3523
|
+
"options": {
|
|
3524
|
+
"size": 80,
|
|
3525
|
+
"overlap": 0
|
|
3526
|
+
},
|
|
3527
|
+
"documents": [
|
|
3528
|
+
{
|
|
3529
|
+
"name": "guide.md",
|
|
3530
|
+
"kind": "markdown",
|
|
3531
|
+
"status": "ok",
|
|
3532
|
+
"source": "1db8ec7e8350c5",
|
|
3533
|
+
"fingerprint": "16baa692b5a4ea",
|
|
3534
|
+
"chars": 180,
|
|
3535
|
+
"chunks": 3
|
|
3536
|
+
},
|
|
3537
|
+
{
|
|
3538
|
+
"name": "pets.txt",
|
|
3539
|
+
"kind": "text",
|
|
3540
|
+
"status": "ok",
|
|
3541
|
+
"source": "127c50544eac5f",
|
|
3542
|
+
"fingerprint": "135380ee2fb211",
|
|
3543
|
+
"chars": 54,
|
|
3544
|
+
"chunks": 1
|
|
3545
|
+
}
|
|
3546
|
+
],
|
|
3547
|
+
"chunks": [
|
|
3548
|
+
{
|
|
3549
|
+
"id": "c_0ae5dd579108",
|
|
3550
|
+
"doc": "guide.md",
|
|
3551
|
+
"index": 0,
|
|
3552
|
+
"start": 0,
|
|
3553
|
+
"end": 76,
|
|
3554
|
+
"text": "# Guide\n\nViaframe keeps every document in your browser. Nothing is uploaded.",
|
|
3555
|
+
"headings": [
|
|
3556
|
+
"Guide"
|
|
3557
|
+
],
|
|
3558
|
+
"s": 0.3333,
|
|
3559
|
+
"q": "gYGBf39/gYGB",
|
|
3560
|
+
"i": [
|
|
3561
|
+
4,
|
|
3562
|
+
8,
|
|
3563
|
+
10,
|
|
3564
|
+
11,
|
|
3565
|
+
13,
|
|
3566
|
+
15,
|
|
3567
|
+
20,
|
|
3568
|
+
42,
|
|
3569
|
+
56
|
|
3570
|
+
]
|
|
3571
|
+
},
|
|
3572
|
+
{
|
|
3573
|
+
"id": "c_19cb7ccbf03d",
|
|
3574
|
+
"doc": "guide.md",
|
|
3575
|
+
"index": 1,
|
|
3576
|
+
"start": 78,
|
|
3577
|
+
"end": 130,
|
|
3578
|
+
"text": "## Retention\n\nChunk text is payload for the run log.",
|
|
3579
|
+
"headings": [
|
|
3580
|
+
"Guide",
|
|
3581
|
+
"Retention"
|
|
3582
|
+
],
|
|
3583
|
+
"s": 0.7071,
|
|
3584
|
+
"q": "wMB/QMA=",
|
|
3585
|
+
"i": [
|
|
3586
|
+
2,
|
|
3587
|
+
10,
|
|
3588
|
+
17,
|
|
3589
|
+
37,
|
|
3590
|
+
62
|
|
3591
|
+
]
|
|
3592
|
+
},
|
|
3593
|
+
{
|
|
3594
|
+
"id": "c_060a354910f6",
|
|
3595
|
+
"doc": "guide.md",
|
|
3596
|
+
"index": 2,
|
|
3597
|
+
"start": 131,
|
|
3598
|
+
"end": 179,
|
|
3599
|
+
"text": "The retention policy decides what the log keeps.",
|
|
3600
|
+
"headings": [
|
|
3601
|
+
"Guide",
|
|
3602
|
+
"Retention"
|
|
3603
|
+
],
|
|
3604
|
+
"s": 0.7071,
|
|
3605
|
+
"q": "wH9AQEA=",
|
|
3606
|
+
"i": [
|
|
3607
|
+
8,
|
|
3608
|
+
17,
|
|
3609
|
+
33,
|
|
3610
|
+
47,
|
|
3611
|
+
63
|
|
3612
|
+
]
|
|
3613
|
+
},
|
|
3614
|
+
{
|
|
3615
|
+
"id": "c_0f69d5c10e0f",
|
|
3616
|
+
"doc": "pets.txt",
|
|
3617
|
+
"index": 0,
|
|
3618
|
+
"start": 0,
|
|
3619
|
+
"end": 54,
|
|
3620
|
+
"text": "Cats purr. Dogs bark loudly at the mailman. Fish swim.",
|
|
3621
|
+
"headings": [],
|
|
3622
|
+
"s": 0.5774,
|
|
3623
|
+
"q": "QEBAgcF/",
|
|
3624
|
+
"i": [
|
|
3625
|
+
7,
|
|
3626
|
+
9,
|
|
3627
|
+
13,
|
|
3628
|
+
18,
|
|
3629
|
+
30,
|
|
3630
|
+
35
|
|
3631
|
+
]
|
|
3632
|
+
}
|
|
3633
|
+
]
|
|
3634
|
+
}
|
|
3635
|
+
},
|
|
3636
|
+
"expect": {
|
|
3637
|
+
"result.report": {
|
|
3638
|
+
"matches": "\"chunks\":4\\}$"
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
],
|
|
3643
|
+
"hosts": []
|
|
3644
|
+
}
|
|
3645
|
+
]
|
|
3646
|
+
}
|