Skip to main content

Open standard for AI agent telemetry. One schema across every framework.

Project description

OpenFlux

OpenFlux

PyPI Downloads Python 3.12+ MIT

Open standard for AI agent telemetry. One schema across every framework.

Why

Every agent framework emits telemetry differently. Claude Code uses lifecycle hooks. OpenAI Agents SDK has TracingProcessor. LangChain has callbacks. If you want to build analytics, compliance, or cost tooling on top, you need N integrations from scratch.

OpenFlux normalizes everything into a single schema called a Trace: one traced unit of agent work, end to end. Context in, searches run, sources read, tools called, decision made.

Same idea as OpenTelemetry for observability. OTel didn't build dashboards. It built the standard that let them exist. OpenFlux does that for agent telemetry.

How it works

Adapter (framework-specific) -> Normalizer -> Trace -> Sink(s)
  • Adapters hook into framework callbacks and emit raw events
  • Normalizer classifies events, hashes content, applies fidelity controls
  • Trace is the universal schema (22 fields + 4 nested record types)
  • Sinks write the Trace somewhere: SQLite (default), OTLP, or JSON stdout

Zero dependencies beyond Python stdlib for the core. Each adapter adds one optional dep.

Install

pip install openflux

# With a specific adapter
pip install openflux[openai]
pip install openflux[langchain]

# Everything
pip install openflux[all]

Quick start

Claude Code

Auto-configures lifecycle hooks:

openflux install claude-code

OpenAI Agents SDK

from agents.tracing import add_trace_processor
from openflux.adapters.openai_agents import OpenFluxProcessor

add_trace_processor(OpenFluxProcessor(agent="my-agent"))

LangChain

import openflux

handler = openflux.langchain_handler(agent="my-rag-app")
result = chain.invoke({"input": "..."}, config={"callbacks": [handler]})

Any framework

import openflux

collector = openflux.init(agent="my-agent")

# Event types: meta, tool, search, source, context
collector.record_event("session-1", {"type": "meta", "task": "fix auth bug", "model": "gpt-4o"})
collector.record_event("session-1", {"type": "tool", "tool_name": "Bash", "tool_input": "pytest", "tool_output": "3 passed"})
collector.record_event("session-1", {"type": "search", "query": "oauth best practices", "engine": "web"})

trace = collector.flush("session-1")  # persisted to ~/.openflux/traces.db
print(f"Traced: {trace.task} -> {trace.status} ({len(trace.tools_used)} tools)")
# Then query later: openflux recent

CLI

openflux recent                          # last 10 traces
openflux recent --agent claude-code      # filter by agent
openflux search "staging deploy"         # full-text search
openflux trace trc-a1b2c3d4e5f6          # full detail for one trace
openflux export > traces.json            # dump as NDJSON
openflux status                          # db path, counts, breakdown
openflux install claude-code             # auto-configure hooks
openflux install --list                  # show available adapters

What you see

$ openflux recent
ID              WHEN     AGENT        TASK                                      STATUS
trc-a1b2c3d4e5  2m ago   claude-code  Fix authentication bug in auth.py         completed
trc-f6e7d8c9b0  15m ago  my-rag-app   Analyze Q3 revenue data                  completed
trc-1a2b3c4d5e  1h ago   claude-code  Refactor database connection pooling      completed

3 trace(s) shown.

Adapter Status

Tested end-to-end with real API calls (Gemini, Claude) and simulated event streams (Bedrock). Coverage = percentage of the 22 Trace fields that are populated in a real test.

Adapter Coverage What's N/A Install
MCP 22/22 (100%) openflux[mcp]
Amazon Bedrock 21/22 (100%) files_modified (cloud agents) openflux[bedrock]
Claude Code 21/22 (95%) parent_id (stdlib)
LangChain 20/22 (91%) correction, files_modified openflux[langchain]
Claude Agent SDK 20/22 (91%) parent_id, correction openflux[claude-agent-sdk]
Google ADK 16/22 (73%) parent_id, task, decision, correction, sources_read, files_modified openflux[google-adk]
OpenAI Agents SDK Working Untested (API quota) openflux[openai]
AutoGen v0.4 Working Untested (API quota) openflux[autogen]
CrewAI Working Untested (API quota) openflux[crewai]

Coverage means "of the fields that are structurally possible for this adapter, how many are populated." 100% means every testable field works.

Configuration

All env vars, no config files.

Variable Default Purpose
OPENFLUX_DB_PATH ~/.openflux/traces.db SQLite database location
OPENFLUX_OTLP_ENDPOINT http://localhost:4318 OTLP/HTTP endpoint for export
OPENFLUX_FIDELITY full full (raw content) or redacted (hash-only)
OPENFLUX_EXCLUDE_PATHS *.env,*credentials*,... Glob patterns to exclude from content storage

Schema

A Trace captures one complete unit of agent work:

  • Identity: id, timestamp, agent, session_id, parent_id
  • What happened: task, decision, status, correction
  • Provenance: context given, searches run, sources read, tools called
  • Metrics: token usage, duration, turn count, files modified
  • Extensibility: tags, scope, metadata dict

Full schema definition in docs/schema.md.

Development

uv run pytest tests/ -v          # tests
uv run ruff check src/ tests/    # lint
uv run ruff format src/ tests/   # format
uv run pyright src/              # type check

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openflux-0.1.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openflux-0.1.1-py3-none-any.whl (71.0 kB view details)

Uploaded Python 3

File details

Details for the file openflux-0.1.1.tar.gz.

File metadata

  • Download URL: openflux-0.1.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openflux-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4cfc2fb0dd107509b3d357169fcf6f277f67360b97922aa1220c588f6fc52640
MD5 e7ddf5314ce8c3e8b071ebd00203ca08
BLAKE2b-256 7deb2ab36212225dffa71e501a121c9554a897d716f06a9a40dedae44345f29e

See more details on using hashes here.

File details

Details for the file openflux-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: openflux-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 71.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openflux-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5db52fd5f937e8b72cd8f0148a7c3d5e77962b2cee3e27b50676b4b8250ecd3
MD5 12143ec428bfc532367ad92c061c0571
BLAKE2b-256 d63505fb5ca50bec631446d984b6d9a519360114b0a7296e3ab63972ba6ee4e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page