Threadline is the universal context layer for AI agents. It gives every user a single, living context object that any agent can read and update — across models, platforms, and products.
At a high level, Threadline is three simple primitives:
capture
Agents send interactions to Threadline. We extract deltas and merge them into a structured context object.
store
Context lives in Postgres + Redis with per-user isolation, audit logging, and strong controls.
inject
Your agent calls tl.inject() to get a personalized system prompt for every
user, every time.
01
Create a Threadline account and generate an API key from the developer dashboard.
02
Install the SDK in your agent project:
npm install threadline-sdk03
Initialize the client with your API key:
import { Threadline } from "threadline-sdk"
const tl = new Threadline({
apiKey: process.env.THREADLINE_KEY!,
baseUrl: process.env.THREADLINE_BASE_URL ?? "https://api.threadline.dev",
})04
Inject context into your system prompt:
const prompt = await tl.inject(userId, basePrompt)05
Update context after each interaction:
await tl.update({
userId,
userMessage,
agentResponse,
})From here, you can explore: