Skip to main content

🌳 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.

Release files for agent-tree 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-tree 0.1.1
File Size Uploaded
agent_tree-0.1.1.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-tree 0.1.1
File Interpreter ABI Platform
agent_tree-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / agent_tree-0.1.1.tar.gz

Download URL agent_tree-0.1.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
78a745cfc200759e3792e79df2158381ff92b8b07ab514c9b9609e42dcd24fa2
BLAKE2b-256 checksum
How to use checksums
c0cc181f3bcbe4a7b7fab59da56ebcc864e4b2105f00daa1499f544d0289b85c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / agent_tree-0.1.1-py3-none-any.whl

Download URL agent_tree-0.1.1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
614bfacaf9d77cb2035f4a03f66ce1fdc37fd5a6f9fe3ec2f99a431abc1805f4
BLAKE2b-256 checksum
How to use checksums
35e1ae559e94fe979b14a0f0508d3e34d3bbd7ffb4b7267d1e6c36fb102b0b49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page