DEV Community

Mukunda Rao Katta profile picture

Mukunda Rao Katta

AI/ML Engineer building open-source tools for reliable AI agents.

Context window exceeded at turn 23. Here's how I track token usage without a tokenizer.

Hermes Agent Challenge Submission: Write About Hermes Agent

Context window exceeded at turn 23. Here's how I track token usage without a tokenizer.

1
Comments
1 min read

Want to connect with Mukunda Rao Katta?

Create an account to connect with Mukunda Rao Katta. You can also sign in below to proceed if you already have an account.

Already have an account? Sign in
My Hermes agent spent $3 before I noticed. Now it can't.

Hermes Agent Challenge Submission: Write About Hermes Agent

My Hermes agent spent $3 before I noticed. Now it can't.

Comments
2 min read
My Hermes agent's stop condition was a 40-line if/elif chain. I replaced it with 3 lines.

Hermes Agent Challenge Submission: Write About Hermes Agent

My Hermes agent's stop condition was a 40-line if/elif chain. I replaced it with 3 lines.

Comments
2 min read
My agent kept hitting context limits. This one function fixed it.

Hermes Agent Challenge Submission: Write About Hermes Agent

My agent kept hitting context limits. This one function fixed it.

Comments
2 min read
Your Hermes agent's audit log is leaking customer emails. Here's a 100-line lib that fixes that.

Hermes Agent Challenge Submission: Write About Hermes Agent

Your Hermes agent's audit log is leaking customer emails. Here's a 100-line lib that fixes that.

1
Comments 1
4 min read
My agent kept forgetting what it was doing. A scratchpad fixed it.

Hermes Agent Challenge Submission: Build With Hermes Agent

My agent kept forgetting what it was doing. A scratchpad fixed it.

Comments
2 min read
I replaced 200 lines of ad-hoc state management in my Hermes agent with one object.

Hermes Agent Challenge Submission: Build With Hermes Agent

I replaced 200 lines of ad-hoc state management in my Hermes agent with one object.

Comments
2 min read
The two-line Hermes agent logger I wish existed a month ago

Hermes Agent Challenge Submission: Write About Hermes Agent

The two-line Hermes agent logger I wish existed a month ago

Comments
3 min read
My Hermes agent called exec_shell. It shouldn't have been able to.

Hermes Agent Challenge Submission: Build With Hermes Agent

My Hermes agent called exec_shell. It shouldn't have been able to.

Comments
2 min read
My Hermes agent ran 500 turns and cost $40 before I noticed. Now it can't.

Hermes Agent Challenge Submission: Build With Hermes Agent

My Hermes agent ran 500 turns and cost $40 before I noticed. Now it can't.

Comments
2 min read
My Hermes agent loop blew the context window at turn 47. llm-context-trim fixed it.

Hermes Agent Challenge Submission: Build With Hermes Agent

My Hermes agent loop blew the context window at turn 47. llm-context-trim fixed it.

Comments
3 min read
Building LLM message lists by hand is error-prone. There's a better way.

Hermes Agent Challenge Submission: Write About Hermes Agent

Building LLM message lists by hand is error-prone. There's a better way.

Comments
2 min read
My Hermes agent kept returning JSON in a markdown code block. I kept writing the same regex. Then I stopped.

Hermes Agent Challenge Submission: Build With Hermes Agent

My Hermes agent kept returning JSON in a markdown code block. I kept writing the same regex. Then I stopped.

Comments
2 min read
Claude's extended thinking is useful. Sending raw <thinking> tags to users is not.

Hermes Agent Challenge Submission: Build With Hermes Agent

Claude's extended thinking is useful. Sending raw <thinking> tags to users is not.

Comments
2 min read
I changed one line in my Hermes system prompt. prompt-diff showed me exactly what.

Hermes Agent Challenge Submission: Write About Hermes Agent

I changed one line in my Hermes system prompt. prompt-diff showed me exactly what.

Comments
3 min read
Your Hermes agent's prompt cache is 30% hit because of one timestamp. Here's how to find it.

Hermes Agent Challenge Submission: Write About Hermes Agent

Your Hermes agent's prompt cache is 30% hit because of one timestamp. Here's how to find it.

Comments
4 min read
My agent started lying. It took me two days to realize the system prompt had changed.

Hermes Agent Challenge Submission: Write About Hermes Agent

