@memnode/client
v0.1.0
Published
TypeScript client for Memnode, persistent memory for AI agents
Maintainers
Readme
@memnode/client (TypeScript)
TypeScript client for Memnode, persistent memory for AI agents.
- Uses built-in
fetch— runs on Node 18+, Bun, Deno, and modern browsers. - Typed request options and response shapes.
- No runtime dependencies.
Quickstart and proof
If you land on this package page first, use this order:
- Install + proof loop: https://memnode.dev/mcp
- Public demo article: https://memnode.dev/articles/claude-code-memory-demo
- Downloadable 14-second proof loop: https://memnode.dev/article-images/mcp-demo-loop.mp4
- Hosted docs: https://memnode.dev/docs
The shortest believable Memnode loop is still MCP-first:
- teach Claude Code one repo convention
- start a fresh task or later session
- recall it and inspect lineage
Install
npm install @memnode/client
# or
pnpm add @memnode/clientFor local development:
cd clients/typescript
npm install typescript@^5.4
npm run buildUsage
import { MemnodeClient } from "@memnode/client";
const client = new MemnodeClient("https://api.memnode.dev", process.env.MEMNODE_API_KEY!);
const result = await client.recall("Where is the user moving?");
console.log(result.answer, result.confidence);
for (const hit of result.supportingMemories) {
console.log(hit.nodeId, hit.props.summary, hit.score);
}
const query = await client.query("Observation", {
filter: {
_memory_status: { $in: ["supported", "canonical"] },
_support_count: { $gte: 3 },
},
limit: 10,
});
console.log(query.nodes[0]?.props.summary);
await client.feedback(result.supportingMemories[0].nodeId, true);
const health = await client.healthz();
console.log(health.ok);For the shortest proof loop, start with the local MCP path first and keep this SDK for hosted or app-backend use.
Methods
| Method | HTTP | Notes |
|---------------------|-------------------------|-----------------------------------------------|
| recall | POST /v1/recall | Returns RecallResponse |
| feedback | POST /v1/feedback | Mark a supporting memory helpful / not |
| explain | POST /v1/explain | Raw JSON with per-edge scoring |
| query | POST /v1/query | Structured query for memory inspection |
| recordProcedure | POST /v1/procedures | Persist a trigger → action-sequence procedure |
| recallProcedures | GET /v1/procedures | Retrieve procedures, optionally by trigger |
| memoryLineage | GET /v1/lineage/{id} | CORRECTS / SUPERSEDES / DERIVED_FROM chain |
| healthz | GET /healthz | Liveness probe |
| status | GET /v1/status | Lease + data-plane counters |
Recording raw observations over HTTP is not yet supported server-side — use
the MCP transport until POST /v1/record ships.
Errors
All errors inherit from MemnodeError:
MemnodeAuthError— 401/403MemnodeRateLimitError— 429, carriesretryAfter(seconds) when the server returns aRetry-AfterheaderMemnodeUnavailableError— 503 (control-plane lease gone, shutting down, …)MemnodeHTTPError— other non-2xx responses withstatusandbody
Tests
cd clients/typescript
node --test --experimental-strip-types tests/*.test.tsTests spin up an in-process node:http server on a random port and drive the
client end-to-end — no fetch mocks, no fixtures.
