RAG pipeline hard to debug

What engineers usually see

  • Multi-step RAG workflow fails or returns wrong results
  • Cannot trace which step caused the issue
  • Retrieval, embedding, and generation steps are disconnected
  • No end-to-end visibility

Why this is hard to debug

RAG pipelines involve multiple LLM calls and external systems. Traditional logs don't link steps together. Receipts provide request IDs that trace the entire pipeline.

Minimal repro

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_OPENAI_KEY",
    base_url="https://aibadgr.com/v1"
)

# Step 1: Embed query
embedding = client.embeddings.create(
    model="text-embedding-ada-002",
    input="What is AI?"
)

# Step 2: Retrieve context (external)
context = retrieve_from_db(embedding.data[0].embedding)

# Step 3: Generate response
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "system", "content": f"Context: {context}"},
        {"role": "user", "content": "What is AI?"}
    ]
)

This request routes through AI Badgr and returns a stable request ID that links to an execution record.

Note: AI Badgr is OpenAI-compatible and works as a drop-in proxy. No SDK changes required — only the base_url changes.

What a per-request execution record makes visible

  • Each LLM call in pipeline
  • Timing per step
  • Cost per step
  • Step correlation IDs
  • End-to-end pipeline latency

Run 1 request → get receipt

Change your base URL to https://aibadgr.com/v1 and run your request.

The response includes an X-Badgr-Request-Id header that links to a receipt showing latency, retries, tokens, cost, and failure stage for that specific execution.

Not the engineer?
Share this page with your dev and ask them to run one request through AI Badgr. That's all that's needed to get the receipt.

This kind of thing only makes sense when you can actually see what happened to a single request from start to finish, instead of trying to piece it together from scattered logs.