Introduction
An agent framework for TypeScript and Python, built on an append-only event log.
Every team building agents writes the same pieces again: a sandbox, a Slack bot, a WhatsApp bot, hooks, a knowledge base, memory, evals. threads ships them built in, for TypeScript and Python. You write what your agent does and add your API keys.
threads is alpha. It is not on npm or PyPI yet, and APIs may change. See Installation to try it from source.
What you write
An agent is a model, instructions and tools. Running it is one call.
import { anthropic } from "@threads/anthropic";
import { agent, sqlite, tool } from "@threads/core";
import { z } from "zod";
const getWeather = tool({
name: "get_weather",
description: "Get the weather for a city.",
input: z.object({ city: z.string() }),
runs: "host",
effect: "read_only",
execute: async ({ city }) => `It is sunny in ${city}.`,
});
const weather = agent({
name: "weather",
instructions: "Answer questions about the weather.",
model: anthropic({
model: "claude-sonnet-5",
maxTokens: 8192,
contextWindow: 200_000,
maxOutputTokens: 8192,
}),
tools: [getWeather],
});
const result = await weather.run("What is the weather in Paris?", { store: sqlite(".threads") });The core is a plain library: no server needed. Channels, schedules and the HTTP API run in the optional host.
What's built in
Tools and MCP
Shell, files, search, web, git, code intelligence, notebooks, computer use, and any MCP server.
Subagents, handoffs, teams
Let one agent start others, hand off a conversation, or share a task board.
Sandboxes
E2B, Daytona and Modal. No internet by default; your keys stay on the host.
Channels
Slack, WhatsApp and GitHub, plus cron schedules and an HTTP API.
Memory and knowledge
Local memory, Supermemory or Zep, and a local knowledge base.
Hooks and approvals
Lifecycle hooks, permission rules, human approvals and budgets.
Why the log matters
Every run is recorded as an append-only log of events: each input, each request the model saw, each tool call and result. That one record gives you three things.
Every step is recorded
A full audit trail of what the agent saw, decided and did.
No double actions
After a crash, an action that may already have happened is checked or handed to you, never blindly retried.
Safe to experiment
Fork any past step and try again in a separate sandbox, never against real customers.
Read How it works for a short tour of the log.
Providers
| TypeScript | Python | |
|---|---|---|
| Models | Anthropic, OpenAI, AI SDK bridge | Anthropic, OpenAI, LiteLLM |
| Sandboxes | E2B (on Bun), Daytona | E2B, Daytona, Modal |
| Channels | Slack, WhatsApp, GitHub | Slack, WhatsApp, GitHub |
| Memory | local, Supermemory, Zep | local, Supermemory, Zep |