witdem-analytics 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.
Files changed (115) hide show
  1. witdem_analytics-0.1.0/.gitignore +27 -0
  2. witdem_analytics-0.1.0/LICENSE +201 -0
  3. witdem_analytics-0.1.0/PKG-INFO +287 -0
  4. witdem_analytics-0.1.0/README.md +260 -0
  5. witdem_analytics-0.1.0/pyproject.toml +96 -0
  6. witdem_analytics-0.1.0/src/witdem/__init__.py +8 -0
  7. witdem_analytics-0.1.0/src/witdem/adapters/__init__.py +13 -0
  8. witdem_analytics-0.1.0/src/witdem/adapters/base.py +31 -0
  9. witdem_analytics-0.1.0/src/witdem/adapters/haystack_adapter.py +59 -0
  10. witdem_analytics-0.1.0/src/witdem/adapters/providers.py +93 -0
  11. witdem_analytics-0.1.0/src/witdem/adapters/registry.py +51 -0
  12. witdem_analytics-0.1.0/src/witdem/analytics/__init__.py +74 -0
  13. witdem_analytics-0.1.0/src/witdem/analytics/contracts/__init__.py +31 -0
  14. witdem_analytics-0.1.0/src/witdem/analytics/contracts/read_models.py +252 -0
  15. witdem_analytics-0.1.0/src/witdem/analytics/core.py +108 -0
  16. witdem_analytics-0.1.0/src/witdem/analytics/cost.py +533 -0
  17. witdem_analytics-0.1.0/src/witdem/analytics/derived.py +104 -0
  18. witdem_analytics-0.1.0/src/witdem/analytics/identity.py +319 -0
  19. witdem_analytics-0.1.0/src/witdem/analytics/operations.py +442 -0
  20. witdem_analytics-0.1.0/src/witdem/analytics/queries/entities/models.sql +10 -0
  21. witdem_analytics-0.1.0/src/witdem/analytics/queries/entities/provider_values.sql +4 -0
  22. witdem_analytics-0.1.0/src/witdem/analytics/queries/entities/providers.sql +9 -0
  23. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/business_outcome.sql +5 -0
  24. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/evaluations_for_execution.sql +4 -0
  25. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/events_for_execution.sql +4 -0
  26. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/execution_detail.sql +3 -0
  27. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/execution_population.sql +4 -0
  28. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/execution_timeline.sql +4 -0
  29. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/links_for_execution.sql +3 -0
  30. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/outcomes_for_execution.sql +4 -0
  31. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/product_goal.sql +5 -0
  32. witdem_analytics-0.1.0/src/witdem/analytics/queries/execution/runtime_outcome.sql +8 -0
  33. witdem_analytics-0.1.0/src/witdem/analytics/queries/failures/failure_patterns.sql +11 -0
  34. witdem_analytics-0.1.0/src/witdem/analytics/queries/overview/cost_summary.sql +8 -0
  35. witdem_analytics-0.1.0/src/witdem/analytics/queries/overview/execution_health.sql +31 -0
  36. witdem_analytics-0.1.0/src/witdem/analytics/queries/overview/performance.sql +9 -0
  37. witdem_analytics-0.1.0/src/witdem/analytics/queries/overview/product_goals.sql +4 -0
  38. witdem_analytics-0.1.0/src/witdem/analytics/queries/overview/success_metrics.sql +11 -0
  39. witdem_analytics-0.1.0/src/witdem/analytics/queries/paths/loops.sql +4 -0
  40. witdem_analytics-0.1.0/src/witdem/analytics/queries/paths/path_frequency.sql +3 -0
  41. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/capabilities.sql +12 -0
  42. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/evaluations_count.sql +2 -0
  43. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/events_capabilities.sql +4 -0
  44. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_completed.sql +7 -0
  45. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_end_date.sql +1 -0
  46. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_failed.sql +7 -0
  47. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_has_failure.sql +6 -0
  48. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_provider.sql +6 -0
  49. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_running.sql +1 -0
  50. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/filter_start_date.sql +1 -0
  51. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/metadata.sql +1 -0
  52. witdem_analytics-0.1.0/src/witdem/analytics/queries/shared/outcomes_count.sql +2 -0
  53. witdem_analytics-0.1.0/src/witdem/analytics/read_model.py +360 -0
  54. witdem_analytics-0.1.0/src/witdem/analytics/repository/__init__.py +6 -0
  55. witdem_analytics-0.1.0/src/witdem/analytics/repository/analytics_repository.py +3429 -0
  56. witdem_analytics-0.1.0/src/witdem/analytics/repository/backend.py +51 -0
  57. witdem_analytics-0.1.0/src/witdem/analytics/repository/sql_loader.py +44 -0
  58. witdem_analytics-0.1.0/src/witdem/analytics/repository/state.py +55 -0
  59. witdem_analytics-0.1.0/src/witdem/analytics/runtime.py +1311 -0
  60. witdem_analytics-0.1.0/src/witdem/analytics/schema/analytics_tables.sql +116 -0
  61. witdem_analytics-0.1.0/src/witdem/analytics/schema.py +108 -0
  62. witdem_analytics-0.1.0/src/witdem/analytics/serving.py +477 -0
  63. witdem_analytics-0.1.0/src/witdem/api.py +145 -0
  64. witdem_analytics-0.1.0/src/witdem/auth.py +64 -0
  65. witdem_analytics-0.1.0/src/witdem/cli.py +728 -0
  66. witdem_analytics-0.1.0/src/witdem/config.py +88 -0
  67. witdem_analytics-0.1.0/src/witdem/dashboard/__init__.py +5 -0
  68. witdem_analytics-0.1.0/src/witdem/dashboard/app.py +216 -0
  69. witdem_analytics-0.1.0/src/witdem/dashboard/service.py +952 -0
  70. witdem_analytics-0.1.0/src/witdem/dashboard/static/assets/echarts-runtime-mIDt9UdM.js +19 -0
  71. witdem_analytics-0.1.0/src/witdem/dashboard/static/assets/index-B2TO5dg7.css +1 -0
  72. witdem_analytics-0.1.0/src/witdem/dashboard/static/assets/index-DnxvhzHV.js +56 -0
  73. witdem_analytics-0.1.0/src/witdem/dashboard/static/assets/witdem-mark-purple-B7xvtfh0.png +0 -0
  74. witdem_analytics-0.1.0/src/witdem/dashboard/static/index.html +3 -0
  75. witdem_analytics-0.1.0/src/witdem/elt/__init__.py +7 -0
  76. witdem_analytics-0.1.0/src/witdem/elt/adapter_stage.py +235 -0
  77. witdem_analytics-0.1.0/src/witdem/elt/publisher.py +43 -0
  78. witdem_analytics-0.1.0/src/witdem/elt/worker.py +205 -0
  79. witdem_analytics-0.1.0/src/witdem/elt/workspace/pipelines/normalize.pipeline.json +59 -0
  80. witdem_analytics-0.1.0/src/witdem/evaluation_campaigns.py +108 -0
  81. witdem_analytics-0.1.0/src/witdem/ingest/__init__.py +1 -0
  82. witdem_analytics-0.1.0/src/witdem/ingest/corpus.py +223 -0
  83. witdem_analytics-0.1.0/src/witdem/ingest/correlate.py +374 -0
  84. witdem_analytics-0.1.0/src/witdem/ingest/live_db.py +1239 -0
  85. witdem_analytics-0.1.0/src/witdem/ingest/otlp_http.py +249 -0
  86. witdem_analytics-0.1.0/src/witdem/ingest/raw_store.py +195 -0
  87. witdem_analytics-0.1.0/src/witdem/ingest/sdk_ingest.py +183 -0
  88. witdem_analytics-0.1.0/src/witdem/ingest/sdk_store.py +172 -0
  89. witdem_analytics-0.1.0/src/witdem/integrations/__init__.py +12 -0
  90. witdem_analytics-0.1.0/src/witdem/integrations/adapters/__init__.py +14 -0
  91. witdem_analytics-0.1.0/src/witdem/integrations/adapters/claude.py +158 -0
  92. witdem_analytics-0.1.0/src/witdem/integrations/adapters/langchain.py +173 -0
  93. witdem_analytics-0.1.0/src/witdem/integrations/adapters/langgraph.py +117 -0
  94. witdem_analytics-0.1.0/src/witdem/integrations/adapters/openai_agents.py +294 -0
  95. witdem_analytics-0.1.0/src/witdem/integrations/adapters/otel.py +34 -0
  96. witdem_analytics-0.1.0/src/witdem/integrations/mapping.py +266 -0
  97. witdem_analytics-0.1.0/src/witdem/integrations/models/__init__.py +4 -0
  98. witdem_analytics-0.1.0/src/witdem/integrations/models/normalized_operation.py +42 -0
  99. witdem_analytics-0.1.0/src/witdem/integrations/models/normalized_span.py +60 -0
  100. witdem_analytics-0.1.0/src/witdem/integrations/normalizers/__init__.py +5 -0
  101. witdem_analytics-0.1.0/src/witdem/integrations/normalizers/genai.py +157 -0
  102. witdem_analytics-0.1.0/src/witdem/integrations/normalizers/openinference.py +149 -0
  103. witdem_analytics-0.1.0/src/witdem/integrations/normalizers/otel.py +244 -0
  104. witdem_analytics-0.1.0/src/witdem/lifecycle.py +316 -0
  105. witdem_analytics-0.1.0/src/witdem/pricing/__init__.py +10 -0
  106. witdem_analytics-0.1.0/src/witdem/pricing/catalog.yaml +1004 -0
  107. witdem_analytics-0.1.0/src/witdem/pricing/sources.yaml +186 -0
  108. witdem_analytics-0.1.0/src/witdem/pricing/update.py +187 -0
  109. witdem_analytics-0.1.0/src/witdem/protocol.py +7 -0
  110. witdem_analytics-0.1.0/src/witdem/py.typed +1 -0
  111. witdem_analytics-0.1.0/src/witdem/retention.py +162 -0
  112. witdem_analytics-0.1.0/src/witdem/telemetry/__init__.py +5 -0
  113. witdem_analytics-0.1.0/src/witdem/telemetry/otel.py +193 -0
  114. witdem_analytics-0.1.0/src/witdem/update.py +212 -0
  115. witdem_analytics-0.1.0/src/witdem/workflows.py +782 -0
