Skip to main content

Measure AI-to-AI influence in multi-agent systems

Project description

TraceIQ

Measure AI-to-AI influence in multi-agent systems.

PyPI version Python versions License


Quickstart

from traceiq import InfluenceTracker

tracker = InfluenceTracker(use_mock_embedder=True)

result = tracker.track_event(
    sender_id="agent_a",
    receiver_id="agent_b",
    sender_content="We should switch to renewable energy.",
    receiver_content="Good point. Renewables are the future.",
)

print(f"Drift: {result['drift_l2_state']}")
print(f"IQx: {result['IQx']}")
print(f"Alert: {result['alert']}")

tracker.close()

What TraceIQ Is

  • Tracks how AI agent outputs change after receiving messages from other agents
  • Computes influence metrics based on semantic embedding similarity
  • Provides anomaly detection via Z-score thresholds
  • Builds influence graphs for network-level analysis
  • Includes reproducible research experiments

What TraceIQ Is NOT

  • Not causal inference: Metrics show correlation, not proven causation
  • Not intent detection: Cannot determine if influence is intentional
  • Not content analysis: Measures embedding similarity, not semantic meaning
  • Not internal state tracking: Only observes agent outputs, not cognition
  • Not a security solution: Research tool, not production security system
  • Thresholds require calibration: Default values need tuning per environment

Installation

# Core (lightweight, no ML dependencies)
pip install traceiq

# With sentence-transformers for real embeddings
pip install "traceiq[embedding]"

# With pandas/scipy/matplotlib for research
pip install "traceiq[research]"

Example Results

These plots are generated by the included experiments (experiments/plot_all.py):

Experiment 1: Wrong Hint Detection

Compares solver accuracy and TraceIQ alerts across baseline, correct hint, and wrong hint conditions.

Experiment 1 Accuracy

Experiment 2: Propagation Risk Over Time

Tracks spectral radius as influence spreads through a chain of agents.

Experiment 2 PR

Experiment 3: Mitigation Effectiveness

Compares accuracy with and without a mitigation guard that quarantines suspicious interactions.

Experiment 3 Mitigation


Integration Patterns

TraceIQ works with various agent architectures. See docs/integration.md for templates:

Pattern Description
LLM-only Basic tracking of message/response pairs
RAG Include retrieved chunks in receiver_input_view
Tool-using Log tool outputs for context
Memory agents Track before/after memory state
Multi-agent orchestrator Full conversation flow tracking

Research Context

TraceIQ is developed for research on AI-to-AI influence in multi-agent systems. The metrics (IQx, RWI, Z-score, Propagation Risk) are project-defined research metrics documented in this repository. They are not externally standardized. Mathematical foundations and proofs are in docs/THEORY.md.


Documentation

Document Description
docs/metrics.md Metric definitions and formulas
docs/integration.md Integration patterns
docs/cli.md CLI reference
docs/configuration.md TrackerConfig options
docs/architecture.md System architecture
docs/THEORY.md Mathematical foundations
experiments/README.md Research testbed

CLI help: traceiq --help

PyPI: pypi.org/project/traceiq


Usage Assumptions

For reliable metrics:

  • Log receiver context: For RAG/tools, provide receiver_input_view
  • Check validity before alerting: Use result["valid"] to avoid cold-start noise
  • Calibrate thresholds: Default values (Z > 2.0, etc.) need tuning per environment
  • Interpret PR carefully: Propagation Risk is a relative indicator; establish baseline values for your system

Releasing TraceIQ

To release a new version:

  1. Update version in pyproject.toml
  2. Commit the change:
    git add pyproject.toml
    git commit -m "chore: bump version to X.Y.Z"
    
  3. Create and push the tag:
    git tag vX.Y.Z
    git push origin vX.Y.Z
    
  4. GitHub Actions automatically:
    • Runs full test suite
    • Builds the package
    • Publishes to PyPI
    • Creates GitHub Release

For release candidates, use tags like v0.4.0rc1 (published to TestPyPI).


License

MIT License - see LICENSE for details.

Contributing

Contributions welcome. See CONTRIBUTING.md or:

  1. Fork the repository
  2. Create a feature branch
  3. Run tests (pytest) and linter (ruff check src/ tests/)
  4. Submit a Pull Request

Citation

@software{traceiq,
  title = {TraceIQ: Measure AI-to-AI Influence in Multi-Agent Systems},
  year = {2026},
  url = {https://github.com/Anarv2104/TraceIQ}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceiq-0.5.1.tar.gz (211.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceiq-0.5.1-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file traceiq-0.5.1.tar.gz.

File metadata

  • Download URL: traceiq-0.5.1.tar.gz
  • Upload date:
  • Size: 211.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for traceiq-0.5.1.tar.gz
Algorithm Hash digest
SHA256 9198ef6905fe6fc2256437734f069a4ac1fc61f1ddac93b695bbe9ed8b9c417a
MD5 87d80357b063a8a97ae01ce7ff687aac
BLAKE2b-256 97d84ce17c20bf7ee16eebb481bf301112dd5857dc25bf6265cee415a31fae98

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceiq-0.5.1.tar.gz:

Publisher: publish.yml on Anarv2104/TraceIQ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file traceiq-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: traceiq-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for traceiq-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60351aefdc74474d09db9f891f1c52654016679745316d1fc5a19f5004ea9bc8
MD5 0f6718b041d79a5aee6fcb7af311f74a
BLAKE2b-256 9eb7094c2e73a45249f3dbc2afe7a9d3d7c655fd1474ef86e5214f97dc7f9774

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceiq-0.5.1-py3-none-any.whl:

Publisher: publish.yml on Anarv2104/TraceIQ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page