@hasna/knowledge 0.2.21 → 0.2.23
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 +64 -13
- package/bin/open-knowledge-mcp.js +1693 -471
- package/bin/open-knowledge.js +140 -70
- package/docs/architecture/ai-native-knowledge-base.md +22 -0
- package/docs/architecture/hybrid-semantic-search.md +11 -10
- package/package.json +1 -1
- package/src/cli.ts +44 -6
- package/src/mcp.js +789 -1
- package/src/service.ts +44 -0
- package/src/wiki-compiler.ts +711 -0
package/README.md
CHANGED
|
@@ -76,6 +76,11 @@ open-knowledge db init --scope project
|
|
|
76
76
|
# Initialize scalable wiki/schema/index/log artifacts
|
|
77
77
|
open-knowledge wiki init --scope project
|
|
78
78
|
|
|
79
|
+
# Compile cited wiki pages, file approved answers, and lint wiki health
|
|
80
|
+
open-knowledge wiki compile "handbook policy" --title "Handbook Policy" --scope project --json
|
|
81
|
+
open-knowledge wiki file-answer "How do we cite policy?" --content "Use cited source context." --approve-write --scope project --json
|
|
82
|
+
open-knowledge wiki lint --scope project --json
|
|
83
|
+
|
|
79
84
|
# Ingest an open-files source manifest into the project SQLite catalog
|
|
80
85
|
open-knowledge ingest manifest ./open-files-manifest.jsonl --scope project --json
|
|
81
86
|
|
|
@@ -237,11 +242,22 @@ Initialize or inspect the versioned SQLite catalog at
|
|
|
237
242
|
### wiki
|
|
238
243
|
```bash
|
|
239
244
|
open-knowledge wiki init [--scope project]
|
|
245
|
+
open-knowledge wiki compile [query|source-ref...] [--title <title>] [--limit <n>] [--scope project] [--json]
|
|
246
|
+
open-knowledge wiki file-answer <prompt> --content <answer> [--approve-write] [--scope project] [--json]
|
|
247
|
+
open-knowledge wiki lint [--scope project] [--json]
|
|
240
248
|
```
|
|
241
249
|
Create starter generated-knowledge artifacts through the artifact store:
|
|
242
250
|
`schemas/v1.md`, `indexes/root.md`, `wiki/README.md`, and a dated JSONL log
|
|
243
251
|
partition.
|
|
244
252
|
|
|
253
|
+
`wiki compile` turns existing source chunks into a cited Markdown page under
|
|
254
|
+
`wiki/generated/`, updates `knowledge_indexes`, records citations and a concept
|
|
255
|
+
backlink, and appends a JSONL log partition. `wiki file-answer` keeps answer
|
|
256
|
+
filing as a dry run unless `--approve-write` is supplied, then writes a cited
|
|
257
|
+
answer note under `wiki/answers/`. `wiki lint` checks generated pages for
|
|
258
|
+
missing citations, stale citations, duplicate titles, orphan pages, unresolved
|
|
259
|
+
source refs, contradiction markers, and new article candidates.
|
|
260
|
+
|
|
245
261
|
### source
|
|
246
262
|
```bash
|
|
247
263
|
open-knowledge source resolve <source-ref> [--purpose knowledge_answer|knowledge_index] [--limit <n>] [--scope project] [--json]
|
|
@@ -402,19 +418,54 @@ location with `--store <path>`.
|
|
|
402
418
|
open-knowledge-mcp
|
|
403
419
|
```
|
|
404
420
|
|
|
405
|
-
The
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
`
|
|
413
|
-
|
|
414
|
-
`
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
421
|
+
The stable agent-facing MCP tools are:
|
|
422
|
+
|
|
423
|
+
- `knowledge_search`: return a reranked citation context pack.
|
|
424
|
+
- `knowledge_ask`: answer with read-only local knowledge and optional AI SDK
|
|
425
|
+
generation.
|
|
426
|
+
- `knowledge_build`: run the prompt flow and optionally file a cited wiki answer
|
|
427
|
+
when `approve_write=true`.
|
|
428
|
+
- `knowledge_get`: read an item, indexed source, wiki page, run, index, or
|
|
429
|
+
decision by id.
|
|
430
|
+
- `knowledge_ingest`: ingest an open-files/S3/file/web source ref or open-files
|
|
431
|
+
manifest into the derived catalog.
|
|
432
|
+
- `knowledge_web_search`: run safety-gated provider-native web search.
|
|
433
|
+
- `knowledge_lint`: lint generated wiki pages for citation/source issues.
|
|
434
|
+
- `knowledge_run_status`: list recent runs or inspect one run ledger.
|
|
435
|
+
- `knowledge_storage`: inspect the local/S3/hosted storage contract.
|
|
436
|
+
- `knowledge_resolve_source`: resolve indexed source chunks through the
|
|
437
|
+
read-only source boundary.
|
|
438
|
+
|
|
439
|
+
Compatibility and lower-level tools remain available with the `ok_*` prefix:
|
|
440
|
+
item tools (`ok_add`, `ok_list`, `ok_get`, `ok_update`, `ok_delete`,
|
|
441
|
+
`ok_archive`, `ok_restore`, `ok_upsert`, `ok_untag`, `ok_bulk_delete`,
|
|
442
|
+
`ok_prune`, `ok_dedupe`, `ok_stats`, `ok_export`, `ok_import`, `ok_batch`),
|
|
443
|
+
workspace/storage inspection (`ok_paths`, `ok_storage_status`), providers,
|
|
444
|
+
embeddings, reindexing, hybrid search, source parsing/resolution, and
|
|
445
|
+
`ok_web_search`.
|
|
446
|
+
|
|
447
|
+
MCP also publishes project-scope JSON resources for agent inspection:
|
|
448
|
+
|
|
449
|
+
- `knowledge://project/config`
|
|
450
|
+
- `knowledge://project/storage`
|
|
451
|
+
- `knowledge://project/schema`
|
|
452
|
+
- `knowledge://project/sources`
|
|
453
|
+
- `knowledge://project/open-files`
|
|
454
|
+
- `knowledge://project/wiki/pages`
|
|
455
|
+
- `knowledge://project/indexes`
|
|
456
|
+
- `knowledge://project/runs`
|
|
457
|
+
- `knowledge://project/decisions`
|
|
458
|
+
- Templated reads:
|
|
459
|
+
`knowledge://project/items/{id}`,
|
|
460
|
+
`knowledge://project/sources/{id}`,
|
|
461
|
+
`knowledge://project/wiki/pages/{id}`,
|
|
462
|
+
`knowledge://project/indexes/{id}`,
|
|
463
|
+
`knowledge://project/runs/{id}`,
|
|
464
|
+
`knowledge://project/decisions/{id}`
|
|
465
|
+
|
|
466
|
+
These resources expose compact metadata, derived chunks, generated wiki text,
|
|
467
|
+
run ledgers, and citation evidence. They do not expose raw source bytes from
|
|
468
|
+
`open-files`, local files, or S3.
|
|
418
469
|
|
|
419
470
|
## Source And Artifact Boundary
|
|
420
471
|
|