@exellix/narrix-memory
v2.0.0
Published
Recall and commit Narrix results (entity, signals, stories, meta) into narrix-db via Xronox
Readme
@exellix/narrix-memory
Recall and commit Narrix results (entity, signals, stories, meta) into narrix-db via Xronox.
Install
npm install @exellix/narrix-memoryConfigure .npmrc so the @exellix scope uses GitHub Packages (see .npmrc.example).
Usage
import { createNarrixMemory, createNarrixMemoryFromEnv } from "@exellix/narrix-memory";
const memory = createNarrixMemoryFromEnv({
enabled: true,
scope: { scopeType: "domain", key: "my-domain" },
});
const result = await memory.getSnapshot({ datasetId: "ds1", subjectId: "sub1", scope });
if (result.hit) {
console.log(result.snapshot);
} else {
// run pipeline, then:
await memory.putSnapshot({ datasetId: "ds1", subjectId: "sub1", scope, snapshot });
}Env
MONGO_URI(required for Xronox zero-config)MONGO_DBorMONGO_KNOWLEDGE_DB(for roledomainKnowledge)- Optional:
NARRIX_MEMORY_ROLEto override default role
