memcontext-sdk
v1.0.2
Published
TypeScript SDK for the MemContext public API
Maintainers
Readme
memcontext-sdk
Official TypeScript SDK for MemContext, persistent memory infrastructure for AI agents and applications.
- Website: memcontext.in
- Documentation: docs.memcontext.in
- Package: npmjs.com/package/memcontext-sdk
Install
npm install memcontext-sdkQuickstart
import { MemContextClient } from "memcontext-sdk";
const client = new MemContextClient({
apiKey: process.env.MEMCONTEXT_API_KEY!,
});
const userMemory = client.withScope("user_123");
const projectMemory = userMemory.withProject("memcontext");
await projectMemory.save({
content: "User prefers concise release notes",
category: "preference",
});
const results = await projectMemory.search({
query: "How should release notes be written?",
});
console.log(results.memories);Scope And Projects
Use scope as the hard isolation boundary when one API key serves multiple users or tenants. Use project as a grouping filter inside that scope.
const tenant = client.withScope("tenant_acme_user_123");
const app = tenant.withProject("supportbot");Common Methods
await client.save({ content: "...", category: "fact" });
await client.search({ query: "What does the user prefer?" });
await client.list({ limit: 20 });
await client.profile();
await client.graph();
await client.feedback("memory-id", { type: "helpful" });
await client.delete("memory-id");See the full SDK reference at docs.memcontext.in.
License
GPL-3.0
