← Back to Leaderboard
Ttruera

truera/trulens

OpenTelemetry-native Python SDK for tracing and evaluating RAG apps and agents

Engineering Health (Methodology)
A+ · 91/100
Maintenance Activity
● Updated today
Latest Release
trulens-2.16.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption19/25
Release Cadence17/20
License Clarity20/20
DockerCLI
Total Stars
★ 3,715
24h Growth
+2
7d Growth
+15
Forks
423

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

truera/trulens Star History (2021-01-10 - 2026-12-04) ALL-TIME STAR HISTORY (2021-01 – 2026-12) +3.7k in 2154d · avg +2/day 3.9k 2k 0 2021-01-10: ★ 12021-05-22: ★ 42021-10-02: ★ 1112022-02-12: ★ 1252022-06-25: ★ 1302022-11-05: ★ 1332023-03-18: ★ 1382023-07-29: ★ 3362023-12-09: ★ 7662024-04-20: ★ 1,5492024-08-31: ★ 1,9692025-01-11: ★ 2,2202025-05-24: ★ 2,4702025-10-04: ★ 2,7822026-02-14: ★ 3,0622026-06-27: ★ 3,3832026-12-04: ★ 3,715 ★ 3.7k 2021-01 2023-12 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

TruLens is a Python SDK embedded in the application, not an agent execution framework. The @instrument decorator turns instrumented calls into OpenTelemetry spans. Typed spans distinguish retrieval, generation, and tool calls; explicit attribute mappings can put a retrieval query and its returned contexts on the same span. OTLP export lets teams route the resulting traces to a compatible observability backend.

Evaluation is a separate layer over those records. A Metric pairs an implementation with Selector bindings that resolve its arguments from record inputs or span attributes. This is what lets a team score one retrieval context or tool step rather than pass only the final answer to a judge. LangChain/LangGraph and LlamaIndex integrations are packaged separately, as are evaluator providers. The root pyproject.toml uses poetry-core as the build backend and requires Poetry 2.0 or newer for its Poetry workflow; neither is an app-side instrumentation API.

Key Capabilities & Differentiators

For RAG, the triad separates answer relevance, context relevance, and groundedness, which helps distinguish a retrieval miss from an answer that ignores its evidence. Seven agent evaluators cover logical consistency, execution efficiency, plan adherence, plan quality, tool selection, tool calling, and tool quality. MCP spans can capture tool names, arguments, outputs, and latency. Per-step traces and version comparisons bring scores, latency, token usage, and cost into the same investigation.

Evaluations can run alongside the app or against existing data. The table-backed RunConfig example maps an input column, sets separate worker limits for app invocations and metric computation, and calls compute_metrics on the run. Provider packages cover OpenAI/Azure OpenAI, LiteLLM, Gemini, Bedrock, Snowflake Cortex, HuggingFace, LangChain models, and the OpenAI-compatible OrcaRouter gateway. Agent GPA caught 267 of 281 human-annotated errors on TRAIL/GAIA (95%, versus 55% for the baseline trace judge); that result is a benchmark reference, not a production acceptance threshold.

Trade-offs & Limitations

Against LangSmith, the strongest reason to pilot TruLens is control over in-process instrumentation, metric-to-span bindings, and the destination for exported traces. That flexibility creates setup work: teams must define span boundaries, verify that selectors still resolve the intended values after app changes, and own backend operations if they self-host. OTLP makes traces portable; it does not imply another backend can execute TruLens metrics or import its run workflow.

Inline judging provides earlier feedback but can add work while the app is serving requests; batch evaluation moves that work out of live traffic at the cost of delayed results. Pin judge models and rubrics for version comparisons, and calibrate against a human-reviewed sample before using scores as release gates. The MIT license permits commercial SDK use, but prompts, retrieved text, and tool arguments may be sensitive. Decide what to capture and retain, and what can be sent to a judge, before enabling broad collection.

Hardware & Deployment Guide

Start with pip install trulens, then add the provider package and any framework integration the app needs. Run tracing in the Python application and configure an OTLP destination if you want external export, such as to Jaeger or Grafana Tempo. Budget provider credentials, network access, and rate limits separately from trace ingestion. Running a batch after collection does not make it network-free if the metric calls a hosted judge; there is no universal GPU or VRAM requirement.

For upgrades, 2.14 added coding-agent instrumentation for Claude Code and Cursor workflows. Version 2.15 improved cross-HTTP trace continuity and preservation of GenAI message content across persistence and export. Version 2.16 adds metrics and Jury reliability metadata, improves handling of unparsable judge scores, and fixes cost accounting, batch evaluation, and tracing issues. It also removes Streamlit-in-Snowflake dashboard support, so teams using that dashboard need a replacement before upgrading.

Trace semantics: OpenTelemetry spans distinguish generation, retrieval, and tool calls, with OTLP export to compatible backends.
Metric inputs: Selectors bind evaluator arguments to record inputs or span attributes, including individual retrieved contexts.
Agent diagnosis: Seven evaluators distinguish reasoning consistency, execution efficiency, plan quality and adherence, and three aspects of tool use.
Batch control: RunConfig exposes separate invocation_max_workers and metric_max_workers settings.
MCP visibility: The MCP span type can capture tool name, arguments, output, and latency.
Upgrade boundary: 2.16 adds Jury reliability metadata and removes Streamlit-in-Snowflake dashboard support.
Best For

Python RAG and agent teams that need to pinpoint failures at individual steps, compare quality against latency and cost, and keep control of where traces go.

Skip If

You need a turnkey managed platform, cannot modify application instrumentation, or only need final-answer scoring and have no use for step-level traces.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerCLI
pip install trulens

Comparison vs. Top Agents & Frameworks Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
trulens ★3.7k+15PythonMITOpenTelemetry-native Python SDK for tracing and evaluating RAG apps and agents
langfuse38.2k+282TypeScript—OpenTelemetry platform for agent tracing and evals, with an AI gateway
opik23.6k+50JavaApache-2.0Self-hostable observability platform for tracing and evaluating LLM and agent wo
rocketride-server19.9k+22PythonMITC++ workflow engine for building and running extensible AI pipelines

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/truera/trulens.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

truera/trulens Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about trulens

How do I instrument an existing Python RAG app without rewriting it?

Start with the retrieval function: use @instrument with the RETRIEVAL span type and map the query and returned contexts to span attributes. Then bind a metric to those values through the Selector API. Add generation and tool spans where they help separate retrieval failures from answer or execution failures.

Does TruLens need a GPU, and how should I size a batch run?

No fixed GPU or VRAM requirement is established. With a hosted judge, size the Python process for trace volume and concurrent requests, and budget for provider rate limits, latency, and cost. If you run a model locally, size CPU, RAM, and any GPU for that specific model and concurrency. The Run API lets you tune app invocation and metric evaluation worker counts separately.

Can we use TruLens commercially and keep observability data in our own environment?

Yes. The MIT license permits commercial use and self-hosting of the SDK, subject to its notice requirements. Provider terms and data-handling obligations are separate: using your own OTLP backend does not prevent selected evaluation inputs from being sent to a hosted judge. Review trace attributes and metric inputs before onboarding sensitive workloads.

How should we choose between TruLens and LangSmith?

TruLens is a good fit when you want to instrument a Python app, bind metrics to specific spans, and reuse an OTLP-compatible backend. Include LangSmith in the evaluation if your team already operates it or wants a managed workflow. Test both on the same traces and dataset, and compare instrumentation effort, failure diagnosis, data retention, and the work needed to repeat evaluations.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining truera/trulens? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature truera/trulens on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare