Skip to content
AgentLabs.

AI agent monitoring infrastructure: what you need to replay a run

AI agent monitoring infrastructure: what you need to replay a run

When an AI agent starts making silent mistakes: why observability suddenly becomes a matter of product life and death

There is a moment familiar to anyone working with language models and AI agents. Everything runs, the demo impresses, the presentations shine and the customer is enthusiastic. Then a silent bug suddenly appears. No crash. No 500 error. Just an odd answer, an illogical decision or a recommendation that feels out of place. Here is the point: with a complex AI agent, one making decisions, calling tools and touching sensitive data, we no longer have the luxury of saying it is an edge case. That edge case could be your next viral day on Twitter, or the moment a bank customer realises their automated system has made a substantial financial mistake. To understand what on earth is happening inside this agent, this AI agent, we need to examine a term that has moved from dull cloud infrastructure to a new star of AI: observability for AI agents, the ability to see, understand and analyse events behind the scenes, in real time and afterwards. This article explores the modern observability stack for AI agents: tracing, metrics and replay. Three dry-sounding terms; in practice, the difference between a trustworthy product and an ongoing experiment on your users. ---

From monitoring the server to understanding the AI agent's brain

For those from DevOps and cloud backgrounds, words such as metrics and tracing feel familiar. Scrapers, graphs and logs are routine. But with an AI agent, knowing CPU usage reached 80% is no longer enough. It is almost irrelevant. The new problem lies not at server level, but in the model's, the agent's, chain of thought. Why did the AI agent ignore part of the input? How did it decide to call one tool rather than another? Who is responsible for the defective response: model, prompt, data or integration? This is where the modern AI agent observability stack enters, based less on healthy versus unhealthy servers and more on an intelligent versus confused agent.

Why AI observability is a completely different story

In a traditional system, a bug almost always has a clear root cause: an empty field, a null pointer or broken dependencies. In an AI agent, the mistake may be: - Statistical: the model simply did not understand. - Behavioural: a small prompt change completely altered decisions. - Contextual: a user typed unexpectedly. - Or even caused by a cloud model version update nobody told you about. Here, observability does more than fix faults. Perhaps above all, it helps build trust with users, regulators and management. ---

The recommended AI agent monitoring stack: three essentials

Suppose you are building an AI agent system today: customer service, internal organisational search or legal-document analysis. Must you implement a thousand tools? Certainly not. In practice, three basic, seemingly small but critical elements form the modern observability stack for AI agents:

1. Tracing: seeing the full story of every interaction

If you need one starting point, this is it. AI tracing goes beyond a request entering an API and leaving a database. It turns every conversation with the AI agent into a documented narrative.

What does tracing mean for an AI agent?

Consider one user conversation with your AI agent. A long chain sometimes sits behind it: - An initial prompt providing general context. - A model call. - An external tool call, such as a database or internal API. - A second prompt based on a partial result. - A decision not to send the user everything the model returned. - Sometimes loops: another model call, another summary, another filter. Tracing shows this entire route as one organised document, with timestamps, a conversation identifier and sometimes the AI agent's internal state.

Why is this critical?

When a customer complains that an AI agent is hallucinating, you want to: - See the actual prompt it received, including all hidden instructions. - Understand whether a tool call was attempted and failed. - Examine whether a small intermediate-answer change made the model suddenly change its mind. Without tracing, you are blind. With it, serious discussions can begin about improvements, prompt A/B testing and even analysing how one agent behaves alongside another.

2. Metrics: sometimes a graph is enough without pixel-level detail

Tracing gives one conversation's life story. Metrics provide system-wide understanding: where things are heading, whether today is worse than yesterday and whether performance is under control at all. For an AI agent, the measures change. Response time and errors alone are insufficient. We need measures describing quality and behaviour.

Examples of metrics worth tracking

Some artistry enters here. However, several measures recur in serious AI agent observability stacks: - Latency per conversation or model call: how long does the AI agent actually take to respond? Does this differ by user type or model? - Token usage: how expensive are answers? Which conversation flow burns the most tokens, and could a prompt fix help? - Percentage of tool calls per conversation: how much does the agent rely on real data, and how much does it invent? - Automatic or manual quality measures: for example, relevance or accuracy scores from annotators or another model evaluating the answer. - Failure percentages by type: technical failure, such as an unavailable API, versus logical failure, such as an irrelevant answer or “I do not know” when an answer was available. These measures turn an emotional product discussion, “I think the agent has improved”, into a factual one: “We improved by 17% the proportion of cases where the AI agent answers without handing over to a human representative.”

3. Replay: the play-again button that changes AI agent improvement

If one perhaps less intuitive feature is a game changer for improving AI systems, it is replay.

