Skip to main content

A terminal-based tree visualizer for AI agent traces.

Project description

🌳 agent-tree

The missing visualizer for AI Agents. Turn messy terminal logs into beautiful, interactive trees.

agent-tree is a zero-config, terminal-first observability tool. It captures the complex "reasoning loop" of AI agents and renders them as clean, hierarchical trees in your console. No API keys, no web dashboards, no fluff.

Why agent-tree?

📸 Why use agent-tree?

Without agent-tree (Messy JSON) With agent-tree (Clean Visualization)

🚀 Quick Start

1. Automatic (LangChain/LangGraph)

Just pass the TraceCallback into your agent's config. It automatically catches the end of the run and draws the tree.

from agent_tree import TraceCallback

# Your agent logic...
agent.invoke(
    {"messages": [("user", "Is 50 shares of Apple under $15,000?")]},
    config={"callbacks": [TraceCallback(session_name="Budget Check")]}
)

2. Manual (Post-Execution)

If you already have a result object, you can visualize it instantly.

from agent_tree import AgentTrace

at = AgentTrace(result_object)
at.show()

✨ Key Features

  • Instant Visuals: Built on top of the Rich library for high-performance terminal UI.
  • Root-Only Tracing: Smart logic prevents "log spam" by only showing the final, complete execution tree.
  • Framework Agnostic: Works perfectly with LangChain but can be adapted for any JSON-like agent output.

🛠 Installation

pip install agent-tree

Github Repository

You can find the full source code and contribute on GitHub.

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

agent_tree-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

agent_tree-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file agent_tree-0.1.1.tar.gz.

File metadata

  • Download URL: agent_tree-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agent_tree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78a745cfc200759e3792e79df2158381ff92b8b07ab514c9b9609e42dcd24fa2
MD5 8ebdde7ac6ee5760393469fa8e240bdb
BLAKE2b-256 c0cc181f3bcbe4a7b7fab59da56ebcc864e4b2105f00daa1499f544d0289b85c

See more details on using hashes here.

File details

Details for the file agent_tree-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agent_tree-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agent_tree-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 614bfacaf9d77cb2035f4a03f66ce1fdc37fd5a6f9fe3ec2f99a431abc1805f4
MD5 13b21473828b78c06f60f9987f8bd718
BLAKE2b-256 35e1ae559e94fe979b14a0f0508d3e34d3bbd7ffb4b7267d1e6c36fb102b0b49

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