agent-knowledge 1.1.3 → 1.1.4

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 keshrath
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 keshrath
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "name": "agent-knowledge",
3
- "version": "1.1.3",
4
- "description": "Cross-session memory and recall for AI agents — git-synced knowledge base, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "bin": {
8
- "agent-knowledge": "dist/index.js"
9
- },
10
- "files": [
11
- "dist/",
12
- "scripts/",
13
- "docs/*.md",
14
- "README.md",
15
- "CHANGELOG.md",
16
- "LICENSE"
17
- ],
18
- "scripts": {
19
- "build": "tsc && node scripts/copy-ui.js",
20
- "start": "node dist/index.js",
21
- "dev": "tsc --watch",
22
- "test": "vitest run",
23
- "test:watch": "vitest",
24
- "test:coverage": "vitest run --coverage",
25
- "lint": "eslint src/ tests/",
26
- "lint:fix": "eslint src/ tests/ --fix",
27
- "format": "prettier --write .",
28
- "format:check": "prettier --check .",
29
- "typecheck": "tsc --noEmit",
30
- "check": "npm run typecheck && npm run lint && npm run format:check && npm run test",
31
- "clean": "rm -rf dist",
32
- "prepare": "husky"
33
- },
34
- "keywords": [
35
- "mcp",
36
- "agent",
37
- "memory",
38
- "recall",
39
- "session-search",
40
- "knowledge-base",
41
- "tfidf",
42
- "embeddings",
43
- "semantic-search",
44
- "model-context-protocol",
45
- "ai-agents",
46
- "coding-assistants"
47
- ],
48
- "author": "keshrath",
49
- "license": "MIT",
50
- "repository": {
51
- "type": "git",
52
- "url": "https://github.com/keshrath/agent-knowledge.git"
53
- },
54
- "bugs": {
55
- "url": "https://github.com/keshrath/agent-knowledge/issues"
56
- },
57
- "homepage": "https://github.com/keshrath/agent-knowledge#readme",
58
- "dependencies": {
59
- "@modelcontextprotocol/sdk": "^1.0.0",
60
- "better-sqlite3": "^11.0.0",
61
- "sqlite-vec": "^0.1.0",
62
- "ws": "^8.20.0"
63
- },
64
- "devDependencies": {
65
- "@eslint/js": "^10.0.1",
66
- "@types/better-sqlite3": "^7.6.0",
67
- "@types/node": "^25.5.0",
68
- "@types/ws": "^8.18.1",
69
- "eslint": "^10.1.0",
70
- "husky": "^9.0.0",
71
- "lint-staged": "^16.0.0",
72
- "prettier": "^3.8.1",
73
- "typescript": "^5.7.0",
74
- "typescript-eslint": "^8.57.2",
75
- "vitest": "^3.0.0"
76
- },
77
- "optionalDependencies": {
78
- "@huggingface/transformers": "3.8.1"
79
- },
80
- "lint-staged": {
81
- "*.{ts,js}": [
82
- "prettier --write",
83
- "eslint --fix"
84
- ],
85
- "*.{json,md,css,html}": [
86
- "prettier --write"
87
- ]
88
- },
89
- "engines": {
90
- "node": ">=20.11.0"
91
- }
92
- }
1
+ {
2
+ "name": "agent-knowledge",
3
+ "version": "1.1.4",
4
+ "description": "Cross-session memory and recall for AI agents — git-synced knowledge base, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "agent-knowledge": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "scripts/",
13
+ "docs/*.md",
14
+ "README.md",
15
+ "CHANGELOG.md",
16
+ "LICENSE"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc && node scripts/copy-ui.js",
20
+ "start": "node dist/index.js",
21
+ "dev": "tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest",
24
+ "test:coverage": "vitest run --coverage",
25
+ "lint": "eslint src/ tests/",
26
+ "lint:fix": "eslint src/ tests/ --fix",
27
+ "format": "prettier --write .",
28
+ "format:check": "prettier --check .",
29
+ "typecheck": "tsc --noEmit",
30
+ "check": "npm run typecheck && npm run lint && npm run format:check && npm run test",
31
+ "clean": "rm -rf dist",
32
+ "prepare": "husky"
33
+ },
34
+ "keywords": [
35
+ "mcp",
36
+ "agent",
37
+ "memory",
38
+ "recall",
39
+ "session-search",
40
+ "knowledge-base",
41
+ "tfidf",
42
+ "embeddings",
43
+ "semantic-search",
44
+ "model-context-protocol",
45
+ "ai-agents",
46
+ "coding-assistants"
47
+ ],
48
+ "author": "keshrath",
49
+ "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/keshrath/agent-knowledge.git"
53
+ },
54
+ "bugs": {
55
+ "url": "https://github.com/keshrath/agent-knowledge/issues"
56
+ },
57
+ "homepage": "https://github.com/keshrath/agent-knowledge#readme",
58
+ "dependencies": {
59
+ "@modelcontextprotocol/sdk": "^1.0.0",
60
+ "better-sqlite3": "^11.0.0",
61
+ "sqlite-vec": "^0.1.0",
62
+ "ws": "^8.20.0"
63
+ },
64
+ "devDependencies": {
65
+ "@eslint/js": "^10.0.1",
66
+ "@types/better-sqlite3": "^7.6.0",
67
+ "@types/node": "^25.5.0",
68
+ "@types/ws": "^8.18.1",
69
+ "eslint": "^10.1.0",
70
+ "husky": "^9.0.0",
71
+ "lint-staged": "^16.0.0",
72
+ "prettier": "^3.8.1",
73
+ "typescript": "^5.7.0",
74
+ "typescript-eslint": "^8.57.2",
75
+ "vitest": "^3.0.0"
76
+ },
77
+ "optionalDependencies": {
78
+ "@huggingface/transformers": "3.8.1"
79
+ },
80
+ "lint-staged": {
81
+ "*.{ts,js}": [
82
+ "prettier --write",
83
+ "eslint --fix"
84
+ ],
85
+ "*.{json,md,css,html}": [
86
+ "prettier --write"
87
+ ]
88
+ },
89
+ "engines": {
90
+ "node": ">=20.11.0"
91
+ }
92
+ }
@@ -1,21 +0,0 @@
1
- import type { EmbeddingProvider } from './types.js';
2
- /**
3
- * Anthropic/Voyage AI embedding provider.
4
- * Uses the Voyage AI API (Anthropic's embedding partner).
5
- * Accepts an Anthropic API key but prefers VOYAGE_API_KEY if set.
6
- */
7
- export declare class ClaudeEmbeddingProvider implements EmbeddingProvider {
8
- readonly name = "claude";
9
- readonly dimensions: number;
10
- readonly model: string;
11
- private readonly apiKey;
12
- constructor(apiKey: string, modelOverride?: string);
13
- /** Embed one or more texts, batching internally at 128 texts per request. */
14
- embed(texts: string[]): Promise<number[][]>;
15
- /** Embed a single text. */
16
- embedOne(text: string): Promise<number[]>;
17
- /** Check availability by making a test embedding request. */
18
- isAvailable(): Promise<boolean>;
19
- private requestEmbeddings;
20
- }
21
- //# sourceMappingURL=claude.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/embeddings/claude.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQpD;;;;GAIG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAC/D,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;IAMlD,6EAA6E;IACvE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAYjD,2BAA2B;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK/C,6DAA6D;IACvD,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;YASvB,iBAAiB;CAqChC"}
@@ -1,84 +0,0 @@
1
- const DEFAULT_MODEL = 'voyage-3-lite';
2
- const DEFAULT_DIMENSIONS = 512;
3
- const MAX_BATCH_SIZE = 128;
4
- const TIMEOUT_MS = 30_000;
5
- const ENDPOINT = 'https://api.voyageai.com/v1/embeddings';
6
- /**
7
- * Anthropic/Voyage AI embedding provider.
8
- * Uses the Voyage AI API (Anthropic's embedding partner).
9
- * Accepts an Anthropic API key but prefers VOYAGE_API_KEY if set.
10
- */
11
- export class ClaudeEmbeddingProvider {
12
- name = 'claude';
13
- dimensions;
14
- model;
15
- apiKey;
16
- constructor(apiKey, modelOverride) {
17
- this.apiKey = process.env.VOYAGE_API_KEY || apiKey;
18
- this.model = modelOverride || DEFAULT_MODEL;
19
- this.dimensions = DEFAULT_DIMENSIONS;
20
- }
21
- /** Embed one or more texts, batching internally at 128 texts per request. */
22
- async embed(texts) {
23
- if (texts.length === 0)
24
- return [];
25
- const results = [];
26
- for (let i = 0; i < texts.length; i += MAX_BATCH_SIZE) {
27
- const batch = texts.slice(i, i + MAX_BATCH_SIZE);
28
- const vectors = await this.requestEmbeddings(batch);
29
- results.push(...vectors);
30
- }
31
- return results;
32
- }
33
- /** Embed a single text. */
34
- async embedOne(text) {
35
- const results = await this.embed([text]);
36
- return results[0] ?? [];
37
- }
38
- /** Check availability by making a test embedding request. */
39
- async isAvailable() {
40
- try {
41
- const result = await this.embed(['test']);
42
- return result.length === 1 && result[0].length > 0;
43
- }
44
- catch {
45
- return false;
46
- }
47
- }
48
- async requestEmbeddings(texts, retry = true) {
49
- try {
50
- const response = await fetch(ENDPOINT, {
51
- method: 'POST',
52
- headers: {
53
- 'Content-Type': 'application/json',
54
- Authorization: `Bearer ${this.apiKey}`,
55
- },
56
- body: JSON.stringify({ model: this.model, input: texts }),
57
- signal: AbortSignal.timeout(TIMEOUT_MS),
58
- });
59
- if (response.status === 429 && retry) {
60
- const retryAfter = parseInt(response.headers.get('retry-after') || '1', 10);
61
- const delayMs = Math.max(retryAfter, 1) * 1000;
62
- console.error(`[knowledge] Voyage rate limited, retrying in ${delayMs}ms`);
63
- await sleep(delayMs);
64
- return this.requestEmbeddings(texts, false);
65
- }
66
- if (!response.ok) {
67
- const body = await response.text().catch(() => '');
68
- console.error(`[knowledge] Voyage embedding request failed (${response.status}): ${body}`);
69
- return texts.map(() => []);
70
- }
71
- const json = (await response.json());
72
- const sorted = json.data.sort((a, b) => a.index - b.index);
73
- return sorted.map((d) => d.embedding);
74
- }
75
- catch (err) {
76
- console.error('[knowledge] Voyage embedding request error:', err);
77
- return texts.map(() => []);
78
- }
79
- }
80
- }
81
- function sleep(ms) {
82
- return new Promise((resolve) => setTimeout(resolve, ms));
83
- }
84
- //# sourceMappingURL=claude.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/embeddings/claude.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IACzB,IAAI,GAAG,QAAQ,CAAC;IAChB,UAAU,CAAS;IACnB,KAAK,CAAS;IACN,MAAM,CAAS;IAEhC,YAAY,MAAc,EAAE,aAAsB;QAChD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,MAAM,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,aAAa,IAAI,aAAa,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;IACvC,CAAC;IAED,6EAA6E;IAC7E,KAAK,CAAC,KAAK,CAAC,KAAe;QACzB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAElC,MAAM,OAAO,GAAe,EAAE,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,cAAc,EAAE,CAAC;YACtD,MAAM,KAAK,G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