Skip to main content

TraceMind smart agent runtime and tooling

Project description

PyPI

TraceMind

TraceMind – A lightweight, event-sourced smart agent framework. It records and reflects every transaction, supports pipeline-based field analysis, static flow export, and interactive summaries/diagnosis/plans. Designed with a clean DDD structure, minimal dependencies, and safe container execution.


Agent Evolution Timeline ───────────────────────────────────────────── (1) Client + Server (2) Digital Twin (3) Autonomous Agent ─────────────── ─────────────── ──────────────────── • Proxy / Adapter • Mirror of entity • Observer • Sip, Websocket • Present + feedback • Executor • Hide protocol • IoT, Telecom • Collaborator complexity • State visualization • AI-driven autonomy • Simulation / feedback • Coordination in MAS

Value: simplify access Value: insight + control Value: autonomy + learning


✨ Features

  • Event Sourcing Core: append-only event store powered by the Binary Segment Log (tm/storage/binlog.py). JSONL and SQLite remain optional adapters planned for future expansion.

  • DDD Structure: clear separation of domain, application, and infrastructure layers.

  • Pipeline Engine: field-driven processing (Plan → Rule → Step), statically analyzable.

  • Tracing & Reflection: every step produces auditable spans.

  • Smart Layer:

    • Summarize: human-readable summaries of recent events.
    • Diagnose: heuristic anomaly detection with suggested actions.
    • Plan: goal → steps → optional execution.
    • Reflect: postmortem reports and threshold recommendations.
  • Visualization:

    • Static: export DOT/JSON diagrams of flows.
    • Dynamic: SSE dashboard with live DAG and insights panel.
  • Protocols:

    • MCP (Model Context Protocol) integration (JSON-RPC 2.0) – see the latest specification and the community GitHub org. Example flow recipe:
      from tm.recipes.mcp_flows import mcp_tool_call
      
      spec = mcp_tool_call("files", "list", ["path"])
      runtime.register(_SpecFlow(spec))
      
  • Interfaces:

    • REST API: /api/commands/*, /api/query/*, /agent/chat.
    • Metrics: /metrics (Prometheus format).
    • Health checks: /healthz, /readyz.

📂 Architecture (ASCII Overview)

                +----------------+
                |   REST / CLI   |
                +----------------+
                         |
                    [Commands]
                         v
                +----------------+
                |  App Service   |
                +----------------+
                         |
                  +------+------+
                  |             |
             [Event Store]   [Event Bus]
                  |             |
          +-------+        +----+-----------------+
          |                |                      |
     [Projections]   [Pipeline Engine]      [Smart Layer]
                          |              (Summarize/Diagnose/Plan/Reflect)
                          v
                      [Trace Store]

📚 Documentation

Scale & Reliability

Safety & Governance


🚀 Quick Start

Requirements

  • Python 3.11+
  • Standard library only (no third-party dependencies by default)

Run in development

# clone
git clone https://github.com/<your-username>/trace-mind.git
cd trace-mind

# install and scaffold a demo project
pip install -e .
tm init demo
cd demo

# execute the sample flow
tm run flows/hello.yaml -i '{"name":"world"}'

Run in container

docker build -t trace-mind ./docker

docker run --rm -it \
  --read-only \
  -v $(pwd)/data:/data \
  -p 8080:8080 \
  trace-mind

Scale & Reliability demo

See the Scale & Reliability guide for full context. The commands below can be pasted into a shell to exercise the worker pool, queue stats, and DLQ tooling.

# Start workers
TM_LOG=info tm workers start -n 4 --queue file --lease-ms 30000 &

# Enqueue 1000 CPU-light tasks
for i in {1..1000}; do tm enqueue flows/hello.yaml -i '{"name":"w'$i'"}'; done

# Live queue stats
tm queue stats

# Retry/DLQ demo — simulate failures by input flag/env within your step
export FAIL_RATE=0.05
# (run some tasks…)

tm dlq ls | head        # Inspect
# Requeue a subset by id/prefix/predicate (implementation-specific)
tm dlq requeue <task-id>

# Graceful drain
tm workers stop

🧩 Roadmap

  • More connectors (file bridge, http bridge, kafka bridge)
  • Richer dashboard with interactive actions
  • Adaptive thresholds in Reflector
  • Optional LLM integration for natural summaries

📜 License

MIT (for personal and experimental use)

Quickstart: tm init demo --template minimal cd demo && tm run flows/hello.yaml -i '{"name":"world"}' More details: docs/quickstart.md

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

trace_mind-1.0.0.tar.gz (147.7 kB view details)

Uploaded Source

Built Distribution

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

trace_mind-1.0.0-py3-none-any.whl (191.6 kB view details)

Uploaded Python 3

File details

Details for the file trace_mind-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for trace_mind-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0039cf4fb6f449d287e10ad977f3864305d6468f25182813c6f43a37c2b0aea9
MD5 4fc1c76e2b1e43340d6abf09d93762a6
BLAKE2b-256 e3c69150756bc2bc5aa574a11179e2af7aa625c9a87ee24ab99278a5aff8c088

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace_mind-1.0.0.tar.gz:

Publisher: release.yml on RaphaelYu/TraceMind

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

File details

Details for the file trace_mind-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for trace_mind-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a90dfa8e62d07b7238b4f2c4aeaaf98b1d28810bf85665568aa085987f46665f
MD5 13e523e2631eff7abd566b5ac08cd0c0
BLAKE2b-256 07d517c47267f745d713930f1db0c3d187de4249c7f980c621a6c3b96fd00391

See more details on using hashes here.

Provenance

The following attestation bundles were made for trace_mind-1.0.0-py3-none-any.whl:

Publisher: release.yml on RaphaelYu/TraceMind

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