cortex-memory-client
v0.3.2
Published
Self-organizing graph memory for AI agents — TypeScript SDK
Maintainers
Readme
cortex-memory-client
TypeScript/Node.js client SDK for the Cortex graph memory engine.
Installation
npm install cortex-memory-clientQuick start
import { Cortex } from "cortex-memory-client";
const cx = new Cortex("localhost:9090");
// Store knowledge
const id = await cx.store({
kind: "fact",
title: "API rate limit is 1000/min",
tags: ["api", "limits"],
});
// Semantic search
const results = await cx.search("rate limits");
for (const r of results) {
console.log(`${r.score.toFixed(2)} — ${r.title}`);
}
// Get briefing
const briefing = await cx.briefing("my-agent");
console.log(briefing);Testing
import { MockCortex } from "cortex-memory-client";
describe("my agent", () => {
it("stores knowledge", async () => {
const cx = new MockCortex();
await cx.store({ kind: "fact", title: "test fact" });
const results = await cx.search("test");
expect(results).toHaveLength(1);
cx.assertStored("fact", "test fact");
});
});