@equationalapplications/expo-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.
Files changed (2) hide show
  1. package/README.md +37 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -122,6 +122,8 @@ const wiki = createWiki(db, {
122
122
  staleInferredAfterDays: 60, // default: 60 (days before runHeal downgrades inferred facts; null to disable)
123
123
  preFilterLimit: 50, // default: undefined — MiniSearch pre-filter before cosine scan; recommended for >500 facts
124
124
  hybridWeight: 0.7, // default: undefined — blend semantic (1.0) ↔ keyword (0.0); pure semantic when unset
125
+ excludeDrafts: false, // default: false — hide unreviewed drafts from reads; traversal skips discovered drafts (a draft start fact is still returned)
126
+ grounding: { mode: 'off' }, // default: off — 'draft' stores facts that don't quote their source as drafts
125
127
 
126
128
  // Global prompt overrides — librarianSystemPrompt and healSystemPrompt apply to write() auto-runs;
127
129
  // ingestSystemPrompt applies only to explicit ingestDocument() calls.
@@ -136,6 +138,41 @@ const wiki = createWiki(db, {
136
138
  });
137
139
  ```
138
140
 
141
+ **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).
142
+
143
+ ```tsx
144
+ import { useWiki } from '@equationalapplications/expo-llm-wiki';
145
+
146
+ function DraftReview({ entityId }: { entityId: string }) {
147
+ const wiki = useWiki(); // the WikiMemory instance; throws outside <WikiProvider>
148
+ const loadDrafts = () => wiki.listDrafts(entityId, { limit: 20 }); // → { facts, nextCursor }
149
+ // ...
150
+ }
151
+ ```
152
+
153
+ `useWiki()` also exposes the read-only health and instruction APIs for components that need them:
154
+
155
+ ```tsx
156
+ function HealthAndInstructions({ entityId, batch }: { entityId: string; batch: Array<{ sourceRef: string; sourceHash: string }> }) {
157
+ const wiki = useWiki();
158
+
159
+ // Lint: read-only health report for one entity (dangling edges, manifest violations, drafts, etc.)
160
+ const loadReport = () => wiki.lint(entityId);
161
+ // → { danglingEdges, manifestViolations, untypedFacts, drafts, unverifiedInferred,
162
+ // sample: { danglingEdgeIds, manifestViolationEdgeIds } }
163
+
164
+ // pendingSources: per-input change status including the partial-ingest state.
165
+ const loadStatuses = () => wiki.pendingSources(entityId, batch);
166
+ // → Array<{ sourceRef: string; status: 'new' | 'changed' | 'partial' | 'current' }>
167
+
168
+ // getInstructions: effective system prompts for each writer, with overrides applied.
169
+ const loadInstructions = () => wiki.getInstructions(entityId);
170
+ // → { ingest, librarian, heal, ontologyBackfill }
171
+ }
172
+ ```
173
+
174
+ 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).
175
+
139
176
  ## Retrieval Tuning
140
177
 
141
178
  Optimize `read()` performance and blend retrieval strategies:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equationalapplications/expo-llm-wiki",
3
- "version": "7.5.0",
3
+ "version": "7.7.0",
4
4
  "description": "Local-first LLM memory for Expo and React Native. Combines the core semantic search and extraction engine with expo-sqlite and ready-to-use React hooks.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -55,8 +55,8 @@
55
55
  "registry": "https://registry.npmjs.org"
56
56
  },
57
57
  "dependencies": {
58
- "@equationalapplications/core-llm-wiki": "7.5.0",
59
- "@equationalapplications/react-llm-wiki": "7.5.0"
58
+ "@equationalapplications/core-llm-wiki": "7.7.0",
59
+ "@equationalapplications/react-llm-wiki": "7.7.0"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "expo-crypto": ">=12",