Skip to main content

Kitaru Braintrust importer

Import Braintrust project-log and UI exports as Kitaru sessions. This package backs the built-in kitaru/braintrust importer and runs on a Kitaru worker, so the export is parsed in your environment.

Most users do not install or call this package directly. Start a Kitaru worker, then select the built-in importer:

kitaru session import braintrust-logs.jsonl \
  --importer kitaru/braintrust@latest \
  --agent support-agent@latest \
  --wait

The importer accepts Braintrust JSON and JSONL export shapes, preserves source hierarchy and evidence when present, and records fidelity warnings for incomplete exports. Re-importing the same source identity skips sessions that Kitaru already stores.

For exports without project identity, pass --params '{"source_instance":"my-project"}' or use the project_id alias. source_instance takes precedence over project_id, and both override embedded project identity. Filenames do not determine source identity. Reuse the same value for repeated exports from the same project.

See the Braintrust import guide for accepted formats, grouping parameters, deduplication behavior, and fidelity limits.

Validation limits

Nested node trees support at most 64 nodes along a parent path, counting the root as level 1. Tool-activity scans have a separate limit of 64 container or embedded-JSON decoding steps. Costs must be finite and nonnegative, token counts must be nonnegative, and returned sessions must serialize as JSON.

Conflicting project IDs reject the complete Braintrust trace before grouping. An embedded project ID anywhere in a trace supplies identity when import params do not. Conflicting embedded project IDs also reject a grouped session, even when explicit params would give its traces the same source identity. A failure discovered before grouping leaves other traces available, even when they share a session key. Invalid fields or serialization failures found after grouping reject that grouped session; unrelated sessions still import.

Adapter

Install the package with the adapter extra to use the adapter, which adds the provider SDK it needs:

uv add "kitaru-braintrust-importer[adapter]"

The package also ships an adapter that imports Braintrust traces of wrapped agent runs. The adapter uses the Braintrust logger already configured in your process and the Kitaru connection from your environment. Set BRAINTRUST_API_KEY to the key the trace fetch authenticates with, then wrap your agent entrypoint in a BraintrustAdapter and run it through the adapter.

from kitaru_braintrust_importer.adapter import BraintrustAdapter

adapter = BraintrustAdapter()
result = adapter.run(my_agent, "Hello")

The adapter runs the function inside a Braintrust span, waits for Braintrust to finish ingesting the trace, fetches it, and imports it as one Kitaru session. Use run_async for async functions. When the trace does not complete within the completeness timeout, the adapter creates a failed session carrying the trace id.

Links

Licensed under Apache-2.0.

Project identity values must be strings. Leading and trailing whitespace is removed; null, empty, and whitespace-only values are absent. Invalid identity types and conflicting embedded projects are rejected even when an explicit parameter would override them. API query fields select what to fetch; import params select the identity used by the parser. File and API imports use the same identity rules.

Metadata

Release files for kitaru-braintrust-importer 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kitaru-braintrust-importer 0.3.0
File Size Uploaded
kitaru_braintrust_importer-0.3.0.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kitaru-braintrust-importer 0.3.0
File Interpreter ABI Platform
kitaru_braintrust_importer-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.7 kB

Release files / kitaru_braintrust_importer-0.3.0.tar.gz

Download URL kitaru_braintrust_importer-0.3.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dd0b49ae5266161583291aa424e41441289522e6fa7c7a612c6cc6e75cfccb24
BLAKE2b-256 checksum
How to use checksums
2de4ae692189f5e149ad3aca052dacbc012617c65379fb38ce8d3e0cf4b75807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / kitaru_braintrust_importer-0.3.0-py3-none-any.whl

Download URL kitaru_braintrust_importer-0.3.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
697cab2fdbb57efbed50d5315367b04008ff741e9bd09674f8005fafb34667b5
BLAKE2b-256 checksum
How to use checksums
ba8ae36a6da9f4bb68ded97bd6af27619662bd858b9088d51b9ccecd54dc29c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page