Skip to main content

smartcomment: A General-Purpose Execution Graph Tracing Package.

Project description

smartcomment

smartcomment is a lightweight Python tracing toolkit for recording execution graphs from existing systems. It lets developers annotate variables, operations, and dependencies without reorganizing the original program.

The package is designed for systems that maintain complex state over time, such as multi-agent systems, memory systems, and data workflows. Instead of only recording events or function calls, smartcomment records how variables flow through developer-specified operations, making the resulting trace useful for visualization, program understanding, and failure attribution.

Installation

Install the core package:

pip install smartcomment

Install optional visualization dependencies:

pip install smartcomment[viz]

For local development from source:

git clone https://github.com/zjunlp/smartcomment.git
cd smartcomment
pip install -e .

Quick Example

from smartcomment import comment_fn, comment_graph


@comment_fn(
    op_name="demo.generate",
    comment="Generate a response from a user query.",
    category="generation",
)
def generate_response(query: str) -> str:
    return "smartcomment records execution graphs."


with comment_graph() as graph:
    response = generate_response("What does smartcomment do?")

print(graph.to_runtime_graph().to_markdown())

Documentation

The repository includes a set of focused guides under docs/.

Citation

If you use smartcomment in your work, please cite:

@misc{deng2026memtracetracingattributingerrors,
      title={MemTrace: Tracing and Attributing Errors in Large Language Model Memory Systems}, 
      author={Xinle Deng and Ruobin Zhong and Hujin Peng and Xiaoben Lu and Yanzhe Wu and Guang Li and Buqiang Xu and Yunzhi Yao and Jizhan Fang and Haoliang Cao and Junjie Guo and Yuan Yuan and Ziqing Ma and Yuanqiang Yu and Rui Hu and Baohua Dong and Hangcheng Zhu and Ningyu Zhang},
      year={2026},
      eprint={2605.28732},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2605.28732}, 
}

License

This project is released under the MIT License.

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

smartcomment-0.1.2.tar.gz (83.0 kB view details)

Uploaded Source

Built Distribution

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

smartcomment-0.1.2-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

File details

Details for the file smartcomment-0.1.2.tar.gz.

File metadata

  • Download URL: smartcomment-0.1.2.tar.gz
  • Upload date:
  • Size: 83.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for smartcomment-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3d745c06f849eccf759d895cbb295249b637ba8b86cbbe1df12fd0f18f751f08
MD5 449441c48a4295915a26d33792b24cc0
BLAKE2b-256 0a56a101bfd9648f309e20145ef80110b9d0d77d14a3b3aca53fdd6b3b0816ba

See more details on using hashes here.

File details

Details for the file smartcomment-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: smartcomment-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for smartcomment-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4585d83477d20074b8f4759c5a00f38c9475816ec34649ca6315625a4c095761
MD5 aae4892e8784cb128c7221d0be09a7ba
BLAKE2b-256 58b7d5cb57f675273313251684bea889aad53d300769e8eafc5ec48158a7270b

See more details on using hashes here.

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