My AI agent was working… but I had no idea why it worked som... by Taimoor KhanMy AI agent was working… but I had no idea why it worked som... by Taimoor Khan
My AI agent was working… but I had no idea why it worked som...
My AI agent was working… but I had no idea why it worked sometimes and completely fell apart other times. That’s when I plugged in LangSmith , and realized I’d been flying blind.
Suddenly, my “agentic AI” wasn’t a black box anymore, I could see everything:
Every tool call, LLM invocation and retry the agent made, also token burned & cached, state transition across agent steps
What surprised me most wasn’t the bugs , it was the waste. One trace showed my system prompt alone was 6.5k tokens. Not because it needed to be… but because I never saw it before.
So I fixed it.
Refactored prompts -> 1.5k tokens, same output quality
Switched to dynamic system prompts, injected only when complexity demanded it
Lesson learned: If you’re building agentic systems without observability
Like this project
Posted Dec 17, 2025
My AI agent was working… but I had no idea why it worked sometimes and completely fell apart other times. That’s when I plugged in LangSmith , and realized I...