Skip to main content

Kitaru Langfuse importer

Import Langfuse JSON and JSONL trace exports as Kitaru sessions. This package backs the built-in kitaru/langfuse 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 langfuse-export.jsonl \
  --importer kitaru/langfuse@latest \
  --agent support-agent@latest \
  --wait

The importer understands Langfuse trace, observation, and ingestion-event records. It preserves hierarchy, timing, models, token usage, cost, and source payloads when the export provides them. Re-importing the same source identity skips sessions that Kitaru already stores.

If the export has no embedded project ID, pass --params '{"source_instance":"my-langfuse-project"}' (or use the project_id alias). Reuse the same value for subsequent exports from that project. Filenames do not determine source identity. An explicit source_instance takes precedence over project_id, followed by the embedded project ID.

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

Malformed exports

The importer rejects a grouped session with invalid costs, token counts, model fields, or payload text that cannot be serialized, while preserving unrelated sessions. Costs must be finite and nonnegative, token counts must be nonnegative, and optional model/provider fields must be strings or null. A trace rejected before session grouping does not invalidate another trace sharing its session ID.

Nested observation trees support up to 64 nodes along any root-to-leaf path, counting the root as depth 1. The limit applies before and after inferred tool links. Tool-call scanning also has a cumulative depth budget of 64 across containers and decoded JSON strings; exceeding it rejects the session instead of silently dropping links. An outer document that cannot be decoded is rejected as an upload.

Adapter

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

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

The package also ships an adapter that imports Langfuse traces of wrapped agent runs. The adapter uses the Langfuse client already configured in your process and the Kitaru connection from your environment. Wrap your agent entrypoint in a LangfuseAdapter and run it through the adapter.

from kitaru_langfuse_importer.adapter import LangfuseAdapter

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

The adapter runs the function inside a Langfuse trace, waits for Langfuse 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.

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-langfuse-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-langfuse-importer 0.3.0
File Size Uploaded
kitaru_langfuse_importer-0.3.0.tar.gz 22.8 kB Details

Built distribution (wheel)

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

Total release size: 44.2 kB

Release files / kitaru_langfuse_importer-0.3.0.tar.gz

Download URL kitaru_langfuse_importer-0.3.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
57d0be455ad1f3682f329f97a7cdf7270acc8d98bf69846026a2adbdae512026
BLAKE2b-256 checksum
How to use checksums
2a0afc6f7fb7e6a614ccb76f0c1871107d9ecc0251431fbc4245fa43299edb5b
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_langfuse_importer-0.3.0-py3-none-any.whl

Download URL kitaru_langfuse_importer-0.3.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84b5c17bda5c79d3b9a1ddff607a1fb6d42b67e4c424e47ddb3d9b79b0935d2b
BLAKE2b-256 checksum
How to use checksums
f46b45ac499d98c84a0f18c5e177cc51c2da20436ba9d7faa1529f186a55a08d
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
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