haive.agents.utils.trace¶
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¶
Pretty-prints agent execution traces. |
Functions¶
|
Run any haive agent with pretty-printed trace output. |
Module Contents¶
- class haive.agents.utils.trace.TracePrinter(show_tokens=True, max_content_len=500, show_tool_args=True)¶
Pretty-prints agent execution traces.
- print_kg_triples(store, user_id='default')¶
Print KG triples from store.
- Parameters:
store (Any)
user_id (str)
- Return type:
None
- haive.agents.utils.trace.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.