What is replay in the AI agent world?

Imagine taking a problematic conversation from last week, with all inputs, model calls and prompts, and running it again, but this time: - With a new prompt. - Or a different model. - Or a code change in the AI agent. You then measure whether the outcome is better. That is replay: freezing an interaction and rerunning it under new conditions. Why does it matter? Without it, every prompt or configuration change feels like a gamble. With replay, AI agent development rests on scientific experimentation, rather than gut feeling alone.

Integrating replay into an observability stack

In a modern observability stack, the conversation database, including tracing, is a goldmine for replay. You can select: - Painful conversations, such as customer complaints and faults. - Representative conversations covering key business scenarios. - Or entire conversation groups filtered by country, customer type or enquiry type. Rerun them all after a particular system change to see whether you improved or worsened matters. ---

What does this look like in practice? A short story from a typical Israeli company

Let us bring this down to earth. Imagine an Israeli start-up of around 30–40 employees with a SaaS product. It recently introduced an AI agent helping customers analyse financial documents. The system goes live and everyone is pleased. Two months later, something feels odd. Users complain that the AI sometimes talks nonsense. Management wants evidence that the AI agent really reduces working time. Somebody notes that last month's LLM bill exploded. Without real observability, this remains gossip. With tracing, metrics and replay, the picture changes: - Tracing reveals that, for some documents, the AI agent omits part of the text from the model input because of length limits, without telling users. - Metrics show response time tripling for documents over 20 pages. - Replay, following a prompt change requiring the agent to acknowledge skipped sections, shows significantly fewer problematic answers, but slightly longer processing time. The boardroom discussion then becomes a mature one: do we prefer faster responses with more holes, or a slightly longer answer with greater transparency? That is a business decision, rather than a demand to add more AI. ---

AI agent observability in Israel: more than technology

Israel has an interesting pattern: rapid adoption of new technology, with AI agents in every presentation, alongside occasional disregard for infrastructure work. As previously happened with cloud adoption, some say, “Let us launch, see what happens and fix it along the way.” The catch is that, with an AI agent, fixing things along the way can collide with regulation, privacy and financial mistakes. Particularly in banking, fintech and healthcare, wherever an AI agent helps make real decisions rather than merely drafting email, observability is not a nice-to-have. It is part of what enables a launch at all. Some Israeli organisations already include requirements for: - A full audit trail of every AI agent decision. - Replay for regulatory testing. - Fixed quality measures that must be maintained over time. This is interesting because it requires companies to do more than attach an AI model: they must build an entire management and observability infrastructure around it. ---

A recommended AI agent monitoring stack: clear directions, rather than a rigid recipe

There is no official Israeli recipe for an AI agent observability stack. Every company has considerations, existing infrastructure and preferences. Even so, several main layers commonly recur:

Layer one: data collection; anything undocumented does not exist

Before intelligent tracing and gleaming replay, something more basic is needed: decide what to document in every AI agent interaction. This usually includes: - Session or conversation ID. - An anonymous or partly anonymous user identifier for privacy. - Every prompt sent to the model, before and after adding system prompts. - Every model response. - Every tool call, including main parameters and an abbreviated result. - Metadata: time, customer type, enquiry type, model version and prompt version. Collection underpins tracing, replay and metrics. Without it, none of this can be reverse-engineered afterwards.

Layer two: tracing at AI agent level, not only API level

Many teams begin with logs. That is natural. But logs are not designed to present a conversation's complete journey intuitively. This creates a need for dedicated tracing, sometimes through LLM observability libraries and sometimes within an internal system. The interesting question is how you want to see the AI agent's decision process: as a decision tree, timeline or chain of thoughts? This is usually where the real work with product teams begins. What depth is needed? How much of the agent's internal thoughts should be exposed within the organisation? How do you explain it to non-engineers?

Layer three: metrics connecting the AI agent to business objectives

Product teams rightly ask whether the AI agent actually saves time or money and improves NPS. Metrics bridge AI and business: - Measures such as problem-resolution time before and after introducing the AI agent. - The percentage of cases closed without human intervention. - The user abandonment rate during agent conversations. - Alongside AI quality measures: the percentage of answers marked “Not sure” and the percentage undergoing human review. Combining these produces the larger picture. For example, moving to a cheaper model to cut costs reduces answer quality enough to increase human-representative costs overall. That insight appears only when technical observability is connected to business KPIs.

Layer four: replay turning faults into an ongoing laboratory

Once a rich conversation database exists, the next step is almost obvious: why not turn this knowledge into a living test set rather than merely a bug collection? Good AI agent replay lets you: - Select a filtered conversation set. - Rerun it with different prompt or model versions. - Obtain a clear comparison of outcomes, rather than only a gut feeling. Every system change, large or small, then passes a behavioural regression test as well as a functional one. ---

