Metadata-Version: 2.4
Name: polytrax
Version: 0.1.0
Summary: Communication-level observability framework for trust integrity in multi-agent systems
Author: Mindula Jayasinghe
License-Expression: MIT
Project-URL: Homepage, https://github.com/Mindulaaa/polytrax
Project-URL: Documentation, https://github.com/Mindulaaa/polytrax/tree/main/docs
Project-URL: Repository, https://github.com/Mindulaaa/polytrax
Project-URL: Issues, https://github.com/Mindulaaa/polytrax/issues
Keywords: multi-agent,ai,observability,trust,evaluation,langgraph
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.2.0; extra == "langgraph"
Provides-Extra: semantic
Requires-Dist: numpy>=1.24; extra == "semantic"
Requires-Dist: sentence-transformers>=2.2.2; extra == "semantic"
Provides-Extra: full
Requires-Dist: langgraph>=0.2.0; extra == "full"
Requires-Dist: numpy>=1.24; extra == "full"
Requires-Dist: openai>=1.0.0; extra == "full"
Requires-Dist: sentence-transformers>=2.2.2; extra == "full"
Dynamic: license-file

# PolyTrax

PolyTrax is a Python library for communication-level observability, runtime trust control, and post-run analysis in multi-agent systems.

It provides:

- Universal Structured Log (USL) schema and validation
- Event instrumentation utilities and sinks
- Runtime Trust Perturbation Score (R-TPS) monitoring and intervention policies
- Offline propagation and containment analysis
- Evaluation tooling (deterministic and LLM-based judges)

## Install

Core library:

```bash
pip install polytrax
```

With optional integrations:

```bash
pip install "polytrax[openai]"      # LLM judge via OpenAI-compatible APIs
pip install "polytrax[langgraph]"   # LangGraph adapter
pip install "polytrax[semantic]"    # Semantic drift/localization extras
pip install "polytrax[full]"        # All optional dependencies
```

## Quick Example

```python
from polytrax.instrumentation import Instrumentor, EventBuilder
from polytrax.sinks import MemorySink

sink = MemorySink()
instr = Instrumentor(run_id="demo_run", sinks=[sink])
builder = EventBuilder(run_id="demo_run")

event = (
    builder
    .with_sender("collector_1")
    .with_receiver("analyst_1")
    .with_payload({"message": "hello"})
    .build()
)

instr.emit(event)
print(len(sink.events))
```

## CLI

Evaluation runner:

```bash
polytrax-eval --runs-dir ./runs --output-filename eval.json
```

## Project Layout

- Publishable library package: `polytrax/src/polytrax`
- Demo frontend/backend app (not packaged): `apps/polytrax_demo`
- Evaluation protocols and scripts: `evaluation`

## License

MIT
