{"data":{"slug":"amosjyng-langchain-visualizer","name":"langchain-visualizer","tagline":"Visualization and debugging tool for LangChain workflows","github_url":"https://github.com/amosjyng/langchain-visualizer","owner":"amosjyng","repo":"langchain-visualizer","owner_avatar_url":"https://avatars.githubusercontent.com/u/1863868?v=4","primary_language":"Python","stars":736,"forks":50,"topics":["langchain"],"archived":false,"github_pushed_at":"2024-03-06T02:59:14+00:00","maintenance_label":"Dormant","url":"https://www.graphcanon.com/tools/amosjyng-langchain-visualizer","markdown_url":"https://www.graphcanon.com/tools/amosjyng-langchain-visualizer.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/amosjyng-langchain-visualizer","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=amosjyng-langchain-visualizer","description":"Visualization and debugging tool for LangChain workflows","homepage_url":null,"license":"MIT","open_issues":11,"watchers":8,"ai_summary":null,"readme_excerpt":"# LangChain Visualizer\n\nAdapts [Ought's ICE visualizer](https://github.com/oughtinc/ice) for use with [LangChain](https://github.com/hwchase17/langchain) so that you can view LangChain interactions with a beautiful UI.\n\n\n\nYou can now\n\n- See the full prompt text being sent with every interaction with the LLM\n- Tell from the coloring which parts of the prompt are hardcoded and which parts are templated substitutions\n- Inspect the execution flow and observe when each function goes up the stack\n- See the costs of each LLM call, and of the entire run, if you are using OpenAI's `text-davinci-003` model\n\n## Quickstart\n\nInstall this library:\n\n```bash\npip install langchain-visualizer\n```\n\nNote that if you're on a Linux distribution, you may need to install libyaml first:\n\n```bash\napt install -y libyaml-dev\n```\n\nThen:\n\n1. Add `import langchain_visualizer` as **the first import** in your Python entrypoint file\n2. Write an async function to visualize whichever workflow you're running\n3. Call `langchain_visualizer.visualize` on that function\n\nFor an example, see below instructions on reproducing the screenshot.\n\n\n### Running the example screenshot\n\nTo run the example you see in the screenshot, first install this library and optional dependencies:\n\n```bash\npip install langchain-visualizer google-search-results openai\n```\n\nIf you haven't yet set up your [OpenAI API keys](https://openai.com/api/) or SERP API keys, you can [replay the recorded interactions](https://github.com/amosjyng/vcr-langchain) by cloning this repository and running\n\n```bash\n$ pip install vcr-langchain\n$ OPENAI_API_KEY=dummy python tests/agents/test_langchain_getting_started.py\n```\n\nIf you have set them up, you can run the following script (adapted from [LangChain docs](https://langchain.readthedocs.io/en/latest/modules/agents/getting_started.html)):\n\n```python\nimport langchain_visualizer\nimport asyncio\nfrom langchain.agents import initialize_agent, load_tools\nfrom langchain.llms import OpenAI\n\nllm = OpenAI(temperature=0.7)\ntools = load_tools([\"serpapi\", \"llm-math\"], llm=llm)\nagent = initialize_agent(tools, llm, agent=\"zero-shot-react-description\", verbose=True)\nasync def search_agent_demo():\n    return agent.run(\n        \"Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 \"\n        \"power?\"\n    )\n\nlangchain_visualizer.visualize(search_agent_demo)\n```\n\nA browser window will open up, and you can actually see the agent execute happen in real-time!\n\n### Jupyter notebook support\n\nJupyter notebooks are now supported! To use this inside a Jupyter notebook, **make sure to import the `visualize` function from `langchain_visualizer.jupyter` instead.**\n\nPlease look at [the demo notebook](/tests/demo.ipynb) to see an example of how it can be used in Jupyter.\n\n### Visualizing embeddings\n\nIf you want to also visualize documents being chunked up for embeddings, you can now do so by calling the `visualize_embeddings` function before you visualize the main chain:\n\n```python\nfrom langchain_visualizer import visualize, visualize_embeddings\n\nasync def run_chain():\n    ...\n\nvisualize_embeddings()\nvisualize(run_chain)\n```\n\n## Why not just use LangChain's built-in tracer?\n\nFor me personally:\n\n- I prefer the ICE UI. In particular:\n    - I like the colored highlighting of parts of the prompt that are filled-in template variables\n    - I like the ability to quickly inspect different LLM calls without leaving the trace page\n- I prefer the visualization of my agent logic to remain static when LLM calls are cached\n- I prefer seeing when the tool (e.g. `PythonREPL`) actually gets called, rather than just the high-level execution of the chain (e.g. `LLMMathChain`)\n\nThat being said, LangChain's tracer is definitely better supported. **Please note that there is a lot of langchain functionality that I haven't gotten around to hijacking for visualization.** If there's anything you need to show up in the execution trace, please open a PR or issue.\n\n## My other projects\n\nPlease chec","github_created_at":"2023-01-23T12:03:50+00:00","created_at":"2026-07-11T10:44:23.774214+00:00","updated_at":"2026-07-11T10:44:27.386124+00:00","categories":[{"slug":"vector-databases","name":"Vector Databases","url":"https://www.graphcanon.com/categories/vector-databases","markdown_url":"https://www.graphcanon.com/categories/vector-databases.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/vector-databases"},{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"slug":"ai-agents","name":"AI Agents","url":"https://www.graphcanon.com/categories/ai-agents","markdown_url":"https://www.graphcanon.com/categories/ai-agents.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/ai-agents"}],"tags":[{"slug":"python","name":"python"},{"slug":"langchain","name":"langchain"}],"trust":{"provenance":{"is_fork":false,"github_id":592287689,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-11T10:44:24.637Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":857,"last_release_at":null},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T10:44:25.443Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-07-11T10:44:25.054Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-07-11T10:44:25.054Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-07-11T10:44:25.054Z"}}}}