Frequently asked questions about AI agent observability

Does every small team building an AI agent need a complete observability stack?

You need not start with everything. Usually, basic tracing and a few simple metrics, response time, obvious error rates and token usage, suffice for the first months. Replay usually arrives once the product gains traction and needs systematic improvement, beyond tinkering with prompts.

What about privacy? Can conversations be stored at all?

This is sensitive, particularly in Israel, where personal information attracts considerable concern. Common practices include: - Anonymising user identifiers. - Redacting sensitive information, or PII, before storing it for observability. - Managing the data lifecycle: keep only what is actually needed and for a limited time. The principle is that AI agent observability can be built without harming privacy, but it must be considered beforehand rather than afterwards.

How do you measure AI agent answer quality objectively?

No single measure is perfect. Usually, several are combined: - Sampled human annotation: manually check answers and assign scores. - Automatic evaluation: another model receives the question, answer and perhaps a gold-standard answer, then scores it. - Behavioural signals: did the user ask again, abandon midway or open another support ticket? Good observability combines several indications rather than relying on one magical measure.

Are there off-the-shelf AI agent observability tools, or must everything be built internally?

The market is booming. Dedicated solutions exist specifically for LLMs and AI agents, alongside extensions to existing observability tools and many teams building custom solutions. Many Israeli start-ups combine approaches: beginning with a simple internal solution and moving to a commercial one when it no longer suffices, or the reverse. ---

Table: key points about the AI agent observability stack

Stack componentWhat does it do?Why does it matter for an AI agent?When should you begin?
TracingRecords the complete conversation flow: prompts, answers, tool calls and response times.Explains how an AI agent decided, finds behavioural bugs and analyses complex conversations.From the first day the AI agent reaches real users.
MetricsCollects quantitative measures: token usage, response times, success rates and quality.Provides a system-wide picture of improvement, change impact and business objectives.Once usage is substantial enough to examine trends rather than isolated cases.
ReplayReruns historical conversations with new prompts or models and compares outcomes.Turns every fault and representative conversation into a living regression test for scientific improvement.When prompt/model changes become frequent and existing behaviour must be preserved.
Data collectionCollects and retains rich conversation logs, metadata and every system interaction.Underpins tracing, metrics and replay, enabling retrospective analysis.Immediately, with attention to privacy and information security.
Quality evaluationEvaluates answers manually and automatically, labels conversations and defines good versus bad answers.Creates shared language between AI, product and business teams and measures real improvement.Once enough users exist to reveal recurring patterns and provide feedback.
---

Practical insights before taking the plunge

Not every AI agent needs total transparency, but the boundary must be clear

It is tempting to expose everything the agent does in the UI: “I am searching the database now” or “I am calling an API now”. Not every user wants or needs this. Internally, however, in the management system, you need this transparency for yourselves. The AI agent may be intelligent, but without good internal documentation you cannot know how to protect it or its users.

Invest in data quality before another model

Choosing a larger, more powerful model is easy. Discussing the quality of its input and output data is less glamorous. Good observability may reveal that the AI agent's errors actually come from incomplete or poorly formatted information, or an unstable third-party tool. Sometimes a small data or tool-connection fix achieves more than replacing the entire model.

Understand that the AI agent is a product, not merely a feature

Once measurement and analysis begin, it quickly becomes clear that a serious AI agent handling critical user conversations is a product in its own right. It has versions, KPIs, bugs and upgrades. Observability lets you manage it as a product, rather than black magic you hope will work. ---

Ultimately, this also concerns organisational culture

You can buy every tool in the world, build a gleaming AI agent observability stack and still fail if the organisation does not actually use the data. A healthy AI agent culture includes: - Willingness to admit mistakes: the agent answered incorrectly, and we must learn. - Collaboration between developers, product and support, all examining the same traces and metrics. - Willingness to conduct small experiments with replay and analysis, rather than suddenly making enormous changes. ---

Conclusion: moving forward and finding help

AI agents are already here, and there will only be more. Build them without a serious observability layer and you will quickly manage chaos: elusive faults, user distrust and surprise month-end bills. A modern AI agent observability stack based on deep tracing, intelligent metrics and effective replay does more than fight fires. It brings professional discipline to a sometimes unruly field. If an AI agent is entering your product, or already exists without a real view of its actions, pause, plan and implement the foundations. Not as a perfect system on day one, but something growing with the product and organisation. We would, of course, be happy to help with an initial consultation at no cost, simply to ensure your agent is not wandering in the dark.

From reading to a pilot

Define how you will know the pilot succeeded

Choose a business measure, a quality measure and edge cases. We will assess how to compare them with your current process.