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.4.1

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.4.1
File Size Uploaded
kitaru_langfuse_importer-0.4.1.tar.gz 24.5 kB Details

Built distribution (wheel)

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

Total release size: 47.7 kB

Release files / kitaru_langfuse_importer-0.4.1.tar.gz

Download URL kitaru_langfuse_importer-0.4.1.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
526c7846290821813b634cba5e40306f9a4bb47ad37144cab89d49fe52ce0185
BLAKE2b-256 checksum
How to use checksums
99f91c9bd5c5b4799f96f200157ea1ccae13dd1faaef4bf7496dc736e8cd5114
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 Oct 8, 2026.

Transparency log

Release files / kitaru_langfuse_importer-0.4.1-py3-none-any.whl

Download URL kitaru_langfuse_importer-0.4.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b203686c4712a5a56148cbfb8763aeda76a7ecf396026d9f97db29bdb4583a33
BLAKE2b-256 checksum
How to use checksums
c9f2de4e42d4bb697c09210642df783a821dfc9a2ce5691fca873a738612b8ee
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 Oct 8, 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