Skip to content

Quick Start

Install

Terminal window
pnpm add @nekte/client @nekte/server

5-Line Quickstart

import { NekteClient } from '@nekte/client';
const client = new NekteClient('http://localhost:4001');
const catalog = await client.catalog(); // L0: ~8 tok/cap
const result = await client.invoke('sentiment', { input: { text: 'Great!' } });
console.log(result.out); // "positive 0.9"

What Just Happened?

  1. catalog() sent a nekte.discover request at Level 0. The server responded with a list of capability names, categories, and version hashes — roughly 8 tokens per capability instead of 120+ for full schemas.

  2. invoke() sent a nekte.invoke request with the version hash from the catalog. Because the hash matched, the server executed the capability without requiring the schema to be re-sent — zero extra tokens.

  3. The result came back in minimal format by default: a short string representation that fits in a few tokens.

Core Concepts

ConceptWhat It Means
L0/L1/L2Discovery levels: catalog (8 tok) to summary (40 tok) to full schema (120 tok)
Version hash8-char hash of a capability’s contract. If unchanged, skip schema reload
Token budget{ max_tokens, detail_level } — the receiver adapts response granularity
Multi-level resultSame data in minimal/compact/full representations
DelegateStream{ events, cancel(), taskId } — streaming with lifecycle control

Next Steps