@hasna/knowledge 0.2.14 → 0.2.16
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 +26 -2
- package/bin/open-knowledge-mcp.js +681 -8
- package/bin/open-knowledge.js +92 -40
- package/docs/architecture/ai-native-knowledge-base.md +10 -5
- package/docs/architecture/hybrid-semantic-search.md +24 -11
- package/package.json +1 -1
- package/src/cli.ts +39 -4
- package/src/mcp.js +34 -0
- package/src/retrieval.ts +326 -0
- package/src/search.ts +510 -0
- package/src/service.ts +20 -0
- package/src/wiki-layout.ts +41 -1
package/README.md
CHANGED
|
@@ -93,6 +93,11 @@ open-knowledge providers models --scope project --json
|
|
|
93
93
|
# Embed indexed chunks and run semantic search
|
|
94
94
|
open-knowledge embeddings index --scope project --model openai:text-embedding-3-small --json
|
|
95
95
|
open-knowledge embeddings search "company wiki policy" --scope project --json
|
|
96
|
+
|
|
97
|
+
# Hybrid search over source chunks, generated wiki pages, indexes, and optional vectors
|
|
98
|
+
open-knowledge search "company wiki policy" --scope project --json
|
|
99
|
+
open-knowledge search "company wiki policy" --scope project --semantic --json
|
|
100
|
+
open-knowledge search "company wiki policy" --scope project --context --json
|
|
96
101
|
```
|
|
97
102
|
|
|
98
103
|
## Commands
|
|
@@ -237,6 +242,23 @@ Consume open-files JSON or JSONL change events. This invalidates matching
|
|
|
237
242
|
source chunks and embeddings by source ref, revision, or hash, updates
|
|
238
243
|
permission/path/delete metadata, and records a local run ledger.
|
|
239
244
|
|
|
245
|
+
### search
|
|
246
|
+
```bash
|
|
247
|
+
open-knowledge search <query> [--scope project] [--limit <n>] [--json]
|
|
248
|
+
open-knowledge search <query> --semantic [--model openai:text-embedding-3-small] [--scope project] [--json]
|
|
249
|
+
open-knowledge search <query> --context [--semantic] [--scope project] [--json]
|
|
250
|
+
```
|
|
251
|
+
Run hybrid search over `chunks_fts`, generated wiki chunks, wiki/index catalog
|
|
252
|
+
rows, and optional vector results. The default path is local-only keyword and
|
|
253
|
+
catalog search. `--semantic` embeds the query and merges vector results from
|
|
254
|
+
`vector_index_entries`, preserving source refs, artifact URIs, citations,
|
|
255
|
+
revision/hash metadata, and provenance in each structured result.
|
|
256
|
+
|
|
257
|
+
`--context` returns a reranked context pack for agents: selected excerpts,
|
|
258
|
+
assembled citations, freshness and permission notes, graph evidence from
|
|
259
|
+
`citations`/`wiki_backlinks`, and final rerank scores. This is the shape future
|
|
260
|
+
`knowledge <prompt>` flows should send to a model instead of raw search rows.
|
|
261
|
+
|
|
240
262
|
### safety
|
|
241
263
|
```bash
|
|
242
264
|
open-knowledge safety status [--scope project] [--json]
|
|
@@ -315,8 +337,10 @@ The MCP server exposes item tools (`ok_add`, `ok_list`, `ok_get`, `ok_update`,
|
|
|
315
337
|
`ok_import`, `ok_batch`), workspace/storage inspection (`ok_paths`,
|
|
316
338
|
`ok_storage_status`), provider/embedding tools (`ok_provider_status`,
|
|
317
339
|
`ok_provider_models`, `ok_embeddings_status`, `ok_embeddings_index`,
|
|
318
|
-
`ok_semantic_search`), and source-ref
|
|
319
|
-
`ok_resolve_source`).
|
|
340
|
+
`ok_semantic_search`), hybrid retrieval (`ok_search`), and source-ref
|
|
341
|
+
parsing/resolution (`ok_parse_source_ref`, `ok_resolve_source`). The
|
|
342
|
+
`knowledge_search` MCP tool returns reranked citation context packs for agent
|
|
343
|
+
prompts.
|
|
320
344
|
|
|
321
345
|
## Source And Artifact Boundary
|
|
322
346
|
|