honcho/sdks/typescript
xiaoxue f74585aa9d 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
..
__tests__ 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
examples 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
src 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
.gitignore 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
CHANGELOG.md 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
README.md 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
biome.json 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
bun.lock 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
bunfig.toml 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
package.json 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00
tsconfig.json 同步完整源码 - 2026-05-24 2026-05-24 17:22:17 +08:00

README.md

Honcho TypeScript SDK

A high-level, ergonomic TypeScript SDK for the Honcho conversational memory platform. Provides a user-friendly API for managing peers, sessions, and conversational context.

Installation

npm install @honcho-ai/sdk

Usage

import { Honcho } from "@honcho-ai/sdk";

const honcho = new Honcho({
  apiKey: process.env.HONCHO_API_KEY,
  baseURL: "http://localhost:8000",
  workspaceId: "test",
});

const assistant = await honcho.peer("bob");
const alice = await honcho.peer("alice");

await honcho.peers();

const session = await honcho.session("session_1");
await session.addPeers([alice, assistant]);

await session.addMessages([
  assistant.message("What did you have for breakfast today, alice?"),
  alice.message("I had oatmeal."),
]);

const response = await alice.chat("what did alice have for breakfast today?");
console.log(response);

See examples/ for more.

Development

Type checking

bun run typecheck

Testing

Tests for the SDK live in tests/ at the monorepo root and are run via pytest, which orchestrates a test server. Do not run bun test directly.

# From the monorepo root
uv run pytest tests/ -k typescript