@engram/sdk
The Engram SDK exposes three methods: remember, recall, and forget. That is the complete surface area by design.
Constructor
new Engram(options: EngramOptions)
A stable identifier for this agent. Used as the memory namespace; all memories written by this instance are keyed to this ID.
The chain to anchor integrity hashes on. Use base-sepolia for development.
Your Engram API key. Set via environment variable (ENGRAM_API_KEY); never hardcode.
Request timeout in milliseconds. Default: 10000.
Writes a memory to the agent's store and anchors its hash onchain. Returns the stored memory object including its content-addressed hash.
const memory = await engram.remember({
type: "semantic",
content: "User prefers responses in plain English, not bullet points.",
metadata: { source: "user-feedback", confidence: "high" },
});
// memory.hash → "0xae21...f0"
// memory.id → uuid
// memory.at → ISO timestampMemory type determines retention policy and retrieval priority. See Memory types.
The memory payload. Plain text or structured JSON string. Max 8 KB.
Optional key-value bag attached to the memory. Useful for filtering and debugging.
Time-to-live in seconds. Memory expires after this duration. Omit for permanent storage.
Retrieves semantically relevant memories for a natural-language query. Uses vector similarity under the hood; no need to know the memory IDs.
const memories = await engram.recall({
query: "what does the user prefer about formatting?",
type: "semantic",
limit: 3,
minScore: 0.75,
});
for (const m of memories) {
console.log(m.content, m.score);
}Natural-language query. The SDK embeds this and retrieves the closest matching memories.
Filter results to a single memory type. Omit to search all types.
Max results to return. Default: 10.
Minimum similarity score (0-1). Memories below this threshold are excluded. Default: 0.6.
Permanently deletes a memory by its hash or UUID. The deletion is recorded onchain so the memory trail remains auditable.
await engram.forget("0xae21...f0");
// or by UUID
await engram.forget("mem_01hvk9x2z5fge8rfgp2jhbv4w");TypeScript types for all inputs and outputs are exported from @engram/sdk/types. The SDK is fully typed with no any escapes.