@equationalapplications/react-llm-wiki 7.5.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -123,6 +123,8 @@ const wiki = createWiki(adapter, {
|
|
|
123
123
|
staleInferredAfterDays: 60, // default: 60 (days before runHeal downgrades inferred facts; null to disable)
|
|
124
124
|
preFilterLimit: 50, // default: undefined — MiniSearch pre-filter before cosine scan; recommended for >500 facts
|
|
125
125
|
hybridWeight: 0.7, // default: undefined — blend semantic (1.0) ↔ keyword (0.0); pure semantic when unset
|
|
126
|
+
excludeDrafts: false, // default: false — hide unreviewed drafts from reads; traversal skips discovered drafts (a draft start fact is still returned)
|
|
127
|
+
grounding: { mode: 'off' }, // default: off — 'draft' stores facts that don't quote their source as drafts
|
|
126
128
|
|
|
127
129
|
// Global prompt overrides — librarianSystemPrompt and healSystemPrompt apply to write() auto-runs;
|
|
128
130
|
// ingestSystemPrompt applies only to explicit ingestDocument() calls.
|
|
@@ -137,6 +139,41 @@ const wiki = createWiki(adapter, {
|
|
|
137
139
|
});
|
|
138
140
|
```
|
|
139
141
|
|
|
142
|
+
**Diagnostics and draft review.** Pass `onDiagnostic` beside `llmProvider` (not inside `config`) to receive typed, content-free reports of dropped chunks, facts, edges and failed background jobs. `useMemoryRead` and `useWikiTraversal` accept `excludeDrafts` per call, which overrides the config default. There are no dedicated hooks for listing or promoting drafts yet: call `listDrafts` / `promoteDraft` on the `WikiMemory` instance from `useWiki()`, as shown below. With `grounding` on, facts that don't quote their source land as drafts; see [core: Grounding](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#grounding). See [core: Diagnostics](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#diagnostics) and [core: Draft Review](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#draft-review). Other `WikiConfig` fields, such as `ontology`, are documented in the [core README](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#configuration).
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
import { useWiki } from '@equationalapplications/react-llm-wiki';
|
|
146
|
+
|
|
147
|
+
function DraftReview({ entityId }: { entityId: string }) {
|
|
148
|
+
const wiki = useWiki(); // the WikiMemory instance; throws outside <WikiProvider>
|
|
149
|
+
const loadDrafts = () => wiki.listDrafts(entityId, { limit: 20 }); // → { facts, nextCursor }
|
|
150
|
+
// ...
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
`useWiki()` also exposes the read-only health and instruction APIs for components that need them:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
function HealthAndInstructions({ entityId, batch }: { entityId: string; batch: Array<{ sourceRef: string; sourceHash: string }> }) {
|
|
158
|
+
const wiki = useWiki();
|
|
159
|
+
|
|
160
|
+
// Lint: read-only health report for one entity (dangling edges, manifest violations, drafts, etc.)
|
|
161
|
+
const loadReport = () => wiki.lint(entityId);
|
|
162
|
+
// → { danglingEdges, manifestViolations, untypedFacts, drafts, unverifiedInferred,
|
|
163
|
+
// sample: { danglingEdgeIds, manifestViolationEdgeIds } }
|
|
164
|
+
|
|
165
|
+
// pendingSources: per-input change status including the partial-ingest state.
|
|
166
|
+
const loadStatuses = () => wiki.pendingSources(entityId, batch);
|
|
167
|
+
// → Array<{ sourceRef: string; status: 'new' | 'changed' | 'partial' | 'current' }>
|
|
168
|
+
|
|
169
|
+
// getInstructions: effective system prompts for each writer, with overrides applied.
|
|
170
|
+
const loadInstructions = () => wiki.getInstructions(entityId);
|
|
171
|
+
// → { ingest, librarian, heal, ontologyBackfill }
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
See [core: Lint](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#lint), [core: Batch Change Detection](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#batch-change-detection), and [core: Effective instructions](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#effective-instructions-getinstructions).
|
|
176
|
+
|
|
140
177
|
## Retrieval Tuning
|
|
141
178
|
|
|
142
179
|
Optimize `read()` performance and blend retrieval strategies:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equationalapplications/react-llm-wiki",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "In-browser LLM memory for React web apps. Bring your own SQLite adapter (e.g., sql.js WebAssembly) for a complete, zero-server RAG experience.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"registry": "https://registry.npmjs.org"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@equationalapplications/core-llm-wiki": "7.
|
|
59
|
+
"@equationalapplications/core-llm-wiki": "7.7.0"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20"
|