@kibhq/core 0.1.0 → 0.2.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 +68 -0
- package/package.json +13 -1
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @kibhq/core
|
|
2
|
+
|
|
3
|
+
Core engine for [kib](https://github.com/keeganthomp/kib) — the headless knowledge compiler.
|
|
4
|
+
|
|
5
|
+
This package provides the vault operations, LLM providers, ingest extractors, compile engine, BM25 search, and RAG query engine that power the `kib` CLI.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @kibhq/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> Most users should install the CLI instead: `npm i -g @kibhq/cli`
|
|
14
|
+
|
|
15
|
+
## What's inside
|
|
16
|
+
|
|
17
|
+
| Module | Description |
|
|
18
|
+
|--------|-------------|
|
|
19
|
+
| **Vault** | Filesystem operations, manifest tracking, config management |
|
|
20
|
+
| **Ingest** | Extractors for web pages, PDFs, YouTube, GitHub repos, and local files |
|
|
21
|
+
| **Compile** | LLM-powered compilation from raw sources into structured wiki articles |
|
|
22
|
+
| **Search** | BM25 full-text search with English stemming |
|
|
23
|
+
| **Query** | RAG engine — retrieves relevant articles and generates cited answers |
|
|
24
|
+
| **Lint** | 5 health-check rules (orphan articles, broken links, stale sources, etc.) |
|
|
25
|
+
| **Skills** | Skill loader and runner for extensible vault operations |
|
|
26
|
+
| **Providers** | LLM adapters for Anthropic Claude, OpenAI, and Ollama |
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import {
|
|
32
|
+
resolveVaultRoot,
|
|
33
|
+
loadManifest,
|
|
34
|
+
loadConfig,
|
|
35
|
+
SearchIndex,
|
|
36
|
+
queryVault,
|
|
37
|
+
ingestSource,
|
|
38
|
+
compileVault,
|
|
39
|
+
createProvider,
|
|
40
|
+
} from "@kibhq/core";
|
|
41
|
+
|
|
42
|
+
// Find the vault
|
|
43
|
+
const root = resolveVaultRoot();
|
|
44
|
+
const config = await loadConfig(root);
|
|
45
|
+
const manifest = await loadManifest(root);
|
|
46
|
+
|
|
47
|
+
// Search
|
|
48
|
+
const index = new SearchIndex();
|
|
49
|
+
await index.build(root, "all");
|
|
50
|
+
const results = index.search("attention mechanisms", { limit: 10 });
|
|
51
|
+
|
|
52
|
+
// RAG query
|
|
53
|
+
const provider = await createProvider(config.provider.default, config.provider.model);
|
|
54
|
+
const answer = await queryVault(root, "how does self-attention work?", provider);
|
|
55
|
+
console.log(answer.answer);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## LLM Providers
|
|
59
|
+
|
|
60
|
+
| Provider | Env Variable | Default Model |
|
|
61
|
+
|----------|-------------|---------------|
|
|
62
|
+
| Anthropic | `ANTHROPIC_API_KEY` | claude-sonnet-4-20250514 |
|
|
63
|
+
| OpenAI | `OPENAI_API_KEY` | gpt-4o |
|
|
64
|
+
| Ollama | (auto-detect localhost:11434) | llama3 |
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kibhq/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Core engine for kib — vault operations, LLM providers, ingest, compile, search, and query",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": "./src/index.ts"
|
|
7
8
|
},
|
|
8
9
|
"files": [
|
|
9
10
|
"src",
|
|
11
|
+
"README.md",
|
|
10
12
|
"package.json"
|
|
11
13
|
],
|
|
12
14
|
"repository": {
|
|
@@ -15,6 +17,16 @@
|
|
|
15
17
|
"directory": "packages/core"
|
|
16
18
|
},
|
|
17
19
|
"license": "MIT",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"knowledge-base",
|
|
22
|
+
"wiki",
|
|
23
|
+
"llm",
|
|
24
|
+
"compiler",
|
|
25
|
+
"rag",
|
|
26
|
+
"ai",
|
|
27
|
+
"search",
|
|
28
|
+
"bm25"
|
|
29
|
+
],
|
|
18
30
|
"publishConfig": {
|
|
19
31
|
"access": "public"
|
|
20
32
|
},
|