traceAI

Tools & Infrastructure 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
220 stars

traceAI is an open-source observability tool for AI applications that captures LLM calls, prompts, tokens, retrieval steps, and agent decisions as OpenTelemetry traces. It solves the problem of debugging AI workflows by providing structured traces that can be sent to any OTel-compatible backend like Datadog or Grafana. It is for developers building AI applications who need end-to-end visibility into their systems.

traceAI demo
🎞️ Demo from the project README

✨ Key features

  • Drop-in instrumentation for 50+ AI frameworks across 4 languages
  • OpenTelemetry-native, works with any OTel-compatible backend
  • Captures prompts, completions, tokens, model params, tool calls
  • Supports Python, TypeScript, Java, and C# with consistent APIs
  • Production-grade with async support, streaming, and low overhead

🎯 Use cases

  • Debugging incorrect AI responses by tracing retrieval and tool calls
  • Monitoring token usage and costs across LLM providers
  • Tracking agent decision paths in complex multi-step workflows
  • Integrating AI observability into existing Datadog or Grafana dashboards

📦 Installation

🧰 Requirements: Requires an API key and secret key from Future AGI, and an OpenTelemetry-compatible backend. Supports Python, TypeScript, Java, and C#.

Python

pip install traceai-openai

TypeScript

npm install @traceai/openai @traceai/fi-core

Java

Add dependency via JitPack:

<dependency>
    <groupId>com.github.future-agi.traceAI</groupId>
     traceai-java-openai 
    <version>v1.0.0</version>
</dependency>

C#

dotnet add package fi-instrumentation-otel

🚀 Usage

Python

import os
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from traceai_openai import OpenAIInstrumentor
import openai

os.environ["FI_API_KEY"] = "<your-api-key>"
os.environ["FI_SECRET_KEY"] = "<your-secret-key>"
os.environ["OPENAI_API_KEY"] = "<your-openai-key>"

trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="my_ai_app"
)

OpenAIInstrumentor().instrument(tracer_provider=trace_provider)

response = openai.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "Hello!"}]
)

❓ FAQ

What backends can I send traces to?

traceAI is OpenTelemetry-native, so it works with any OTel-compatible backend such as Datadog, Grafana, Jaeger, and Future AGI.

Do I need to refactor my code to use traceAI?

No, it is drop-in instrumentation. You add a few lines to register the tracer and instrument your framework, and traces are captured automatically.

Which languages are supported?

Python, TypeScript, Java, and C# are supported with consistent APIs.

How do I get API keys?

You need to set environment variables FI_API_KEY and FI_SECRET_KEY, which are obtained from Future AGI.

📊 Repository

Stars★ 220
Forks🍴 41
Open issues🐛 12
Last commit🕒 Aug 27, 2026
Created📅 Apr 2025
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.