Skip to main content

Framework-agnostic reasoning trace visualization tool for AI agents.

Project description

agentvis

agentvis logo

agentvis visualizes an agent’s reasoning trace, giving you clear insight into why the agent chose a particular path or triggered a specific tool call.

By exposing the influence flow behind each decision, it transforms opaque agent behavior into something understandable and actionable — so you can confidently refine and improve your prompts, which is often the hardest part of building reliable agents. 🧠✨

agentvis reasoning visualization example

flow_diagram

Installation

Install core:

pip install agentvis

With LangChain support:

pip install agentvis[langchain]

How to generate an agent reasoning graph

1. Define your LangChain / LangGraph agent

from langchain_tavily import TavilySearch
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.agents import create_agent
from langchain.messages import HumanMessage
import os

os.environ["TAVILY_API_KEY"] = "<your-tavily-api-key>"

tavily_search = TavilySearch(
    max_results=5,
    search_depth="basic",
)

llm = ChatGoogleGenerativeAI(
    model="gemini-2.5-flash-lite",
    temperature=0.7,
    google_api_key="<your-google-api-key>",
)

agent = create_agent(
    llm,
    [tavily_search],
    system_prompt=(
        "You are a helpful web search agent. "
        "Use the Tavily tool when you need fresh information from the web."
    ),
)

result = agent.invoke(
    {"messages": [HumanMessage("Top warm countries and weather of each.")]}
)
messages = result["messages"]

2. Build the reasoning graph with agentvis and get a shareable link in exchange of messages produced by agent

from agentvis.framework.langchain import LangChainAdapter
from agentvis.core.export import ExportFactory
from agentvis.core import AgentVis

graph = AgentVis.build_agent_graph(messages=LangChainAdapter().convert(messages))
link = ExportFactory.export_graph(graph=graph, export_strategy="link")  # export_strategy = "link" | "json"
print(link)

Open the printed link in your browser to inspect the full reasoning trace of your agent.

License

This project is licensed under the Apache License 2.0.

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

agentvis-0.1.3.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

agentvis-0.1.3-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file agentvis-0.1.3.tar.gz.

File metadata

  • Download URL: agentvis-0.1.3.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for agentvis-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cec26b627578841fe3eac0d546422f3fcdaf035b57ad905d563d6b298463fc52
MD5 cca0d81d356079cdc395674e8f081dbd
BLAKE2b-256 0c0533a2d31d040f1f6b05b9f64f0505ca269da0c829ceb1dff116f10ff62130

See more details on using hashes here.

File details

Details for the file agentvis-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: agentvis-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for agentvis-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 48ec9abedce76c9c304a4e2ba0d2c161c8a70485d5ec5de5891f0fbd1d86f350
MD5 b34e54f4012ce6004d9adb169510ef83
BLAKE2b-256 bcc08675e2e8abbcb1261aee780dc495faab363f63890e9f616fa90c7c804cee

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