openflux 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openflux-0.1.0/.github/workflows/ci.yml +29 -0
- openflux-0.1.0/.gitignore +23 -0
- openflux-0.1.0/CHANGELOG.md +29 -0
- openflux-0.1.0/CONTRIBUTING.md +49 -0
- openflux-0.1.0/LICENSE +21 -0
- openflux-0.1.0/PKG-INFO +214 -0
- openflux-0.1.0/README.md +166 -0
- openflux-0.1.0/docs/adapters.md +457 -0
- openflux-0.1.0/docs/cost.md +228 -0
- openflux-0.1.0/docs/index.md +113 -0
- openflux-0.1.0/docs/schema.md +202 -0
- openflux-0.1.0/pyproject.toml +100 -0
- openflux-0.1.0/src/openflux/__init__.py +62 -0
- openflux-0.1.0/src/openflux/_util.py +109 -0
- openflux-0.1.0/src/openflux/adapters/__init__.py +107 -0
- openflux-0.1.0/src/openflux/adapters/_claude_code.py +915 -0
- openflux-0.1.0/src/openflux/adapters/autogen.py +378 -0
- openflux-0.1.0/src/openflux/adapters/bedrock.py +525 -0
- openflux-0.1.0/src/openflux/adapters/claude_agent_sdk.py +471 -0
- openflux-0.1.0/src/openflux/adapters/claude_code/__init__.py +23 -0
- openflux-0.1.0/src/openflux/adapters/claude_code/__main__.py +5 -0
- openflux-0.1.0/src/openflux/adapters/crewai.py +538 -0
- openflux-0.1.0/src/openflux/adapters/google_adk.py +385 -0
- openflux-0.1.0/src/openflux/adapters/langchain.py +731 -0
- openflux-0.1.0/src/openflux/adapters/mcp.py +356 -0
- openflux-0.1.0/src/openflux/adapters/openai_agents.py +431 -0
- openflux-0.1.0/src/openflux/cli.py +719 -0
- openflux-0.1.0/src/openflux/collector.py +50 -0
- openflux-0.1.0/src/openflux/normalizer.py +201 -0
- openflux-0.1.0/src/openflux/py.typed +0 -0
- openflux-0.1.0/src/openflux/schema.py +159 -0
- openflux-0.1.0/src/openflux/serve/__init__.py +12 -0
- openflux-0.1.0/src/openflux/serve/_api.py +274 -0
- openflux-0.1.0/src/openflux/serve/_server.py +104 -0
- openflux-0.1.0/src/openflux/sinks/__init__.py +8 -0
- openflux-0.1.0/src/openflux/sinks/base.py +15 -0
- openflux-0.1.0/src/openflux/sinks/json.py +22 -0
- openflux-0.1.0/src/openflux/sinks/otlp.py +250 -0
- openflux-0.1.0/src/openflux/sinks/sqlite.py +582 -0
- openflux-0.1.0/src/openflux/static/index.html +131 -0
- openflux-0.1.0/tests/__init__.py +0 -0
- openflux-0.1.0/tests/acceptance/.env.example +3 -0
- openflux-0.1.0/tests/acceptance/Dockerfile.base +10 -0
- openflux-0.1.0/tests/acceptance/__init__.py +0 -0
- openflux-0.1.0/tests/acceptance/autogen/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/bedrock/Dockerfile +3 -0
- openflux-0.1.0/tests/acceptance/claude-agent-sdk/Dockerfile +6 -0
- openflux-0.1.0/tests/acceptance/claude-code/Dockerfile +3 -0
- openflux-0.1.0/tests/acceptance/conftest.py +9 -0
- openflux-0.1.0/tests/acceptance/crewai/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/docker-compose.yml +64 -0
- openflux-0.1.0/tests/acceptance/google-adk/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/helpers.py +86 -0
- openflux-0.1.0/tests/acceptance/langchain/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/mcp/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/openai/Dockerfile +4 -0
- openflux-0.1.0/tests/acceptance/run.sh +15 -0
- openflux-0.1.0/tests/acceptance/test_autogen.py +118 -0
- openflux-0.1.0/tests/acceptance/test_bedrock.py +376 -0
- openflux-0.1.0/tests/acceptance/test_claude_agent_sdk.py +136 -0
- openflux-0.1.0/tests/acceptance/test_claude_code.py +507 -0
- openflux-0.1.0/tests/acceptance/test_crewai.py +106 -0
- openflux-0.1.0/tests/acceptance/test_google_adk.py +110 -0
- openflux-0.1.0/tests/acceptance/test_langchain.py +105 -0
- openflux-0.1.0/tests/acceptance/test_mcp.py +130 -0
- openflux-0.1.0/tests/acceptance/test_openai_agents.py +94 -0
- openflux-0.1.0/tests/test_serve.py +264 -0
- openflux-0.1.0/tests/unit/__init__.py +0 -0
- openflux-0.1.0/tests/unit/conftest.py +167 -0
- openflux-0.1.0/tests/unit/test_cli.py +903 -0
- openflux-0.1.0/tests/unit/test_collector.py +150 -0
- openflux-0.1.0/tests/unit/test_init.py +38 -0
- openflux-0.1.0/tests/unit/test_json_sink.py +35 -0
- openflux-0.1.0/tests/unit/test_mcp_adapter.py +294 -0
- openflux-0.1.0/tests/unit/test_normalizer.py +351 -0
- openflux-0.1.0/tests/unit/test_otlp_sink.py +257 -0
- openflux-0.1.0/tests/unit/test_schema.py +188 -0
- openflux-0.1.0/tests/unit/test_sqlite_sink.py +625 -0
- openflux-0.1.0/tests/unit/test_util.py +141 -0
- openflux-0.1.0/uv.lock +4810 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.12", "3.13"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
- uses: astral-sh/setup-uv@v7
|
|
24
|
+
- run: uv python install ${{ matrix.python-version }}
|
|
25
|
+
- run: uv sync --group dev
|
|
26
|
+
- run: uv run ruff check src/ tests/
|
|
27
|
+
- run: uv run ruff format --check src/ tests/
|
|
28
|
+
- run: uv run pyright src/
|
|
29
|
+
- run: uv run pytest tests/ -v
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.pyo
|
|
4
|
+
*.so
|
|
5
|
+
*.egg
|
|
6
|
+
*.egg-info/
|
|
7
|
+
.DS_Store
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.venv/
|
|
11
|
+
.env
|
|
12
|
+
.env.*
|
|
13
|
+
!.env.example
|
|
14
|
+
.claude/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.pyright/
|
|
19
|
+
htmlcov/
|
|
20
|
+
.coverage
|
|
21
|
+
.coverage.*
|
|
22
|
+
coverage.xml
|
|
23
|
+
*.db
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-03-27)
|
|
4
|
+
|
|
5
|
+
Initial release.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
- 22-field Trace schema for normalized AI agent telemetry
|
|
9
|
+
- 9 framework adapters: Claude Code, OpenAI Agents SDK, LangChain, Claude Agent SDK, AutoGen, CrewAI, Google ADK, MCP, Amazon Bedrock
|
|
10
|
+
- 3 sinks: SQLite with FTS5 (default), OTLP/HTTP, NDJSON stdout
|
|
11
|
+
- CLI: `openflux recent`, `search`, `trace`, `export`, `status`, `install`
|
|
12
|
+
- Zero runtime dependencies for core (stdlib only)
|
|
13
|
+
- Content hashing with SHA-256 and fidelity modes (full/redacted)
|
|
14
|
+
- Thread-safe collector with per-session event buffering
|
|
15
|
+
- Path exclusion for sensitive files (*.env, *credentials*, etc.)
|
|
16
|
+
- `openflux install claude-code` auto-configures lifecycle hooks
|
|
17
|
+
|
|
18
|
+
### Adapters tested E2E
|
|
19
|
+
- MCP (22/22 fields, 100%)
|
|
20
|
+
- Bedrock (21/22, simulated events)
|
|
21
|
+
- Claude Code (hooks + transcript parsing)
|
|
22
|
+
- LangChain (real Gemini API)
|
|
23
|
+
- Google ADK (real Gemini API)
|
|
24
|
+
- Claude Agent SDK (local, Docker needs CLI auth)
|
|
25
|
+
|
|
26
|
+
### Known limitations
|
|
27
|
+
- OpenAI Agents, AutoGen, CrewAI adapters built but not yet E2E tested (API quota)
|
|
28
|
+
- No web UI (CLI only)
|
|
29
|
+
- SQLite storage only for local use; OTLP for export to external systems
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing to OpenFlux
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/advitrocks9/openflux.git
|
|
7
|
+
cd openflux
|
|
8
|
+
uv sync --group dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
Run tests:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv run pytest tests/ -v
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Lint and format:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv run ruff check src/ tests/
|
|
23
|
+
uv run ruff format src/ tests/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Type check:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv run pyright src/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Pull Requests
|
|
33
|
+
|
|
34
|
+
Before opening a PR, make sure:
|
|
35
|
+
|
|
36
|
+
- `uv run pytest tests/ -v` passes
|
|
37
|
+
- `uv run ruff check src/ tests/` is clean
|
|
38
|
+
- `uv run ruff format --check src/ tests/` is clean
|
|
39
|
+
- `uv run pyright src/` reports no errors
|
|
40
|
+
|
|
41
|
+
## Writing Adapters
|
|
42
|
+
|
|
43
|
+
Each adapter lives in its own file under `src/openflux/adapters/`. Follow the pattern in existing adapters:
|
|
44
|
+
|
|
45
|
+
1. Guard framework imports with `try/except ImportError` so the core package stays zero-dep.
|
|
46
|
+
2. Hook into the framework's callback or event system.
|
|
47
|
+
3. Emit raw event dicts to the normalizer -- don't do classification or hashing yourself.
|
|
48
|
+
4. Add the framework as an optional dependency in `pyproject.toml` under `[project.optional-dependencies]`.
|
|
49
|
+
5. Add tests in `tests/` that mock the framework dependency.
|
openflux-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Advit Arora
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
openflux-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openflux
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open standard for AI agent telemetry. One schema across every framework.
|
|
5
|
+
Project-URL: Homepage, https://github.com/advitrocks9/openflux
|
|
6
|
+
Project-URL: Documentation, https://github.com/advitrocks9/openflux/tree/main/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/advitrocks9/openflux
|
|
8
|
+
Author: Advit Arora
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: System :: Monitoring
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Provides-Extra: all
|
|
21
|
+
Requires-Dist: autogen-agentchat>=0.4; extra == 'all'
|
|
22
|
+
Requires-Dist: autogen-ext[openai]>=0.4; extra == 'all'
|
|
23
|
+
Requires-Dist: boto3>=1.28; extra == 'all'
|
|
24
|
+
Requires-Dist: claude-agent-sdk>=0.1; extra == 'all'
|
|
25
|
+
Requires-Dist: crewai[tools]>=0.80; extra == 'all'
|
|
26
|
+
Requires-Dist: google-adk>=0.1; extra == 'all'
|
|
27
|
+
Requires-Dist: langchain-core>=0.1; extra == 'all'
|
|
28
|
+
Requires-Dist: mcp>=1.0; extra == 'all'
|
|
29
|
+
Requires-Dist: openai-agents>=0.1; extra == 'all'
|
|
30
|
+
Provides-Extra: autogen
|
|
31
|
+
Requires-Dist: autogen-agentchat>=0.4; extra == 'autogen'
|
|
32
|
+
Requires-Dist: autogen-ext[openai]>=0.4; extra == 'autogen'
|
|
33
|
+
Provides-Extra: bedrock
|
|
34
|
+
Requires-Dist: boto3>=1.28; extra == 'bedrock'
|
|
35
|
+
Provides-Extra: claude-agent-sdk
|
|
36
|
+
Requires-Dist: claude-agent-sdk>=0.1; extra == 'claude-agent-sdk'
|
|
37
|
+
Provides-Extra: crewai
|
|
38
|
+
Requires-Dist: crewai[tools]>=0.80; extra == 'crewai'
|
|
39
|
+
Provides-Extra: google-adk
|
|
40
|
+
Requires-Dist: google-adk>=0.1; extra == 'google-adk'
|
|
41
|
+
Provides-Extra: langchain
|
|
42
|
+
Requires-Dist: langchain-core>=0.1; extra == 'langchain'
|
|
43
|
+
Provides-Extra: mcp
|
|
44
|
+
Requires-Dist: mcp>=1.0; extra == 'mcp'
|
|
45
|
+
Provides-Extra: openai
|
|
46
|
+
Requires-Dist: openai-agents>=0.1; extra == 'openai'
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# OpenFlux
|
|
50
|
+
|
|
51
|
+
[](https://pypi.org/project/openflux/)
|
|
52
|
+
[](https://pypi.org/project/openflux/)
|
|
53
|
+
[](https://www.python.org/downloads/)
|
|
54
|
+
[](https://opensource.org/licenses/MIT)
|
|
55
|
+
|
|
56
|
+
Open standard for AI agent telemetry. One schema across every framework.
|
|
57
|
+
|
|
58
|
+
## Why
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
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.
|
|
65
|
+
|
|
66
|
+
## How it works
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Adapter (framework-specific) -> Normalizer -> Trace -> Sink(s)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- **Adapters** hook into framework callbacks and emit raw events
|
|
73
|
+
- **Normalizer** classifies events, hashes content, applies fidelity controls
|
|
74
|
+
- **Trace** is the universal schema (22 fields + 4 nested record types)
|
|
75
|
+
- **Sinks** write the Trace somewhere: SQLite (default), OTLP, or JSON stdout
|
|
76
|
+
|
|
77
|
+
Zero dependencies beyond Python stdlib for the core. Each adapter adds one optional dep.
|
|
78
|
+
|
|
79
|
+
## Install
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install openflux
|
|
83
|
+
|
|
84
|
+
# With a specific adapter
|
|
85
|
+
pip install openflux[openai]
|
|
86
|
+
pip install openflux[langchain]
|
|
87
|
+
|
|
88
|
+
# Everything
|
|
89
|
+
pip install openflux[all]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Quick start
|
|
93
|
+
|
|
94
|
+
### Claude Code
|
|
95
|
+
|
|
96
|
+
Auto-configures lifecycle hooks:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
openflux install claude-code
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### OpenAI Agents SDK
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from agents.tracing import add_trace_processor
|
|
106
|
+
from openflux.adapters.openai_agents import OpenFluxProcessor
|
|
107
|
+
|
|
108
|
+
add_trace_processor(OpenFluxProcessor(agent="my-agent"))
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### LangChain
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import openflux
|
|
115
|
+
|
|
116
|
+
handler = openflux.langchain_handler(agent="my-rag-app")
|
|
117
|
+
result = chain.invoke({"input": "..."}, config={"callbacks": [handler]})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Any framework
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
import openflux
|
|
124
|
+
|
|
125
|
+
collector = openflux.init(agent="my-agent")
|
|
126
|
+
|
|
127
|
+
# Event types: meta, tool, search, source, context
|
|
128
|
+
collector.record_event("session-1", {"type": "meta", "task": "fix auth bug", "model": "gpt-4o"})
|
|
129
|
+
collector.record_event("session-1", {"type": "tool", "tool_name": "Bash", "tool_input": "pytest", "tool_output": "3 passed"})
|
|
130
|
+
collector.record_event("session-1", {"type": "search", "query": "oauth best practices", "engine": "web"})
|
|
131
|
+
|
|
132
|
+
trace = collector.flush("session-1") # persisted to ~/.openflux/traces.db
|
|
133
|
+
print(f"Traced: {trace.task} -> {trace.status} ({len(trace.tools_used)} tools)")
|
|
134
|
+
# Then query later: openflux recent
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## CLI
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
openflux recent # last 10 traces
|
|
141
|
+
openflux recent --agent claude-code # filter by agent
|
|
142
|
+
openflux search "staging deploy" # full-text search
|
|
143
|
+
openflux trace trc-a1b2c3d4e5f6 # full detail for one trace
|
|
144
|
+
openflux export > traces.json # dump as NDJSON
|
|
145
|
+
openflux status # db path, counts, breakdown
|
|
146
|
+
openflux install claude-code # auto-configure hooks
|
|
147
|
+
openflux install --list # show available adapters
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## What you see
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
$ openflux recent
|
|
154
|
+
ID WHEN AGENT TASK STATUS
|
|
155
|
+
trc-a1b2c3d4e5 2m ago claude-code Fix authentication bug in auth.py completed
|
|
156
|
+
trc-f6e7d8c9b0 15m ago my-rag-app Analyze Q3 revenue data completed
|
|
157
|
+
trc-1a2b3c4d5e 1h ago claude-code Refactor database connection pooling completed
|
|
158
|
+
|
|
159
|
+
3 trace(s) shown.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Adapter Status
|
|
163
|
+
|
|
164
|
+
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.
|
|
165
|
+
|
|
166
|
+
| Adapter | Coverage | What's N/A | Install |
|
|
167
|
+
|---------|----------|------------|---------|
|
|
168
|
+
| MCP | 22/22 (100%) | — | `openflux[mcp]` |
|
|
169
|
+
| Amazon Bedrock | 21/22 (100%) | files_modified (cloud agents) | `openflux[bedrock]` |
|
|
170
|
+
| Claude Code | 20/22 (91%) | parent_id, context (not in transcripts) | `(stdlib)` |
|
|
171
|
+
| LangChain | 20/22 (100%) | parent_id, correction | `openflux[langchain]` |
|
|
172
|
+
| Claude Agent SDK | 19/22 (100%) | parent_id, correction, files_modified | `openflux[claude-agent-sdk]` |
|
|
173
|
+
| Google ADK | 18/22 (100%) | parent_id, correction, files_modified, searches | `openflux[google-adk]` |
|
|
174
|
+
| OpenAI Agents SDK | Working | Untested (API quota) | `openflux[openai]` |
|
|
175
|
+
| AutoGen v0.4 | Working | Untested (API quota) | `openflux[autogen]` |
|
|
176
|
+
| CrewAI | Working | Untested (API quota) | `openflux[crewai]` |
|
|
177
|
+
|
|
178
|
+
Coverage means "of the fields that are structurally possible for this adapter, how many are populated." 100% means every testable field works. See `.claude/findings.md` for details on what's N/A and why.
|
|
179
|
+
|
|
180
|
+
## Configuration
|
|
181
|
+
|
|
182
|
+
All env vars, no config files.
|
|
183
|
+
|
|
184
|
+
| Variable | Default | Purpose |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| `OPENFLUX_DB_PATH` | `~/.openflux/traces.db` | SQLite database location |
|
|
187
|
+
| `OPENFLUX_OTLP_ENDPOINT` | `http://localhost:4318` | OTLP/HTTP endpoint for export |
|
|
188
|
+
| `OPENFLUX_FIDELITY` | `full` | `full` (raw content) or `redacted` (hash-only) |
|
|
189
|
+
| `OPENFLUX_EXCLUDE_PATHS` | `*.env,*credentials*,...` | Glob patterns to exclude from content storage |
|
|
190
|
+
|
|
191
|
+
## Schema
|
|
192
|
+
|
|
193
|
+
A Trace captures one complete unit of agent work:
|
|
194
|
+
|
|
195
|
+
- **Identity**: id, timestamp, agent, session_id, parent_id
|
|
196
|
+
- **What happened**: task, decision, status, correction
|
|
197
|
+
- **Provenance**: context given, searches run, sources read, tools called
|
|
198
|
+
- **Metrics**: token usage, duration, turn count, files modified
|
|
199
|
+
- **Extensibility**: tags, scope, metadata dict
|
|
200
|
+
|
|
201
|
+
Full schema definition in [docs/PRD.md](docs/PRD.md).
|
|
202
|
+
|
|
203
|
+
## Development
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
uv run pytest tests/ -v # tests
|
|
207
|
+
uv run ruff check src/ tests/ # lint
|
|
208
|
+
uv run ruff format src/ tests/ # format
|
|
209
|
+
uv run pyright src/ # type check
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## License
|
|
213
|
+
|
|
214
|
+
[MIT](LICENSE)
|
openflux-0.1.0/README.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# OpenFlux
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/openflux/)
|
|
4
|
+
[](https://pypi.org/project/openflux/)
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Open standard for AI agent telemetry. One schema across every framework.
|
|
9
|
+
|
|
10
|
+
## Why
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
## How it works
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Adapter (framework-specific) -> Normalizer -> Trace -> Sink(s)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- **Adapters** hook into framework callbacks and emit raw events
|
|
25
|
+
- **Normalizer** classifies events, hashes content, applies fidelity controls
|
|
26
|
+
- **Trace** is the universal schema (22 fields + 4 nested record types)
|
|
27
|
+
- **Sinks** write the Trace somewhere: SQLite (default), OTLP, or JSON stdout
|
|
28
|
+
|
|
29
|
+
Zero dependencies beyond Python stdlib for the core. Each adapter adds one optional dep.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install openflux
|
|
35
|
+
|
|
36
|
+
# With a specific adapter
|
|
37
|
+
pip install openflux[openai]
|
|
38
|
+
pip install openflux[langchain]
|
|
39
|
+
|
|
40
|
+
# Everything
|
|
41
|
+
pip install openflux[all]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
|
|
46
|
+
### Claude Code
|
|
47
|
+
|
|
48
|
+
Auto-configures lifecycle hooks:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
openflux install claude-code
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### OpenAI Agents SDK
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from agents.tracing import add_trace_processor
|
|
58
|
+
from openflux.adapters.openai_agents import OpenFluxProcessor
|
|
59
|
+
|
|
60
|
+
add_trace_processor(OpenFluxProcessor(agent="my-agent"))
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### LangChain
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
import openflux
|
|
67
|
+
|
|
68
|
+
handler = openflux.langchain_handler(agent="my-rag-app")
|
|
69
|
+
result = chain.invoke({"input": "..."}, config={"callbacks": [handler]})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Any framework
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
import openflux
|
|
76
|
+
|
|
77
|
+
collector = openflux.init(agent="my-agent")
|
|
78
|
+
|
|
79
|
+
# Event types: meta, tool, search, source, context
|
|
80
|
+
collector.record_event("session-1", {"type": "meta", "task": "fix auth bug", "model": "gpt-4o"})
|
|
81
|
+
collector.record_event("session-1", {"type": "tool", "tool_name": "Bash", "tool_input": "pytest", "tool_output": "3 passed"})
|
|
82
|
+
collector.record_event("session-1", {"type": "search", "query": "oauth best practices", "engine": "web"})
|
|
83
|
+
|
|
84
|
+
trace = collector.flush("session-1") # persisted to ~/.openflux/traces.db
|
|
85
|
+
print(f"Traced: {trace.task} -> {trace.status} ({len(trace.tools_used)} tools)")
|
|
86
|
+
# Then query later: openflux recent
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## CLI
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
openflux recent # last 10 traces
|
|
93
|
+
openflux recent --agent claude-code # filter by agent
|
|
94
|
+
openflux search "staging deploy" # full-text search
|
|
95
|
+
openflux trace trc-a1b2c3d4e5f6 # full detail for one trace
|
|
96
|
+
openflux export > traces.json # dump as NDJSON
|
|
97
|
+
openflux status # db path, counts, breakdown
|
|
98
|
+
openflux install claude-code # auto-configure hooks
|
|
99
|
+
openflux install --list # show available adapters
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## What you see
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
$ openflux recent
|
|
106
|
+
ID WHEN AGENT TASK STATUS
|
|
107
|
+
trc-a1b2c3d4e5 2m ago claude-code Fix authentication bug in auth.py completed
|
|
108
|
+
trc-f6e7d8c9b0 15m ago my-rag-app Analyze Q3 revenue data completed
|
|
109
|
+
trc-1a2b3c4d5e 1h ago claude-code Refactor database connection pooling completed
|
|
110
|
+
|
|
111
|
+
3 trace(s) shown.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Adapter Status
|
|
115
|
+
|
|
116
|
+
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.
|
|
117
|
+
|
|
118
|
+
| Adapter | Coverage | What's N/A | Install |
|
|
119
|
+
|---------|----------|------------|---------|
|
|
120
|
+
| MCP | 22/22 (100%) | — | `openflux[mcp]` |
|
|
121
|
+
| Amazon Bedrock | 21/22 (100%) | files_modified (cloud agents) | `openflux[bedrock]` |
|
|
122
|
+
| Claude Code | 20/22 (91%) | parent_id, context (not in transcripts) | `(stdlib)` |
|
|
123
|
+
| LangChain | 20/22 (100%) | parent_id, correction | `openflux[langchain]` |
|
|
124
|
+
| Claude Agent SDK | 19/22 (100%) | parent_id, correction, files_modified | `openflux[claude-agent-sdk]` |
|
|
125
|
+
| Google ADK | 18/22 (100%) | parent_id, correction, files_modified, searches | `openflux[google-adk]` |
|
|
126
|
+
| OpenAI Agents SDK | Working | Untested (API quota) | `openflux[openai]` |
|
|
127
|
+
| AutoGen v0.4 | Working | Untested (API quota) | `openflux[autogen]` |
|
|
128
|
+
| CrewAI | Working | Untested (API quota) | `openflux[crewai]` |
|
|
129
|
+
|
|
130
|
+
Coverage means "of the fields that are structurally possible for this adapter, how many are populated." 100% means every testable field works. See `.claude/findings.md` for details on what's N/A and why.
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
All env vars, no config files.
|
|
135
|
+
|
|
136
|
+
| Variable | Default | Purpose |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| `OPENFLUX_DB_PATH` | `~/.openflux/traces.db` | SQLite database location |
|
|
139
|
+
| `OPENFLUX_OTLP_ENDPOINT` | `http://localhost:4318` | OTLP/HTTP endpoint for export |
|
|
140
|
+
| `OPENFLUX_FIDELITY` | `full` | `full` (raw content) or `redacted` (hash-only) |
|
|
141
|
+
| `OPENFLUX_EXCLUDE_PATHS` | `*.env,*credentials*,...` | Glob patterns to exclude from content storage |
|
|
142
|
+
|
|
143
|
+
## Schema
|
|
144
|
+
|
|
145
|
+
A Trace captures one complete unit of agent work:
|
|
146
|
+
|
|
147
|
+
- **Identity**: id, timestamp, agent, session_id, parent_id
|
|
148
|
+
- **What happened**: task, decision, status, correction
|
|
149
|
+
- **Provenance**: context given, searches run, sources read, tools called
|
|
150
|
+
- **Metrics**: token usage, duration, turn count, files modified
|
|
151
|
+
- **Extensibility**: tags, scope, metadata dict
|
|
152
|
+
|
|
153
|
+
Full schema definition in [docs/PRD.md](docs/PRD.md).
|
|
154
|
+
|
|
155
|
+
## Development
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
uv run pytest tests/ -v # tests
|
|
159
|
+
uv run ruff check src/ tests/ # lint
|
|
160
|
+
uv run ruff format src/ tests/ # format
|
|
161
|
+
uv run pyright src/ # type check
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[MIT](LICENSE)
|