Memory overlay
The memory overlay is a local-first helper for .knolo packs. Its API is createCortex, remember, recall, and consolidateMemories on the root @knolo/core export.
This is not Knolo Cortex. Reasoned evidence retrieval is createCortexSession from @knolo/core/cortex. See Knolo Cortex.
import {
buildPack,
consolidateMemories,
createCortex,
mountPack,
recall,
remember,
} from '@knolo/core';
const cortex = createCortex({ actor: 'notes-app' });
const { cortex: next } = remember(cortex, {
kind: 'note',
text: 'Project alpha uses a local-first memory overlay.',
labels: ['project.alpha'],
namespace: 'project.alpha',
});
const hits = recall(next, 'project alpha');
const docs = consolidateMemories(next, { namespacePrefix: 'memory' });
const bytes = await buildPack(docs);
const pack = await mountPack({ src: bytes });The overlay serializes into V4 packs by default. Verify generated packs with knolo verify. Use queryWithReceipt() when you need evidence and replay metadata.
For local files in Node, use @knolo/core/node or load the bytes first and pass Uint8Array into mountPack().
Composition does not change this overlay. V5 migration and the read-only Studio snapshot operate on Knowledge Images, not on the in-memory overlay object. The worked example in Knolo Core is examples/memory-overlay.