Metadata-Version: 2.4
Name: traceagent
Version: 0.1.1
Summary: TraceAgent — Local-first AI agent observability SDK. Trace LangChain, LangGraph, and any Python code. Open-source alternative to LangSmith.
Project-URL: Homepage, https://github.com/ashishgituser/agentlens
Project-URL: Documentation, https://github.com/ashishgituser/agentlens#readme
Project-URL: Repository, https://github.com/ashishgituser/agentlens
Project-URL: Issues, https://github.com/ashishgituser/agentlens/issues
Author: TraceAgent Contributors
License: MIT
Keywords: agents,ai,debugging,langchain,langgraph,llm,observability,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.9
Requires-Dist: pydantic>=2.0
Provides-Extra: all
Requires-Dist: langchain-core>=0.1.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: httpx>=0.24; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == 'langchain'
Description-Content-Type: text/markdown

# TraceAgent

**Local-first observability for AI agents.** Open-source alternative to LangSmith. Trace LangChain, LangGraph, and any Python code with zero config.

## Install

```bash
pip install traceagent
```

## Quick Start

### Option 1: Environment Variables (zero code changes, like LangSmith)

```bash
export TraceAgent_ENABLED=true
export TraceAgent_ENDPOINT=http://localhost:6832   # your TraceAgent server
```

```python
import traceagent  # auto-traces all LangChain/LangGraph calls

result = graph.invoke({"messages": [HumanMessage(content="Hello!")]})
# traces appear at http://localhost:6832
```

### Option 2: Explicit Callback

```python
from traceagent import TraceAgent

lens = TraceAgent(server_url="http://localhost:6832")

result = graph.invoke(
    {"messages": [HumanMessage(content="Hello!")]},
    config={"callbacks": [lens.callback()]}
)
```

### Option 3: Decorators & Context Managers

```python
from traceagent import TraceAgent

lens = TraceAgent()

@lens.observe(name="search", kind="tool")
def search(query: str):
    return results

with lens.trace("My Pipeline") as t:
    result = search("hello")
    t.outputs = {"result": result}
```

## Configuration

| Env Variable | Description | Default |
|---|---|---|
| `TraceAgent_ENABLED` | Enable tracing | `false` |
| `TraceAgent_ENDPOINT` | Server URL | `http://localhost:6832` |
| `TraceAgent_PROJECT` | Project name | `default` |
| `TraceAgent_TAGS` | Comma-separated tags | |
| `TraceAgent_AUTO_TRACE` | Auto-attach to LangChain | `true` when enabled |

## Server

The SDK sends traces to a TraceAgent server. Run it with Docker:

```bash
docker run -d -p 6832:6832 ashishgituser/TraceAgent-server:latest
```

Then open **http://localhost:6832** for the dashboard.

See the full project at [github.com/ashishgituser/TraceAgent](https://github.com/ashishgituser/TraceAgent).
