Metadata-Version: 2.4
Name: botgauge
Version: 0.1.4
Summary: Trace AI agents in production, safely and privately, without slowing your app down. Built on OpenTelemetry.
Author-email: "BotGauge AI Inc." <support@botgauge.com>
License-Expression: FSL-1.1-ALv2
Project-URL: Homepage, https://www.botgauge.com/
Project-URL: Documentation, https://www.botgauge.com/docs/tracing/overview
Keywords: opentelemetry,otel,tracing,observability,llm,llm-observability,ai-agents,agents,langchain,openai,crewai,monitoring
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Framework :: OpenTelemetry
Classifier: Framework :: OpenTelemetry :: Distros
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: botgauge-cli==0.1.4
Requires-Dist: botgauge-tracing==0.1.4
Provides-Extra: openai
Requires-Dist: botgauge-tracing[openai]; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: botgauge-tracing[anthropic]; extra == "anthropic"
Provides-Extra: langchain
Requires-Dist: botgauge-tracing[langchain]; extra == "langchain"
Provides-Extra: langgraph
Requires-Dist: botgauge-tracing[langgraph]; extra == "langgraph"
Provides-Extra: crewai
Requires-Dist: botgauge-tracing[crewai]; extra == "crewai"
Provides-Extra: llamaindex
Requires-Dist: botgauge-tracing[llamaindex]; extra == "llamaindex"
Provides-Extra: google-adk
Requires-Dist: botgauge-tracing[google-adk]; extra == "google-adk"
Provides-Extra: openai-agents
Requires-Dist: botgauge-tracing[openai-agents]; extra == "openai-agents"
Provides-Extra: autogen-agentchat
Requires-Dist: botgauge-tracing[autogen-agentchat]; extra == "autogen-agentchat"
Provides-Extra: pydantic-ai
Requires-Dist: botgauge-tracing[pydantic-ai]; extra == "pydantic-ai"
Provides-Extra: mcp
Requires-Dist: botgauge-tracing[mcp]; extra == "mcp"
Provides-Extra: distributed
Requires-Dist: botgauge-tracing[distributed]; extra == "distributed"
Provides-Extra: frameworks
Requires-Dist: botgauge-tracing[frameworks]; extra == "frameworks"
Provides-Extra: all
Dynamic: license-file

<p align="center">
  <a href="https://www.botgauge.com/"><img src="https://www.botgauge.com/og_images/web-app-manifest-512x512.png" alt="BotGauge" width="96"></a>
</p>

<h1 align="center">BotGauge Python SDK</h1>

<p align="center">
  Trace AI agents in production, safely and privately, without slowing your application down.<br>
  Built on OpenTelemetry.
</p>

<p align="center">
  <a href="https://pypi.org/project/botgauge/"><img src="https://img.shields.io/pypi/v/botgauge?style=flat-square&label=pypi%20botgauge" alt="PyPI version"></a>
  <a href="https://pypi.org/project/botgauge/"><img src="https://img.shields.io/pypi/pyversions/botgauge?style=flat-square" alt="Python versions"></a>
  <img src="https://img.shields.io/badge/OpenTelemetry-native-425CC7?style=flat-square" alt="OpenTelemetry native">
  <img src="https://img.shields.io/badge/license-FSL--1.1--ALv2-blue?style=flat-square" alt="License: FSL-1.1-ALv2">
</p>

<p align="center">
  <a href="https://www.botgauge.com/docs/tracing/quickstart"><strong>Quickstart</strong></a> ·
  <a href="https://www.botgauge.com/docs/tracing/overview">Documentation</a> ·
  <a href="https://cloud.botgauge.com">Console</a>
</p>

BotGauge records what your agents do: every turn of a conversation, the agents involved, their LLM
calls with model and token counts, and their tool calls. You see it in the BotGauge console as
sessions you can search and inspect.

- **Two ways in.** Add a few lines to your code, or trace an existing app without changing it:
  `botgauge instrument python app.py`.
- **Private by default.** Common PII and credential formats (email addresses, phone numbers, card
  numbers, API keys, passwords) are masked before anything leaves your process. Images, audio and
  embeddings stay out unless you ask for them.
- **Never in your way.** Export runs on a background thread with bounded queues and timeouts. A slow
  or unreachable endpoint never blocks or crashes your app.
- **Standard OpenTelemetry.** It works alongside your existing OpenTelemetry setup and carries
  W3C trace context across services.

## Install

```bash
pip install botgauge          # the tracing SDK (Python library) and the `botgauge` command
botgauge setup --install      # adds tracing for the frameworks your app uses
```

`pip install botgauge` installs the tracing SDK (`from botgauge import tracing`) and the `botgauge`
command. On its own it records the turns, agents and spans your code creates. `botgauge setup
--install` finds the frameworks in your environment and installs the matching extra for each, such as
`botgauge[langchain]`, which records their LLM and tool calls; `botgauge setup --detect` lists them
without installing anything. You can also name an extra yourself, for example in `requirements.txt`.

## Quickstart

