@equationalapplications/core-llm-wiki 4.9.0 → 4.10.1
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 +19 -7
- package/package.json +24 -2
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @equationalapplications/core-llm-wiki
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Platform-agnostic TypeScript engine for hybrid LLM memory. Features episodic fact extraction, semantic vector search, and multi-agent architectures over SQLite. Bring your own adapter.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@equationalapplications/core-llm-wiki) [](https://www.npmjs.com/package/@equationalapplications/core-llm-wiki)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](LICENSE)
|
|
7
|
+
[](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/LICENSE)
|
|
8
|
+
|
|
9
|
+
**[GitHub](https://github.com/equationalapplications/expo-llm-wiki)** · **[Playground](https://equationalapplications.github.io/expo-llm-wiki/playground/)** · **[Changelog](https://github.com/equationalapplications/expo-llm-wiki/blob/main/CHANGELOG.md)** · **[Issues](https://github.com/equationalapplications/expo-llm-wiki/issues)**
|
|
8
10
|
|
|
9
11
|
> Inspired by [Andrej Karpathy's LLM Wiki memory spec](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@ Pure TypeScript business logic for LLM Wiki Memory.
|
|
|
12
14
|
|
|
13
15
|
- **Platform-agnostic** — Zero runtime dependencies; works with any SQLite driver via the `SQLiteAdapter` interface
|
|
14
16
|
- **Semantic search** — Vector embeddings via your LLM's `embed` function, ranked by cosine similarity
|
|
15
|
-
- **Keyword fallback** — MiniSearch in-memory index for offline/degraded scenarios when embeddings unavailable
|
|
17
|
+
- **Keyword fallback** — [MiniSearch](https://github.com/lucaong/minisearch) in-memory index for offline/degraded scenarios when embeddings unavailable
|
|
16
18
|
- **Retrieval tuning** — Per-call overrides for `maxResults`, `preFilterLimit`, `hybridWeight`, `tierWeights`, and `includeZeroWeightEntities`
|
|
17
19
|
- **Multi-entity reads** — Search across multiple `entity_id` namespaces in one pass with per-entity score multipliers (`tierWeights`); optional `factScores` and `metadata` for explainability
|
|
18
20
|
- **Immutable vs mutable facts** — Use `WikiFact.source_type` to distinguish document-sourced facts (`immutable_document`) from derived or user-provided facts (`librarian_inferred`, `user_stated`, `user_confirmed`). Immutable document facts are not rewritten by `runLibrarian()` or `runHeal()` and can only be removed by `forget()` or re-ingesting.
|
|
@@ -240,7 +242,7 @@ When `preFilterLimit: 50` is set with 1000 facts, cosine similarity is computed
|
|
|
240
242
|
|
|
241
243
|
## Pluggable Vector Retrieval
|
|
242
244
|
|
|
243
|
-
When your entity corpus grows, in-process cosine similarity scoring becomes a bottleneck. The optional **`VectorRanker`** interface lets you delegate semantic ranking to **sqlite-vec
|
|
245
|
+
When your entity corpus grows, in-process cosine similarity scoring becomes a bottleneck. The optional **`VectorRanker`** interface lets you delegate semantic ranking to [**sqlite-vec**](https://github.com/asg017/sqlite-vec), [**sqlite-vss**](https://github.com/asg017/sqlite-vss), or an external vector database while `WikiMemory` handles embedding validation, hybrid scoring, and tier-2 row hydration.
|
|
244
246
|
|
|
245
247
|
### `VectorRanker` purpose
|
|
246
248
|
|
|
@@ -455,7 +457,7 @@ If implementing a custom `VectorRanker`:
|
|
|
455
457
|
- **Credential Scrubbing**: Strip API keys, tokens, connection strings from thrown errors before surfacing to host.
|
|
456
458
|
- **Resource Limits**: Cap `limit` and `candidateIds.length` to prevent DoS. Do NOT retain `vector` references beyond callback scope — blocks GC.
|
|
457
459
|
|
|
458
|
-
See [SECURITY.md](
|
|
460
|
+
See [SECURITY.md](https://github.com/equationalapplications/expo-llm-wiki/blob/main/SECURITY.md) for complete adapter security guidance and code examples.
|
|
459
461
|
|
|
460
462
|
### Host Application Security
|
|
461
463
|
|
|
@@ -585,7 +587,7 @@ export interface SQLiteAdapter {
|
|
|
585
587
|
|
|
586
588
|
`@equationalapplications/expo-llm-wiki` provides a pre-built adapter for Expo/React Native. For web and Node.js, implement the interface yourself — examples below.
|
|
587
589
|
|
|
588
|
-
**Browser (sql.js):**
|
|
590
|
+
**Browser ([sql.js](https://github.com/sql-js/sql.js)):**
|
|
589
591
|
|
|
590
592
|
```typescript
|
|
591
593
|
import initSqlJs from 'sql.js';
|
|
@@ -625,7 +627,7 @@ const adapter: SQLiteAdapter = {
|
|
|
625
627
|
};
|
|
626
628
|
```
|
|
627
629
|
|
|
628
|
-
**Node.js (better-sqlite3):**
|
|
630
|
+
**Node.js ([better-sqlite3](https://github.com/WiseLibs/better-sqlite3)):**
|
|
629
631
|
|
|
630
632
|
```typescript
|
|
631
633
|
import Database from 'better-sqlite3';
|
|
@@ -690,6 +692,16 @@ The flowchart shows:
|
|
|
690
692
|
5. **Hybrid scoring** to blend semantic and keyword rankings
|
|
691
693
|
6. **Vector caching** on full scans only; reads with `preFilterLimit` active skip cache population
|
|
692
694
|
|
|
695
|
+
## Monorepo Ecosystem
|
|
696
|
+
|
|
697
|
+
| Package | Description |
|
|
698
|
+
|---------|-------------|
|
|
699
|
+
| **`@equationalapplications/core-llm-wiki`** | Pure TypeScript core — DB-agnostic, bring your own SQLite adapter |
|
|
700
|
+
| [`@equationalapplications/expo-llm-wiki`](https://www.npmjs.com/package/@equationalapplications/expo-llm-wiki) | Expo / React Native adapter with `expo-sqlite` |
|
|
701
|
+
| [`@equationalapplications/react-llm-wiki`](https://www.npmjs.com/package/@equationalapplications/react-llm-wiki) | React hooks + web adapter with `sql.js` |
|
|
702
|
+
| [`@equationalapplications/prisma-outbox`](https://www.npmjs.com/package/@equationalapplications/prisma-outbox) | Sync SQLite outbox events to Prisma in a transaction |
|
|
703
|
+
| [`@equationalapplications/core-llm-tools`](https://www.npmjs.com/package/@equationalapplications/core-llm-tools) | Platform-agnostic Gemini tool schemas + capability scope injector |
|
|
704
|
+
|
|
693
705
|
## License
|
|
694
706
|
|
|
695
707
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equationalapplications/core-llm-wiki",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.10.1",
|
|
4
|
+
"description": "Platform-agnostic TypeScript engine for hybrid LLM memory. Features episodic fact extraction, semantic vector search, and multi-agent architectures over SQLite. Bring your own adapter.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,6 +23,28 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"llm-memory",
|
|
28
|
+
"ai-memory",
|
|
29
|
+
"rag",
|
|
30
|
+
"sqlite",
|
|
31
|
+
"vector-search",
|
|
32
|
+
"episodic-memory",
|
|
33
|
+
"semantic-memory",
|
|
34
|
+
"multi-agent",
|
|
35
|
+
"typescript",
|
|
36
|
+
"gemini",
|
|
37
|
+
"openai"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/equationalapplications/expo-llm-wiki.git",
|
|
42
|
+
"directory": "packages/core"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/equationalapplications/expo-llm-wiki/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/equationalapplications/expo-llm-wiki/tree/main/packages/core#readme",
|
|
26
48
|
"publishConfig": {
|
|
27
49
|
"access": "public",
|
|
28
50
|
"registry": "https://registry.npmjs.org"
|