My agent started lying. It took me two days to realize the system prompt had changed.

Comments
3 min read
I changed my Hermes agent's system prompt and used tool-call-diff to prove it actually helped

Hermes Agent Challenge Submission: Write About Hermes Agent

I changed my Hermes agent's system prompt and used tool-call-diff to prove it actually helped

Comments
4 min read
I couldn't reproduce the bug because I had no record of what tool calls my Hermes agent made.

Hermes Agent Challenge Submission: Build With Hermes Agent

I couldn't reproduce the bug because I had no record of what tool calls my Hermes agent made.

Comments
2 min read
My agent called web_search 47 times in 10 seconds. One class stopped it.

Hermes Agent Challenge Submission: Write About Hermes Agent

My agent called web_search 47 times in 10 seconds. One class stopped it.

1
Comments
2 min read
One Hermes tool call took 4.8 seconds. The others averaged 900ms. trace-anomaly found it.

Hermes Agent Challenge Submission: Build With Hermes Agent

One Hermes tool call took 4.8 seconds. The others averaged 900ms. trace-anomaly found it.

Comments
3 min read
My Hermes agent ran for 2 hours, hit a timeout at turn 89, and I had to start over. Now it checkpoints.

Hermes Agent Challenge Submission: Write About Hermes Agent

My Hermes agent ran for 2 hours, hit a timeout at turn 89, and I had to start over. Now it checkpoints.

Comments
2 min read
My Hermes agent spent how much? trace-cost for JSONL audit logs

Hermes Agent Challenge Submission: Build With Hermes Agent

My Hermes agent spent how much? trace-cost for JSONL audit logs

Comments
3 min read
I had 3,000 agent trace events in JSONL. My manager wanted them in Excel. One line.

Hermes Agent Challenge Submission: Build With Hermes Agent

I had 3,000 agent trace events in JSONL. My manager wanted them in Excel. One line.

Comments
2 min read
5000 events, one worker, one bug: trace-filter for agent JSONL traces

Hermes Agent Challenge Submission: Write About Hermes Agent

5000 events, one worker, one bug: trace-filter for agent JSONL traces

Comments
4 min read
grep for your agent traces — substring, exact, and regex in one call

Hermes Agent Challenge Submission: Build With Hermes Agent

grep for your agent traces — substring, exact, and regex in one call

Comments
2 min read
I ran three Hermes agents in parallel. trace-merge stitched them into one timeline I could read.

Hermes Agent Challenge Submission: Build With Hermes Agent

I ran three Hermes agents in parallel. trace-merge stitched them into one timeline I could read.

Comments
5 min read
I logged 300 Hermes runs to one file. trace-session-split cut it into 300.

Hermes Agent Challenge Submission: Build With Hermes Agent

I logged 300 Hermes runs to one file. trace-session-split cut it into 300.

Comments
2 min read
p95 latency was 1.68 seconds. I didn't know until I built trace-stats.

Hermes Agent Challenge Submission: Write About Hermes Agent

p95 latency was 1.68 seconds. I didn't know until I built trace-stats.

Comments
3 min read
After every Hermes agent run, I print a 10-line summary. Now I know exactly what happened.

Hermes Agent Challenge Submission: Build With Hermes Agent

After every Hermes agent run, I print a 10-line summary. Now I know exactly what happened.

Comments
2 min read
Pipe your Hermes Agent audit log into Datadog in 5 lines (no OTel SDK required)

Hermes Agent Challenge Submission: Write About Hermes Agent

Pipe your Hermes Agent audit log into Datadog in 5 lines (no OTel SDK required)

Comments
5 min read
I had 800 lines of Hermes agent audit log. trace-tree turned it into a tree I could read.

Hermes Agent Challenge Submission: Build With Hermes Agent

I had 800 lines of Hermes agent audit log. trace-tree turned it into a tree I could read.

Comments
5 min read
I shipped 50 agent infrastructure libraries. Here is what I learned.

I shipped 50 agent infrastructure libraries. Here is what I learned.

Comments
7 min read
prompt-shield: a tiny, zero-dep prompt-injection detector you can drop in front of any agent

prompt-shield: a tiny, zero-dep prompt-injection detector you can drop in front of any agent

Comments
5 min read
A six-concern production harness for Nemotron agents on Crusoe Managed Inference