Create an API key in the [BotGauge console](https://cloud.botgauge.com) (it starts with `bg_`) and
set it for your app:

```bash
export BOTGAUGE_API_KEY="bg_..."
```

**Zero-code:** trace an existing app as it is. `botgauge instrument` turns on the tracing your
extras installed.

```bash
botgauge instrument python app.py
```

**In code:** start tracing, attach your framework's instrumentor, and wrap each turn of a conversation.

```python
from botgauge import tracing
from openinference.instrumentation.langchain import LangChainInstrumentor

provider = tracing.init()                            # reads BOTGAUGE_API_KEY
LangChainInstrumentor().instrument(tracer_provider=provider)

with tracing.turn(session_id="ses_123"), tracing.agent("support-agent"):
    ...                                              # your agent's LLM and tool calls

tracing.shutdown()                                   # sends what is left before the process exits
```

`botgauge doctor` checks your setup, and `botgauge probe` confirms that BotGauge accepts a trace. The
[quickstart](https://www.botgauge.com/docs/tracing/quickstart) walks through the whole first trace.

## Frameworks

| Framework | Extra | Instrumentor, in code |
|---|---|---|
| LangChain, LangGraph | `botgauge[langchain]`, `botgauge[langgraph]` | `LangChainInstrumentor` |
| OpenAI SDK | `botgauge[openai]` | `OpenAIInstrumentor` |
| Anthropic SDK | `botgauge[anthropic]` | `AnthropicInstrumentor` |
| LlamaIndex | `botgauge[llamaindex]` | `LlamaIndexInstrumentor` |
| CrewAI | `botgauge[crewai]` | `CrewAIInstrumentor` and `OpenAIInstrumentor` |
| OpenAI Agents | `botgauge[openai-agents]` | `OpenAIAgentsInstrumentor` |
| Google ADK | `botgauge[google-adk]` | `GoogleADKInstrumentor` |
| AutoGen AgentChat | `botgauge[autogen-agentchat]` | `AutogenAgentChatInstrumentor` |
| PydanticAI | `botgauge[pydantic-ai]` | PydanticAI instruments itself; see [its page](https://www.botgauge.com/docs/integrations/pydantic-ai) |
| MCP | `botgauge[mcp]` | `MCPInstrumentor` |
| HTTP and gRPC trace context across services | `botgauge[distributed]` | Zero-code only |

In code, import the instrumentor from `openinference.instrumentation.<framework>` and call
`.instrument(tracer_provider=provider)` on it after `provider = tracing.init()`. Zero-code does this
for every installed extra.

BotGauge verifies exact framework and instrumentor versions. Other versions are traced too, and
startup says when one isn't verified. [Supported frameworks](https://www.botgauge.com/docs/integrations/overview)
lists the verified versions and each framework's page. An app that is already instrumented, or a
framework not in the table, can still be traced in code: see the
[`botgauge-tracing`](https://pypi.org/project/botgauge-tracing/) page.

## Privacy

| Setting | Default | Options |
|---|---|---|
| `BOTGAUGE_CAPTURE` / `capture=` | `text`: prompts, responses and tool data, without media | `metadata` (model, tokens, timing only), `text`, `full` (adds images, audio and embeddings) |
| `BOTGAUGE_REDACTED` / `redacted=` | `true`: common PII and credential formats are masked | `false` exports original content without masking, in every capture mode: it overrides the capture setting |

Masking catches common formats, not every sensitive value: names, postal addresses and other
free-form personal data are exported as written. If your prompts carry such data, use
`capture="metadata"`. [Capture and redaction](https://www.botgauge.com/docs/tracing/capture-and-redaction)
explains each setting, and the [`botgauge-tracing`](https://pypi.org/project/botgauge-tracing/) page
lists what is masked. `OTEL_SDK_DISABLED=true` turns tracing off without code changes.

## Documentation

- [Quickstart](https://www.botgauge.com/docs/tracing/quickstart): your first trace in five minutes
- [Manual tracing](https://www.botgauge.com/docs/tracing/manual-tracing) and
  [zero-code instrumentation](https://www.botgauge.com/docs/tracing/zero-code)
- [Supported frameworks](https://www.botgauge.com/docs/integrations/overview) and
  [versions not verified](https://www.botgauge.com/docs/integrations/versions-not-verified)
- [Environment variables](https://www.botgauge.com/docs/reference/environment-variables) and the
  [CLI reference](https://www.botgauge.com/docs/reference/cli)
- [Troubleshooting](https://www.botgauge.com/docs/tracing/troubleshooting)

## Packages

| Package | What it is |
|---|---|
| `botgauge` | This meta-package. It installs the two below; its extras add framework instrumentation |
| [`botgauge-tracing`](https://pypi.org/project/botgauge-tracing/) | The tracing SDK, imported as `from botgauge import tracing`. Its page covers privacy, limits and production notes |
| [`botgauge-cli`](https://pypi.org/project/botgauge-cli/) | The `botgauge` command (alias `botg`): `instrument`, `doctor`, `probe`, `setup`, `help`, `version` |

All three release together with the same version. Python 3.10 or later; OpenTelemetry 1.40 or later.

## Links

- Website: [botgauge.com](https://www.botgauge.com/)
- Documentation: [botgauge.com/docs](https://www.botgauge.com/docs/tracing/overview)
- Console and API keys: [cloud.botgauge.com](https://cloud.botgauge.com)
- Support: [support@botgauge.com](mailto:support@botgauge.com)

## License

Functional Source License, Version 1.1, ALv2 Future License (`FSL-1.1-ALv2`). You may use, modify and
redistribute the software for any purpose other than a competing commercial product or service. Each
release becomes available under the Apache License 2.0 two years after it is published.
