Skip to content

About

Systematic framework for debugging non-deterministic AI agents. Includes circuit breakers and observability patterns.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Agent Debugging Framework

Stop guessing why your AI agents fail. Debug systematically.

License: MIT Python LangChain

🐛 The Problem

AI Agents are probabilistic software. Unlike traditional code, they fail in non-deterministic ways:

  • Hallucinations: Inventing data that doesn't exist.
  • Loops: Getting stuck in "I apologize, let me try again" cycles.
  • Context Drift: Forgetting instructions after 10 turns.
  • Tool misuse: Calling APIs with valid JSON but invalid logical parameters.

Most developers debug by staring at console logs. This framework provides a systematic approach to agent reliability.

📦 What's Included

This repository contains the debugging methodology and Python code patterns I use to stabilize production agents.

  • Debugging Flowchart: A step-by-step process from symptom to root cause.
  • Resiliency Patterns: Wrappers for circuit breakers and retries.
  • Testing Strategies: How to unit test non-deterministic outputs.
  • Common Failure Modes: A categorized list of things that will go wrong.

Repository Structure

ai-agent-debugging-framework/
├── framework.md               # The core methodology
├── patterns/
│   ├── circuit-breaker.py     # Stop calling tools that are down
│   ├── retry-with-backoff.py  # Handle rate limits gracefully
│   ├── observability.py       # Wrap LLM calls to capture full context
│   └── idempotency.py         # Ensure agents don't double-charge cards
├── examples/
│   ├── broken-agent/          # Example of a fragile implementation
│   └── fixed-agent/           # The same agent, hardened with this framework
└── docs/
    ├── debugging-checklist.md
    └── common-failure-modes.md

🛠️ Usage

  1. Wrap: Use the observability.py wrappers around your LLM calls.
  2. Catch: Implement circuit-breaker.py on your tools (Search, Database, API).
  3. Trace: Use the structured logs to identify exactly where the context drifted.

🤝 Need Agent Reliability Help?

I help companies move AI agents from "cool demo" to "production reliable".


MIT License.

About

Systematic framework for debugging non-deterministic AI agents. Includes circuit breakers and observability patterns.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages