V4 quickstart
V4 COMPATIBLEBuild a portable .knolo pack and query it lexical-first. Semantic reranking is optional and runs after lexical retrieval. This path is still the compatibility default for ordinary search in 6.2.0.
import { buildPack, mountPack, query } from '@knolo/core';
const docs = [
{ id: 'billing.refunds', namespace: 'support', heading: 'Refund policy',
text: 'Refund requests must be submitted within 30 days.' },
{ id: 'billing.enterprise', namespace: 'support', heading: 'Enterprise billing',
text: 'Enterprise invoices are issued on the first business day.' },
];
const bytes = await buildPack(docs, { semantic: { enabled: false } });
const pack = await mountPack({ src: bytes });
const hits = query(pack, 'How long do I have to request a refund?', {
topK: 5, namespace: 'support',
});
console.log(hits);For a local filesystem path in Node, import mountPack from @knolo/core/node. Use @knolo/core for bytes, URLs, browsers, Expo, React Native, and runtime-safe mounting.
The CLI builds the same kind of artifact:
npm install -g @knolo/cli
knolo build
knolo verify dist/knowledge.knolo
knolo query "billing policy" --receipt receipt.json --jsonknolo build emits a V4 pack. V5 images are not queried through the V4 pack API. See V5 EQL.