Installation
Run threads from source in TypeScript or Python.
threads is not on npm or PyPI yet. Until it is, install it from a clone of the repository.
Requirements
- Bun for TypeScript. The core runs on Bun; the E2B adapter needs it.
- uv and Python 3.12 or newer for Python.
Clone and build
Both languages share generated code built from spec/. Run the generator once after cloning, and again after each pull.
git clone https://github.com/useagenthq/threads && cd threads
./scripts/generate.shInstall your language
The packages live in a Bun workspace under typescript/packages. The simplest way to use them today is to add your app as another workspace package.
Install the workspace
cd typescript && bun installAdd your app as a package
Create typescript/packages/my-agent/package.json and list the threads packages you need:
{
"name": "my-agent",
"private": true,
"type": "module",
"dependencies": {
"@threads/core": "workspace:*",
"@threads/anthropic": "workspace:*",
"zod": "^4.6.5"
}
}Run bun install again from typescript/.
Run your code
Put the Quickstart code in typescript/packages/my-agent/index.ts and run it:
cd packages/my-agent && bun index.ts| Package | What it adds |
|---|---|
@threads/core | agent, tool, sqlite, openThread, memory, knowledge, the scripted model |
@threads/anthropic, @threads/openai, @threads/ai-sdk | Models |
@threads/e2b, @threads/daytona | Sandboxes |
@threads/mcp | MCP servers as tools |
@threads/supermemory, @threads/zep | Hosted memory |
@threads/host, @threads/slack, @threads/whatsapp, @threads/github | The host and its channels |
@threads/cli | The threads command |
Check your setup
From the clone, run each language's checks:
cd typescript && bun run checkAPI keys
Providers read their keys from the environment unless you pass them in code, for example ANTHROPIC_API_KEY, OPENAI_API_KEY, E2B_API_KEY or DAYTONA_API_KEY. Each provider page lists its variables. Keys are never written to the log and never enter a sandbox.