A six-concern production harness for Nemotron agents on Crusoe Managed Inference

Comments
4 min read
agenttap: see exactly what your LLM SDK sent to the wire, with API keys scrubbed

agenttap: see exactly what your LLM SDK sent to the wire, with API keys scrubbed

Comments
4 min read
llmfleet: pool many agents' turns into one Batch API call and save 50 percent

llmfleet: pool many agents' turns into one Batch API call and save 50 percent

Comments
4 min read
cachebench: stop finding out about prompt-cache regressions from the invoice

cachebench: stop finding out about prompt-cache regressions from the invoice

Comments
4 min read
I shipped eight agent-stack repos in eight hours. Here's what made it possible.

I shipped eight agent-stack repos in eight hours. Here's what made it possible.

Comments
4 min read
I needed a stable cache key for LLM requests. The hard part was the input list order.

I needed a stable cache key for LLM requests. The hard part was the input list order.

Comments
4 min read
My LLM provider went down for 11 minutes. My code spent 4 of them in connect timeouts.

My LLM provider went down for 11 minutes. My code spent 4 of them in connect timeouts.

Comments
4 min read
My RAG system slowly got worse for three months and nobody noticed.

My RAG system slowly got worse for three months and nobody noticed.

Comments
4 min read
I rewrote my Bedrock client three times. Then I extracted the boring parts into one library.

I rewrote my Bedrock client three times. Then I extracted the boring parts into one library.

Comments
4 min read
I Shipped 50 Agent-Stack Libraries. Here Is How They Fit Together.

I Shipped 50 Agent-Stack Libraries. Here Is How They Fit Together.

Comments
6 min read
prompt-eval-rubric: Score Your Agent's Outputs Without Paying for Another LLM Call

prompt-eval-rubric: Score Your Agent's Outputs Without Paying for Another LLM Call

Comments
5 min read
agent-fn-registry: Register Your Agent Tools With Schema, Side Effects, and Defaults in One Place

agent-fn-registry: Register Your Agent Tools With Schema, Side Effects, and Defaults in One Place

Comments
5 min read
agent-replay-trace: Load and Step Through Agent Traces for Debugging

agent-replay-trace: Load and Step Through Agent Traces for Debugging

Comments
5 min read
agent-shadow-mode: Run Your Agent in Record-Not-Execute Mode Before You Trust It

agent-shadow-mode: Run Your Agent in Record-Not-Execute Mode Before You Trust It

Comments
5 min read
llm-pii-redact: Remove PII From Prompts Before They Reach the Model

llm-pii-redact: Remove PII From Prompts Before They Reach the Model

Comments
6 min read
Why I Built 50 Small Libraries Instead of One Big Agent Framework

Why I Built 50 Small Libraries Instead of One Big Agent Framework

Comments
6 min read
Production Python Agent Checklist: 15 Things Before You Deploy

Production Python Agent Checklist: 15 Things Before You Deploy

Comments
6 min read
When and How to Use the Anthropic Batch API in Your Agent

When and How to Use the Anthropic Batch API in Your Agent

Comments
6 min read
What I Learned Shipping 50 Agent-Stack Libraries in One Sprint

What I Learned Shipping 50 Agent-Stack Libraries in One Sprint

Comments
6 min read
My agent called search() with `{"query": null}`. The error message I returned saved the next 30 minutes.

My agent called search() with `{"query": null}`. The error message I returned saved the next 30 minutes.

Comments
4 min read
How to Test LLM Agents Without Calling the Real API

How to Test LLM Agents Without Calling the Real API

Comments
5 min read
Make Your Agent's API Calls Idempotent Before You Need To

Make Your Agent's API Calls Idempotent Before You Need To

Comments
5 min read
Four Patterns for Multi-Agent Python Systems That Actually Work

Four Patterns for Multi-Agent Python Systems That Actually Work

Comments
5 min read
Three Error Recovery Patterns for LLM Agent Tool Failures

Three Error Recovery Patterns for LLM Agent Tool Failures

Comments
5 min read
Prompt Engineering Hygiene: The Invisible Layer Under Your Agent Logic

Prompt Engineering Hygiene: The Invisible Layer Under Your Agent Logic

Comments
6 min read
Adding Memory to Your Python Agent Without a Vector Database

Adding Memory to Your Python Agent Without a Vector Database

Comments
5 min read
loading...