@equationalapplications/expo-llm-wiki 4.5.0 → 4.6.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 +42 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -15,7 +15,9 @@ Expo/React Native adapter for @equationalapplications/core-llm-wiki, powered by
15
15
  - **Expo-ready** — Pre-configured for React Native + Expo
16
16
  - **Built on `expo-sqlite`** — Stable, well-supported SQLite driver
17
17
  - **Semantic search** — Vector embeddings via `embed` function, with MiniSearch fallback
18
- - **Retrieval tuning** — Per-call overrides for search behavior (pre-filter, hybrid blend)
18
+ - **Retrieval tuning** — Per-call overrides for search behavior (pre-filter, hybrid blend, tier weights)
19
+ - **Multi-entity reads** — Search across multiple `entity_id` namespaces in one pass with `tierWeights`
20
+ - **Source provenance** — `WikiFact.source_type` distinguishes immutable document facts (`immutable_document`) from mutable derived/user facts. Immutable document content is protected from librarian/heal rewriting and only changed by `forget()` or re-ingest.
19
21
  - **React hooks** — `WikiProvider`, `useMemoryRead`, and all other hooks are re-exported directly from `@equationalapplications/expo-llm-wiki`
20
22
  - **Full-featured memory** — Facts, tasks, events, maintenance jobs (librarian, heal, reembed, prune)
21
23
 
@@ -76,6 +78,19 @@ const fasterSearch = await wiki.read('user-123', 'activities', {
76
78
  preFilterLimit: 20, // Tighter pre-filter for speed
77
79
  hybridWeight: 0.5, // More keyword weight
78
80
  });
81
+
82
+ // Multi-entity with tier weights
83
+ const multiMemory = await wiki.read(['tier_wisdom', 'tier_fact', 'tier_working'], 'activities', {
84
+ maxResults: 8,
85
+ tierWeights: {
86
+ tier_wisdom: 2, // boost curated notes 2×
87
+ tier_fact: 1, // neutral baseline
88
+ tier_working: 0.25, // downrank unvetted context
89
+ },
90
+ // includeZeroWeightEntities: true — include 0-weight entities as bottom-ranked filler
91
+ });
92
+ // multiMemory.factScores — Record<factId, weightedScore> | undefined (array entityId only, populated when query is non-empty and at least one fact scored)
93
+ // multiMemory.metadata — { query, entityIds, tierWeights }
79
94
  ```
80
95
 
81
96
  ## Configuration
@@ -219,7 +234,7 @@ flowchart TD
219
234
 
220
235
  ```mermaid
221
236
  flowchart TD
222
- A["read(entityId, query)"] --> B{hybridWeight = 0?}
237
+ A["read(entityId | entityId[], query, options?)"] --> B{hybridWeight = 0?}
223
238
  B -->|Yes| C["MiniSearch only<br/>(skip embed)"]
224
239
  B -->|No| D{embed available?}
225
240
  D -->|No| C
@@ -251,6 +266,31 @@ The flowchart shows:
251
266
  5. **Hybrid scoring** to blend semantic and keyword rankings
252
267
  6. **Vector caching** on full scans only; reads with `preFilterLimit` active skip cache population
253
268
 
269
+ ## Multi-Entity Reads
270
+
271
+ `read()` accepts a single entity ID or an array to search across namespaces in one retrieval pass. Pass `tierWeights` to control per-entity ranking before the final top-K results:
272
+
273
+ ```typescript
274
+ const memory = await wiki.read(
275
+ ['tier_wisdom', 'tier_fact', 'tier_working'],
276
+ 'What do I know about this topic?',
277
+ {
278
+ maxResults: 8,
279
+ tierWeights: {
280
+ tier_wisdom: 2, // boost curated notes 2×
281
+ tier_fact: 1, // neutral
282
+ tier_working: 0.25, // downrank unvetted context
283
+ },
284
+ }
285
+ );
286
+ // memory.factScores — Record<factId, weightedScore> | undefined
287
+ // attached for array-shaped reads when the query is non-empty and at least one fact is scored
288
+ // memory.metadata — { query, entityIds, tierWeights }
289
+ // tasks capped at min(20 × entityCount, 200); events at min(10 × entityCount, 100)
290
+ ```
291
+
292
+ For Librarian prompt utilities (`hydrateLibrarianPrompt`, `validateLibrarianPromptTemplate`, etc.), see [`packages/core/README.md`](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#librarian-prompt-override-contract).
293
+
254
294
  ## License
255
295
 
256
296
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equationalapplications/expo-llm-wiki",
3
- "version": "4.5.0",
3
+ "version": "4.6.0",
4
4
  "description": "Expo/React Native adapter for @equationalapplications/core-llm-wiki.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,8 +28,8 @@
28
28
  "registry": "https://registry.npmjs.org"
29
29
  },
30
30
  "dependencies": {
31
- "@equationalapplications/core-llm-wiki": "4.5.0",
32
- "@equationalapplications/react-llm-wiki": "4.5.0"
31
+ "@equationalapplications/core-llm-wiki": "4.6.0",
32
+ "@equationalapplications/react-llm-wiki": "4.6.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "expo-sqlite": "^14.0.0 || ^15.0.0 || ^55.0.0",