@knolo/core 3.1.2 → 3.1.3
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 +176 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# 📦 `@knolo/core`
|
|
4
|
+
|
|
5
|
+
# @knolo/core
|
|
6
|
+
|
|
7
|
+
KnoLo Core is a **local-first knowledge base engine for small language models (LLMs)**.
|
|
8
|
+
|
|
9
|
+
It allows you to package structured documents into a compact `.knolo` file and query them deterministically — **no embeddings, no vector databases, no cloud required**.
|
|
10
|
+
|
|
11
|
+
Designed for:
|
|
12
|
+
- On-device LLMs
|
|
13
|
+
- Deterministic AI systems
|
|
14
|
+
- Agent routing
|
|
15
|
+
- Air-gapped or privacy-first environments
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ✨ Why KnoLo?
|
|
20
|
+
|
|
21
|
+
Traditional RAG systems require:
|
|
22
|
+
- Embeddings
|
|
23
|
+
- Vector databases
|
|
24
|
+
- External services
|
|
25
|
+
- Non-deterministic similarity scoring
|
|
26
|
+
|
|
27
|
+
KnoLo uses:
|
|
28
|
+
- Structured indexing
|
|
29
|
+
- Namespace-based routing
|
|
30
|
+
- Deterministic query resolution
|
|
31
|
+
- Compact `.knolo` bundles
|
|
32
|
+
|
|
33
|
+
This makes it:
|
|
34
|
+
- Fast
|
|
35
|
+
- Reproducible
|
|
36
|
+
- Lightweight
|
|
37
|
+
- Fully local
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 📦 Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @knolo/core
|
|
45
|
+
````
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🚀 Basic Usage
|
|
50
|
+
|
|
51
|
+
### 1️⃣ Mount a Knowledge Pack
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { mountPack } from "@knolo/core";
|
|
55
|
+
|
|
56
|
+
const pack = await mountPack("./dist/knowledge.knolo");
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### 2️⃣ Query the Pack
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { query } from "@knolo/core";
|
|
65
|
+
|
|
66
|
+
const results = query(pack, {
|
|
67
|
+
namespace: "mobile",
|
|
68
|
+
q: "debounce vs throttle"
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
console.log(results);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### 3️⃣ Resolve an Agent
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { resolveAgent } from "@knolo/core";
|
|
80
|
+
|
|
81
|
+
const resolved = resolveAgent(pack, {
|
|
82
|
+
agentId: "support-agent",
|
|
83
|
+
query: "Explain debounce vs throttle",
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Supports patch variables:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
resolveAgent(pack, {
|
|
91
|
+
agentId: "support-agent",
|
|
92
|
+
patch: { tone: "formal" },
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🤖 Agents
|
|
99
|
+
|
|
100
|
+
Agents are defined inside the pack metadata.
|
|
101
|
+
|
|
102
|
+
Phase 2 features include:
|
|
103
|
+
|
|
104
|
+
* Agent routing profiles
|
|
105
|
+
* Deterministic route validation
|
|
106
|
+
* Tool policies (`allow_all`, `mixed`, `unknown`)
|
|
107
|
+
* Registry validation at mount-time
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 🛠 Tool Policy Helpers
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { isToolAllowed, assertToolAllowed } from "@knolo/core";
|
|
115
|
+
|
|
116
|
+
isToolAllowed(agent, "web-search");
|
|
117
|
+
assertToolAllowed(agent, "database-read");
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Default behavior:
|
|
121
|
+
|
|
122
|
+
* If no policy → allow all
|
|
123
|
+
* Explicit deny → deterministic error
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 📁 .knolo Format
|
|
128
|
+
|
|
129
|
+
A `.knolo` file contains:
|
|
130
|
+
|
|
131
|
+
* Indexed documents
|
|
132
|
+
* Namespaces
|
|
133
|
+
* Agent registry
|
|
134
|
+
* Metadata
|
|
135
|
+
* Routing profiles
|
|
136
|
+
|
|
137
|
+
Built using `@knolo/cli`.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🧠 Design Philosophy
|
|
142
|
+
|
|
143
|
+
KnoLo is built around:
|
|
144
|
+
|
|
145
|
+
* Determinism over probability
|
|
146
|
+
* Structure over embeddings
|
|
147
|
+
* Local-first AI
|
|
148
|
+
* Small model optimization
|
|
149
|
+
* Agent-native architecture
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 🔐 Use Cases
|
|
154
|
+
|
|
155
|
+
* On-device assistants
|
|
156
|
+
* Enterprise internal knowledge
|
|
157
|
+
* Mobile AI apps
|
|
158
|
+
* Secure environments
|
|
159
|
+
* Offline-first systems
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 🗺 Roadmap
|
|
164
|
+
|
|
165
|
+
* Rust core implementation
|
|
166
|
+
* WASM builds
|
|
167
|
+
* Multi-language SDKs
|
|
168
|
+
* Advanced agent routing
|
|
169
|
+
* Deterministic tool orchestration
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 📄 License
|
|
174
|
+
|
|
175
|
+
MIT
|
|
176
|
+
|