Skip to content

TypeScript SDK Overview

The @hebbs/sdk package provides an async gRPC client for the HEBBS cognitive memory engine. It wraps the underlying protobuf transport in a clean, idiomatic TypeScript interface — no protobuf types appear in the public API.

  • Fully async — every method returns a Promise. Streaming uses AsyncIterable.
  • Type-safe — all request and response objects are TypeScript interfaces with readonly fields and full IDE autocompletion.
  • Node.js native — built on @grpc/grpc-js. No browser runtime, no REST fallback. Optimized for server-side performance.
  • Streaming — the subscribe() method returns a Subscription that implements AsyncIterable<SubscribePush> for real-time memory surfacing.
  • Zero codegen — ships the .proto file and uses @grpc/proto-loader at runtime. No build step required for consumers.
import { HebbsClient, MemoryKind } from '@hebbs/sdk';
const client = new HebbsClient('localhost:6380', {
apiKey: process.env.HEBBS_API_KEY,
});
await client.connect();
await client.remember({
content: 'Customer prefers email over phone',
entityId: 'customer-42',
});
const { results } = await client.recall({
cue: 'How does the customer prefer to be contacted?',
entityId: 'customer-42',
});
for (const r of results) {
console.log(`${r.memory.content} (score: ${r.score.toFixed(3)})`);
}
await client.close();
ModulePurpose
HebbsClientThe main entry point — connect, call methods, close
typesAll data types (Memory, RecallResult, Edge, etc.)
errorsException hierarchy (HebbsError and subclasses)
SubscriptionAsyncIterable for real-time streaming