haive.agents.utils.trace ======================== .. py:module:: haive.agents.utils.trace .. autoapi-nested-parse:: Agent trace pretty-printer using Rich. Provides clean, readable output for any haive agent run, filtering out the noisy LangGraph checkpoint dumps and showing only meaningful content: messages, tool calls, tool results, and KG extractions. Usage: from haive.agents.utils.trace import run_traced, TracePrinter # Run any agent with pretty trace result = run_traced(agent, "What is 15 * 23?") # Save trace to file result = run_traced(agent, "Hello", save_to="traces/") Classes ------- .. autoapisummary:: haive.agents.utils.trace.TracePrinter Functions --------- .. autoapisummary:: haive.agents.utils.trace.run_traced Module Contents --------------- .. py:class:: TracePrinter(show_tokens = True, max_content_len = 500, show_tool_args = True) Pretty-prints agent execution traces. .. py:method:: print_kg_triples(store, user_id = 'default') Print KG triples from store. .. py:method:: print_result(result, title = 'Agent Trace') Print a formatted trace from an agent result. .. py:method:: print_store_summary(store, user_id = 'default') Print store contents summary. .. py:function:: run_traced(agent, input_data, title = None, save_to = None, **kwargs) Run any haive agent with pretty-printed trace output. Works with SimpleAgent, ReactAgent, MemoryAgent, MultiAgent, etc. :param agent: Any haive agent :param input_data: Input string or dict :param title: Optional title :param save_to: Optional directory to save trace JSON :param \*\*kwargs: Passed to agent.run()