Registry / database / aiknowledgedb

aiknowledgedb

JSON →
library2.1.4jsnpmunverified

Semantic knowledge database CLI for storing, searching, and listing knowledge entries using SQLite + sqlite-vec + FTS5. Current stable version is 2.1.4. Release cadence is irregular, with the last update in 2025. Key differentiators: lightweight local-first solution with embeddings support, optimized for semantic search with vector similarity, and full-text search via FTS5. Requires Node.js >=24.0.0. Designed as a CLI tool for developers working with knowledge management, especially in AI-assisted coding environments like Claude Code. Supports custom embedding models and SQLite-backed persistence.

npm install aiknowledgedb
INSTALL
IMPORT
SIG · AIKNOWLEDGEDB
A
aiknowledgedb
databasejavascriptv2.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
import { cli } from 'aiknowledgedb'
const cli = require('aiknowledgedb')
ESM-only package since v2; requires Node >=24. Check runtime compatibility. Use import syntax only.
KnowledgeBase
import { KnowledgeBase } from 'aiknowledgedb'
Default export is not available; only named exports. TypeScript types are shipped with the package.
store
import { store } from 'aiknowledgedb'
store is a top-level function for adding entries.

Initializes a KnowledgeBase, stores a sample entry, then performs a semantic search and logs results.

import { cli, KnowledgeBase, store, search } from 'aiknowledgedb'; const kb = new KnowledgeBase({ dbPath: './knowledge.db', embeddingModel: 'text-embedding-3-small', embeddingApiKey: process.env.OPENAI_API_KEY ?? '' }); await kb.init(); await store(kb, { title: 'Example Entry', content: 'This is a test knowledge entry.', tags: ['demo'] }); const results = await search(kb, { query: 'test entry', limit: 5 }); console.log(results); await kb.close();
Debug
Known issues
breakingBreaking change: Node.js 24 is required. Versions 1.x supported Node 18+.
fix
Upgrade Node.js to version >=24.0.0.
affects: >=2.0.0
breakingBreaking change: Package is now ESM-only in v2. CommonJS require() will fail.
fix
Use import syntax instead of require(). Ensure package.json contains "type": "module" if using in a CJS project.
affects: >=2.0.0
deprecated`search` function now returns Promise<Array<{id, title, content, score}>> instead of raw rows. Deprecated since v2.1.0.
fix
Update code to handle new result shape: { id, title, content, score }.
affects: >=2.1.0
gotchaEmbedding model API key must be set via environment variable or constructor option. If missing, initialisation fails silently.
fix
Always provide an apiKey via 'embeddingApiKey' option or set environment variable 'AIKNOWLEDGEDB_OPENAI_KEY'.
affects: >=2.0.0
gotchaDatabase file path is relative to current working directory. If not absolute, unexpected locations may be created.
fix
Use an absolute path for dbPath to avoid surprises: path.resolve('./knowledge.db').
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'aiknowledgedb' imported from ...
Package not installed or Node.js version is below 24.
fix
Run npm install aiknowledgedb@latest and ensure Node >=24. Use import instead of require.
TypeError: kb.init is not a function
Incorrect import; likely imported default instead of named export.
fix
Use import { KnowledgeBase } from 'aiknowledgedb' (not default import).
Error: OpenAI API key not configured
Missing embeddingApiKey option or environment variable.
fix
Set AIKNOWLEDGEDB_OPENAI_KEY environment variable or pass apiKey in constructor.
Upgrade
Version history
2.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
29
OpenAI (training)
3
Resources
aiknowledgedb — npm install aiknowledgedb · libregistry