@@ -0,0 +1,27 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ .mypy_cache/
5
+ .ruff_cache/
6
+ .pytest_cache/
7
+ *.duckdb
8
+ /data/backups/
9
+ .env
10
+ .DS_Store
11
+ !data/synthetic-ui-v2/
12
+ !data/synthetic-ui-v2/**
13
+ !data/synthetic-ui-v2/analytics.duckdb
14
+ data/live/
15
+ .claude/
16
+ data/**/.DS_Store
17
+
18
+ # Dashboard contributor build artifacts
19
+ web/node_modules/
20
+ web/*.tsbuildinfo
21
+ web/vite.config.js
22
+ web/vite.config.d.ts
23
+ web/tailwind.config.js
24
+ web/tailwind.config.d.ts
25
+
26
+ # Locally generated live-matrix reports
27
+ examples/product-factory/reports/
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.5
2
+ Name: witdem-analytics
3
+ Version: 0.1.0
4
+ Summary: Runtime analytics for agent applications using OpenTelemetry, with optional business semantics through the Witdem SDK.
5
+ License-File: LICENSE
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Requires-Python: <3.14,>=3.10
12
+ Requires-Dist: cryptography<51,>=50
13
+ Requires-Dist: duckdb<2,>=1.2
14
+ Requires-Dist: duckle==0.5.11
15
+ Requires-Dist: fastapi<1,>=0.115
16
+ Requires-Dist: filelock<4,>=3.16
17
+ Requires-Dist: httpx<1,>=0.27
18
+ Requires-Dist: opentelemetry-api<2,>=1.27
19
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.27
20
+ Requires-Dist: opentelemetry-proto<2,>=1.27
21
+ Requires-Dist: opentelemetry-sdk<2,>=1.27
22
+ Requires-Dist: platformdirs<5,>=4.3
23
+ Requires-Dist: pydantic<3,>=2.10
24
+ Requires-Dist: pyyaml<7,>=6.0
25
+ Requires-Dist: uvicorn[standard]<1,>=0.34
26
+ Description-Content-Type: text/markdown
27
+
28
+ <div align="center">
29
+
30
+ <img src="docs/assets/witdem-banner.png" alt="Witdem AI — Understand how your AI system actually behaves" width="100%">
31
+
32
+ # Witdem
33
+
34
+ **Analytics for AI agents and multi-step AI applications.**
35
+
36
+ Tracing tells you what executed. Witdem connects those executions to application outcomes: which paths ran, what they cost, where they failed, and whether they achieved the product goal you defined.
37
+
38
+ [![Tests](https://github.com/ebrahimisoheil/witdem-oss/actions/workflows/test.yml/badge.svg)](https://github.com/ebrahimisoheil/witdem-oss/actions/workflows/test.yml)
39
+ [![SDK on PyPI](https://img.shields.io/pypi/v/witdem-sdk?label=witdem-sdk)](https://pypi.org/project/witdem-sdk/)
40
+ [![Analytics on PyPI](https://img.shields.io/pypi/v/witdem-analytics?label=witdem-analytics)](https://pypi.org/project/witdem-analytics/)
41
+ [![npm](https://img.shields.io/npm/v/witdem?label=npx%20witdem)](https://www.npmjs.com/package/witdem)
42
+ [![Python](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://github.com/ebrahimisoheil/witdem-oss/actions/workflows/test.yml)
43
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
44
+
45
+ [Get started](docs/getting-started.md) · [YAML contracts](docs/contract-tutorial.md) · [Frameworks](#integration-status) · [Providers](docs/providers.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
46
+
47
+ </div>
48
+
49
+ ## See Witdem in action
50
+
51
+ From one-line setup and two-line instrumentation to a measured run, its
52
+ execution graph, business outcome, cost, and contract evidence.
53
+
54
+ <p align="center">
55
+ <a href="https://cdn.jsdelivr.net/gh/ebrahimisoheil/witdem-oss@37e335d/docs/assets/witdem-demo.mp4">
56
+ <img src="docs/assets/witdem-demo-poster.jpg" alt="Watch the Witdem installation and analysis walkthrough" width="100%">
57
+ </a>
58
+ <br>
59
+ <a href="https://cdn.jsdelivr.net/gh/ebrahimisoheil/witdem-oss@37e335d/docs/assets/witdem-demo.mp4"><strong>▶ Watch the 1:48 installation-to-analysis walkthrough</strong></a>
60
+ </p>
61
+
62
+ ## First run
63
+
64
+ Choose one backend launcher. Applications use `witdem-sdk` with either path.
65
+
66
+ Docker-managed (requires Docker Compose):
67
+
68
+ ```bash
69
+ npx -y witdem@latest up
70
+ ```
71
+
72
+ Native Python (requires Python and [pipx](https://pipx.pypa.io/)):
73
+
74
+ ```bash
75
+ pipx install witdem-analytics
76
+ witdem up
77
+ ```
78
+
79
+ Both start the receiver, ELT worker, and dashboard, wait for health, open
80
+ `http://localhost:8501`, and preserve data across `down` and upgrades. Their
81
+ lifecycle vocabulary is the same:
82
+
83
+ ```bash
84
+ npx -y witdem@latest status # Docker path
85
+ witdem status # pipx path
86
+ npx -y witdem@latest logs receiver
87
+ witdem down
88
+ ```
89
+
90
+ Check releases and compatibility without changing packages or data:
91
+
92
+ ```bash
93
+ npx -y witdem@latest update --check
94
+ witdem update --check
95
+ ```
96
+
97
+ See the [upgrade guide](docs/upgrade.md) for exact NPX, pipx, and SDK commands.
98
+
99
+ Add the SDK to an existing Haystack 3 project:
100
+
101
+ ```bash
102
+ python -m pip install "witdem-sdk[haystack]"
103
+ export WITDEM_ENDPOINT=http://localhost:4318
104
+ ```
105
+
106
+ From the application project, create the YAML contract and then edit it to
107
+ describe that application's result:
108
+
109
+ ```bash
110
+ witdem-sdk init --runtime haystack
111
+ ```
112
+
113
+ This creates `.witdem/witdem.yaml`. It does not inspect or rewrite application
114
+ code, and it will not replace an existing contract unless `--force` is used.
115
+
116
+ Wrap the pipeline once. Its existing `run`, `run_async`, and `run_async_generator` calls stay unchanged:
117
+
118
+ ```python
119
+ from witdem_sdk.integrations.haystack import instrument
120
+
121
+ pipeline = instrument(build_pipeline())
122
+ result = pipeline.run(data)
123
+ ```
124
+
125
+ Add `.witdem/witdem.yaml` to describe what a useful result means:
126
+
127
+ ```yaml
128
+ version: 1
129
+ service:
130
+ name: support-agent
131
+ runtime: haystack
132
+ telemetry:
133
+ capture_content: false
134
+ contracts:
135
+ - name: answer
136
+ mode: expression
137
+ artifact:
138
+ name: Support answer
139
+ valid:
140
+ non_empty: $.answer
141
+ decision:
142
+ name: Result validity
143
+ expected: true
144
+ observed: $.witdem.artifact_valid
145
+ product_goal:
146
+ name: Useful answer returned
147
+ achieved: $.witdem.artifact_valid
148
+ ```
149
+
150
+ Run the application normally. The execution and its business result appear at **http://localhost:8501**.
151
+
152
+ ## What you get
153
+
154
+ - Actual execution paths, branches, loops, retries, tools, model calls, and failures
155
+ - Per-run latency, token usage, and cost when provider/model/usage evidence is sufficient
156
+ - Application outcomes and product-goal success defined by your application
157
+ - Provider and model comparisons using attributable time, usage, cost, and quality
158
+ - Workflow/path analytics and run-linked issue investigation
159
+ - Local DuckDB storage and a self-hosted dashboard; prompt and response capture is off by default
160
+
161
+ Witdem does not infer business success from a completed LLM call. Framework instrumentation records what happened technically; `.witdem/witdem.yaml` explains what the final result means.
162
+
163
+ ## Integration status
164
+
165
+ Statuses reflect current implementation and test evidence, not roadmap intent.
166
+
167
+ | Integration | Status | Verified surface |
168
+ | --- | --- | --- |
169
+ | [Haystack 3](docs/integrations/haystack.md) | **Stable** | Pipelines, agents, components, provider calls, loops, parallel branches, `run`, `run_async`, async generators |
170
+ | [LangGraph](docs/integrations/langgraph.md) | **Beta** | Compiled graphs, nodes, tools, models, errors, sync/async invocation and streaming |
171
+ | [LangChain](docs/integrations/langchain.md) | **Beta** | Runnables, chains, chat/LLM calls, tools, retrievers, sync/async invocation and streaming |
172
+ | [Native Python](docs/integrations/native-python.md) | **Supported** | Execution, operation, model, tool, decision, evaluation, outcome, and metric primitives |
173
+ | [OpenAI Agents](docs/integrations/openai-agents.md) | **Beta** | Native trace processor, agents, generations, tools, handoffs, sync/async workloads |
174
+ | [Anthropic Messages and Claude Agent SDK](docs/integrations/anthropic.md) | **Beta** | Messages calls, usage, tool-use IDs, multi-turn workloads, Claude Agent message streams |
175
+ | [Hugging Face smolagents](docs/integrations/smolagents.md) | **Beta** | Official OpenInference agent, step, model, and tool spans; sync and streaming execution |
176
+ | [LiteLLM](docs/integrations/litellm.md) | **Beta** | SDK callback and proxy OTLP paths, provider/model usage, reported cost, failures, routing metadata |
177
+ | [OpenRouter](docs/providers/openrouter.md) | **Beta** | OpenAI-compatible sync/async and streaming calls, selected provider, route attempts, authoritative cost |
178
+ | Generic provider calls | **Experimental** | Sync/async callable wrapper with explicit provider/model and observed result metadata |
179
+ | Standard OTLP/HTTP | **Supported** | Generic OpenTelemetry, OTel GenAI, and OpenInference evidence |
180
+
181
+ Witdem also normalizes retrieval, reranking, search, embeddings, OCR, tools, evaluations, image, audio, video, and extension operations without inferring vendors. See [AI operations and evaluations](docs/ai-operations.md).
182
+
183
+ See [`compatibility.json`](compatibility.json) for machine-readable version constraints and [Providers](docs/providers.md) for the difference between native, framework-observed, and generic support.
184
+
185
+ ## Providers
186
+
187
+ Witdem currently has verified paths for:
188
+
189
+ - [OpenAI](docs/providers/openai.md) and [Azure OpenAI](docs/providers/azure-openai.md)
190
+ - [Anthropic](docs/providers/anthropic.md), including Claude Agent SDK telemetry
191
+ - [DeepSeek](docs/providers/deepseek.md)
192
+ - [Mistral](docs/providers/mistral.md)
193
+ - [Amazon Bedrock](docs/providers/bedrock.md)
194
+ - [Google Vertex AI](docs/providers/vertex-ai.md)
195
+ - [Ollama](docs/providers/ollama.md)
196
+ - [Cohere](docs/providers/cohere.md) (structurally tested, not live-validated)
197
+ - [OpenRouter](docs/providers/openrouter.md), including selected upstream provider and fallback metadata
198
+ - Hugging Face inference through [smolagents](docs/integrations/smolagents.md) or [LiteLLM](docs/integrations/litellm.md)
199
+
200
+ OpenAI and Anthropic have dedicated SDK integrations. Haystack observes the generator actually used at each model boundary. The remaining provider examples use standard GenAI OpenTelemetry attributes or `witdem_sdk.integrations.generic`; this is explicit in every provider guide.
201
+
202
+ Cost is not assumed from a provider name. Witdem uses provider-reported money when present, or the versioned server catalog when provider, model, and token usage match a catalog entry. Unknown prices remain **Not measured** with a diagnostic reason.
203
+
204
+ ## Parallel and asynchronous execution
205
+
206
+ When sibling spans overlap, Witdem preserves the observed fan-out and fan-in rather than flattening them into a false sequence:
207
+
208
+ ```text
209
+ ┌─ semantic retriever ─┐
210
+ execution ───┤ ├─ answer
211
+ └─ keyword retriever ──┘
212
+ ```
213
+
214
+ The runnable [Haystack parallel pipeline](examples/haystack/pipeline/README.md) demonstrates this with two concurrent retrievers and an OpenAI answer component.
215
+
216
+ ## Self-hosting
217
+
218
+ NPX is the Docker-managed path; pipx is a genuinely native, Node-free and
219
+ Docker-free path. The npm package never runs a `postinstall` script.
220
+
221
+ | Service | Address | Purpose |
222
+ | --- | --- | --- |
223
+ | Dashboard | `http://localhost:8501` | Overview, runs, compare, workflows, and issues |
224
+ | Receiver | `http://localhost:4318` | OTLP/HTTP and SDK record ingestion |
225
+ | ELT worker | internal | Duckle transformation into dashboard-ready DuckDB tables |
226
+
227
+ ```bash
228
+ npx -y witdem@latest status
229
+ curl http://localhost:4318/readiness
230
+ curl http://localhost:8501/health
231
+ ```
232
+
233
+ See [Operations](docs/operations.md) for lifecycle, ports, logs, data,
234
+ backup/recovery, and [Development](docs/development.md) only when contributing
235
+ to Witdem itself.
236
+
237
+ ## Documentation
238
+
239
+ - [Getting started](docs/getting-started.md)
240
+ - [Running Witdem with npx](docs/npm-launcher.md)
241
+ - [Concepts: tracing and business meaning](docs/concepts.md)
242
+ - [Tutorial: defining a YAML contract](docs/contract-tutorial.md)
243
+ - [YAML configuration](docs/configuration.md)
244
+ - [Workflow definitions, compilation, and replay](docs/workflow-replay.md)
245
+ - [Haystack](docs/integrations/haystack.md)
246
+ - [LangGraph](docs/integrations/langgraph.md)
247
+ - [LangChain](docs/integrations/langchain.md)
248
+ - [Native/custom Python](docs/integrations/native-python.md)
249
+ - [OpenAI Agents](docs/integrations/openai-agents.md)
250
+ - [Anthropic and Claude Agent](docs/integrations/anthropic.md)
251
+ - [Provider support](docs/providers.md)
252
+ - [Pricing catalog and automated refresh](docs/pricing.md)
253
+ - [Dashboard](docs/dashboard.md)
254
+ - [Troubleshooting](docs/troubleshooting.md)
255
+ - [Examples](docs/examples.md)
256
+ - [Operations](docs/operations.md)
257
+ - [CLI reference](docs/cli-reference.md)
258
+ - [Upgrade and compatibility](docs/upgrade.md)
259
+ - [Architecture and data flow](docs/architecture.md)
260
+ - [Release notes](docs/changelog.md)
261
+ - [Performance and lifecycle implementation report](docs/implementation-report.md)
262
+ - [Development and contributing](docs/development.md)
263
+
264
+ ## Community
265
+
266
+ Witdem is built in the open. Bug reports, integration examples, documentation
267
+ improvements, and focused code contributions are welcome.
268
+
269
+ - Read [Contributing](CONTRIBUTING.md) before opening a pull request.
270
+ - Participate under the [Code of Conduct](CODE_OF_CONDUCT.md).
271
+ - Report vulnerabilities privately according to the [Security policy](SECURITY.md).
272
+
273
+ ## License
274
+
275
+ Witdem is licensed under the [Apache License 2.0](LICENSE).
276
+
277
+ ## Built with
278
+
279
+ <table>
280
+ <tr>
281
+ <td align="center" width="33%"><img src="docs/assets/duckdb.svg" alt="DuckDB" width="180"><br>Local analytics storage</td>
282
+ <td align="center" width="33%"><img src="docs/assets/duckle.png" alt="Duckle" width="105"><br>Raw-to-serving transformation</td>
283
+ <td align="center" width="33%"><img src="docs/assets/tanstack.svg" alt="TanStack" width="180"><br>Dashboard routing, queries, and tables</td>
284
+ </tr>
285
+ </table>
286
+
287
+ Witdem is independent of these projects. Their names and unmodified marks identify the technologies used and do not imply endorsement.