Skip to content

SDK overview

The Prefactor SDKs instrument your agent applications to record spans and send them to the Prefactor API. When your agent runs, the SDK captures LLM calls, tool invocations, and agent spans — along with their inputs, outputs, and token usage — and sends them as structured trace data. PREFACTOR_CAPTURE_INPUTS, PREFACTOR_CAPTURE_OUTPUTS, and PREFACTOR_SAMPLE_RATE control the data footprint; see Configuration and environment variables for defaults.

Both the TypeScript and Python SDKs follow the same model: you initialise the SDK with an integration package that matches your framework, and the shared configuration and schema options described in this section apply to both.

LanguageLinks
TypeScriptDocs · Source · DeepWiki
PythonDocs · Source · DeepWiki

Available integration packages depend on the SDK:

  • TypeScript includes packages for LangChain, the Vercel AI SDK, Claude, and other adapters in the TypeScript repo
  • Python includes packages for LangChain and LiveKit in the Python repo