knowledge-assistant 0.1.0 → 0.1.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 CHANGED
@@ -6,11 +6,12 @@ your machine. Indexing and search never touch the network; an LLM (local Ollama
6
6
  API) is only needed for answers and AI note tidying.
7
7
 
8
8
  ```
9
- node launcher/bin/ka.js
9
+ npx knowledge-assistant
10
10
  ```
11
11
 
12
12
  That installs a private Python environment on first run, downloads a small embedding model
13
- (~130 MB), and opens the app in your browser. The launcher is not published to npm.
13
+ (~130 MB), and opens the app in your browser. Or install it globally with
14
+ `npm i -g knowledge-assistant` and run `ka`.
14
15
 
15
16
  ## Features
16
17
 
@@ -25,6 +26,20 @@ That installs a private Python environment on first run, downloads a small embed
25
26
  - **Templates** — five built-in structures plus your own.
26
27
  - **Preferences** — describe how you like notes formatted in plain language.
27
28
 
29
+ ## How answers are generated (RAG)
30
+
31
+ The **Ask** feature is a retrieval-augmented generation (RAG) pipeline, and it runs the same
32
+ retrieval stack as search. Every imported document is split into sentence-aware chunks of about
33
+ 512 tokens with a 64-token overlap, and each chunk is embedded locally with a small ONNX model
34
+ (bge-small via fastembed). When you ask a question, the query is embedded and matched against
35
+ those vectors with sqlite-vec, in parallel with a BM25 keyword search over the same chunks in
36
+ FTS5. The two ranked lists are merged with reciprocal rank fusion, and the top six passages are
37
+ handed to the LLM as numbered context. The system prompt restricts the model to that context and
38
+ asks it to cite passages inline as `[n]`, so every claim in an answer links back to the exact
39
+ text it came from, and the model is told to say so rather than guess when the context has no
40
+ answer. Retrieval, embedding and indexing never leave your machine; only the final generation
41
+ step calls an LLM, which can itself be local via Ollama.
42
+
28
43
  ## Requirements
29
44
 
30
45
  - Python 3.10+ (the npm launcher finds it; `pip` users install directly)
@@ -109,8 +124,17 @@ cd web && npm install && npm run dev # UI with API proxy to :8765
109
124
  ka serve # in another terminal
110
125
  ```
111
126
 
112
- Build for local use: `cd web && npm run build`, then `./scripts/build-launcher.sh` to produce
113
- the wheel and stage it in `launcher/` for the Node launcher.
127
+ ## Releasing
128
+
129
+ Bump `version` in both `pyproject.toml` and `launcher/package.json` (they must match: the
130
+ launcher installs the wheel whose version equals its own), then:
131
+
132
+ ```bash
133
+ ./scripts/build-launcher.sh # builds the UI, the wheel, and stages it in launcher/
134
+ cd launcher && npm publish
135
+ ```
136
+
137
+ The npm package bundles the wheel, so users never need PyPI.
114
138
 
115
139
  ## License
116
140
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "knowledge-assistant",
3
- "version": "0.1.0",
4
- "description": "Local-first personal knowledge base: PDF import, hybrid search, RAG Q&A, notes. Runs entirely on your machine.",
3
+ "version": "0.1.1",
4
+ "description": "Local-first personal knowledge base with RAG: import PDFs, notes and email, hybrid vector + keyword search, and cited Q&A over your own documents. Runs entirely on your machine.",
5
5
  "license": "MIT",
6
6
  "bin": {
7
7
  "knowledge-assistant": "bin/ka.js",
@@ -19,10 +19,14 @@
19
19
  "keywords": [
20
20
  "knowledge-base",
21
21
  "rag",
22
+ "retrieval-augmented-generation",
22
23
  "local-first",
23
24
  "sqlite",
24
25
  "vector-search",
25
- "pdf"
26
+ "hybrid-search",
27
+ "embeddings",
28
+ "pdf",
29
+ "notes"
26
30
  ],
27
31
  "repository": {
28
32
  "type": "git",