New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@kognite/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kognite/sdk

TypeScript SDK for Kognite — long-term memory for AI agents (hybrid semantic search, memory formation, knowledge graph)

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@kognite/sdk

TypeScript SDK for Kognite — long-term memory for AI agents. Hybrid semantic + full-text search, LLM memory formation, and a knowledge graph, behind one API key. Zero runtime dependencies (built on fetch).

npm install @kognite/sdk

Quickstart

import { Kognite } from "@kognite/sdk";

const kognite = new Kognite({ apiKey: process.env.KOGNITE_API_KEY! });

// Store a memory
await kognite.memories.add({ content: "User prefers dark mode", kind: "preference" });

// Hybrid search (semantic + full-text, RRF-fused)
const { results } = await kognite.memories.search("ui preferences", { limit: 5 });

// Highest precision (cross-encoder rerank — slower):
await kognite.memories.search("ui preferences", { rerank: true });

Memory formation (the good stuff)

ingest runs the pipeline behind Kognite's published LoCoMo results: it stores raw messages as episodes and extracts atomic facts — pronouns resolved to names, relative dates converted to absolute ones. Prefer it over add for any multi-message context:

await kognite.memories.ingest([
  { speaker: "user", timestamp: "2026-07-15", content: "I moved to Berlin last month." },
  { speaker: "assistant", content: "Noted — how are you finding it?" },
]);
// → { raw: 2, extracted: 1, stored: 3 }

Context assembly

A token-budgeted bundle of relevant memories, ready to drop into a prompt:

const ctx = await kognite.context.assemble({ query: "user's living situation", token_budget: 2000 });

Everything else

await kognite.memories.get(id);
await kognite.memories.forget(id);           // soft-delete (+ graph cascade)
await kognite.memories.list({ limit: 50 });  // newest-first paging
await kognite.graph.query("Berlin");         // knowledge-graph search
await kognite.health();

Errors throw KogniteError with status (HTTP) and code (validation_failed, quota_exceeded, not_found, …). Retries with exponential backoff on 429/5xx/network errors are built in.

The tenant scope is derived server-side from your API key — the SDK has no scope parameter and cannot reach another tenant. Get a key in the dashboard, and see the live, judge-audited benchmarks.

Self-hosted? Pass baseUrl in the constructor.

Development

smoke.live.ts is a full live-API exercise of every method (safe: runs in the key's own scope and forgets everything it creates):

KOGNITE_API_KEY=kgn_... npx tsx smoke.live.ts

Keywords

kognite

FAQs

Package last updated on 15 Jul 2026

Related posts