Skip to main content

LLM Reasoning Tracer

A modular tracing and explainability toolkit for LangChain agents. Capture step-by-step tool usage, visualize the reasoning process, and analyze how your agent chains behave.

Features

  • Traces agent steps (inputs, tool used, outputs)
  • Visualizes tool usage and outcomes
  • Includes dashboards for Streamlit and Matplotlib
  • Supports RAG, search chains, math pipelines, and multi-tool agents

Installation

pip install .

Setup

Create a .env file:

OPENAI_API_KEY=your-key-here

Trace Examples

Run one of the provided pipelines:

python examples/use_with_langchain_agent.py
python examples/math_chain_example.py
python examples/multi_agent_chain_example.py
python examples/rag_pipeline_example.py

Create RAG DB

python examples/create_db.py

It loads data/solar_energy_notes.txt and builds db/ for retrieval.

View Your Trace

  1. Streamlit Dashboard
streamlit run examples/streamlit_viewer.py
  1. Timeline Plot (if added)
python examples/visualize_trace.py

Output Example (trace_math.json)

{
  "step_1": {
    "input": "What's 15% tip for $80 dinner, and add it to the bill?",
    "tool_used": "Tip Calculator",
    "output": "Tip is $12.0"
  },
  "step_2": {
    "input": "Add 80 + 12.0",
    "tool_used": "Total Calculator",
    "output": "The total bill including tip is $92.0"
  }
}

Structure

  • cognitive_tracer/ — the Python module
  • examples/ — usage scripts
  • traces/ — generated trace files
  • data/ — text input for vector DB

Dependencies

langchain
langchain-openai
langchain-community
openai
streamlit
matplotlib
python-dotenv

License

MIT © Nisaharan Genhatharan

Metadata

Release files for llm-reasoning-tracer 0.1.0

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

Source distribution (sdist)

Source distribution for llm-reasoning-tracer 0.1.0
File Size Uploaded
llm_reasoning_tracer-0.1.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-reasoning-tracer 0.1.0
File Interpreter ABI Platform
llm_reasoning_tracer-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / llm_reasoning_tracer-0.1.0.tar.gz

Download URL llm_reasoning_tracer-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f26ac6896464d51aac022b2ea6be8f20833146769059ff2625147302f6edd1
BLAKE2b-256 checksum
How to use checksums
8f188766c57c9551561a2005b28459d65d8f76a1beaa0afdb992771dddc5cf74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release files / llm_reasoning_tracer-0.1.0-py3-none-any.whl

Download URL llm_reasoning_tracer-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac40582dbe42d8a615c9b84a8ce8f41c1b78293c24224cd6ad2914185bfd2ea3
BLAKE2b-256 checksum
How to use checksums
b4ee07184d2371bde0559ada07ded589f316e863ab123adbecc400d6badb8064
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

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