You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7480906
Browse filesBrowse the repository at this point in the historyBrowse files
| queryExpansion | QueryExpansionOptions |false|false| Query expansion with user-provided synonym map. false disables. Without synonyms, expansion is a no-op. |
Use `readOnly: true` when `.zvec` files are prepared elsewhere and the current process should only query them:
105
+
106
+
```typescript
107
+
const ctx = await Context.create({
108
+
vectorsDir: '.context/vectors',
109
+
readOnly: true,
110
+
});
111
+
112
+
const results = await ctx.query('How to configure a line chart', { library: 'g2' });
113
+
```
114
+
115
+
In read-only mode, `Context` opens existing `${library}.zvec` files with `ZVecOpen`. It does not create missing stores, and `load()` will throw because it would mutate the zvec file.
116
+
101
117
### `ctx.load(library, pattern)`
102
118
103
119
Load files into a specified library with automatic batch vectorization. Documents are embedded in batches and inserted into the vector store. A content-hash change detection mechanism re-embeds files whose content has changed since the last load.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@antv/context",
3
-
"version": "0.1.0",
3
+
"version": "0.1.1",
4
4
"description": "A local context retrieval library that enables semantic search over your documentation. It loads documents (Markdown, JSON, Text), vectorizes them using [Transformers.js](https://huggingface.co/transformers.js), and stores vectors locally in `.zvec` files for fast semantic querying. ",
0 commit comments