AI applications are undergoing a leap from "dialog box (Chatbot)" to "fully autonomous agent (Agent)". If the LLM is AI's brain, then the Agent is AI's limbs, enabling AI to move from "sitting and talking" to "getting up and acting": autonomously booking tickets, writing code, managing supply chains, and even directly serving customers.
However, a "crisis" lurks within this technological revolution: imagine a user asking an AI assistant to clean up the inbox. The Agent, without confirmation, instantly deletes the entire mailbox and burns through 2 million+ tokens due to high-frequency recursive invocation in a loop. This is not a joke — it is a real nightmare that enterprises adopting Agents must face head-on:
· Uncontrollable Outputs: Are the Agent's responses being tainted by hallucinations?
· Invisible Cost: Why is the Agent's token consumption spiraling out of control?
· Uncertain threats: Will the agent leak data or wipe the database?
To address these pain points, ApsaraDB for ClickHouse has officially released the Agent-lens capability. Based on the powerful combination of ClickHouse and Langfuse, it provides enterprises with a full-link, cost-effective, and out-of-the-box agent observability and evaluation solution.
To truly bring agents into the production environment, the primary job is to achieve behavior traceability, cost observability, effect evaluation, and prompt iteration management. ClickHouse Agent-lens leverages Langfuse + ClickHouse to implement these capabilities and build an enterprise-level agent defense system.
Full-link tracing: Make every second of agent execution traceable
To deeply evaluate "what", "how", and "why" a production-level agent operates, its execution procedure must be disassembled in a fine-grained manner. Based on Langfuse, Agent-lens divides the complex execution procedure into three core levels to achieve full-link observability:
· Session (Session Layer): A complete record of an Agent session with multiple rounds of User interaction. To address issues such as "Agent hallucination" or "declining stability in long conversations", Users can review the entire context through the session view to pinpoint exactly when the Agent starts to hallucinate, effectively resolving context drift.
· Trace (Trace layer): A single interaction from "User input" to "Agent Outputs". The system breaks down inputs and outputs, execution duration, and token consumption in detail, and visually displays the Agent's reasoning path in tree and graph formats, helping developers quickly determine whether the issue is a "plugin error" or a "logic bug", and then precisely identify performance bottlenecks that slow down response speed and high-cost culprits that cause token waste.
· Generation/Span (Execution layer): A transparent display of all atomic operations in a Trace, including the running time, token consumption, and intermediate results of each Generation and Span step. You can identify specific cost and performance bottleneck points at a glance and perform targeted optimization.

Prompt Management: Enable business teams to iterate independently
In Agent application development, "prompt hard coding" is a major pain point: if business teams want to modify the Agent's prompt, they need to contact developers to modify the Code, retest, and Release. This flow takes half a day or even a full day, critically slowing down business iteration speed.
Agent-lens (Powered by Langfuse) completely breaks this constraint, achieving decoupling of business and technology:
· Prompt and Code decoupling: Prompts and model parameters are fully separated from code. Business personnel can adjust prompt content through a visual interface without redeploying code, significantly reducing flow costs.
· Agile iteration: The code side does not need the full prompt — only the associated prompt label. Business personnel adjust the prompt of the corresponding label in the backend, and iterations take effect in real time.
· A/B Test: Supports coexistence of multiple prompt versions and grayscale testing. Traffic distribution of prompts with different labels is performed through code, and the Trace view is used to quantitatively compare the real-world effects of different prompts, making every Agent tuning data-driven.
· Playground experiment: Before pushing to production, you can preview online and compare the execution paths and effect differences of Agents under different prompt versions. After ensuring everything is ready, perform a full Release, significantly reducing the online failure rate.

Behavior Security and effect evaluation (Evaluation): Automate agent effect evaluation
With tens of thousands of agent invocations per day, manual quality inspection is inefficient and difficult to cover all scenarios. Agent-lens leverages Langfuse's LLM-as-a-judge capability to evaluate AI with AI: it can automatically score agent responses based on predefined business rules and security compliance requirements, and monitor for hallucinations or security threats. Enterprises can also use this capability to implement real-time monitoring, alerting, and automatic interception of agent risky operations.

Agents generate extremely large volumes of log data during execution. If you use traditional row store databases such as PostgreSQL or MySQL, you will soon face the dilemma of unaffordable storage and sluggish queries. ClickHouse Enterprise Edition is purpose-built to solve the most critical storage cost and query Efficiency challenges in agent observability scenarios:
· Extreme Performance: Unlike traditional APIs, a complex job may trigger dozens of subtasks (spans). With a High write throughput of 50–200 MB/edge zone/s that scales linearly as edge zones are added, ClickHouse enables stable ingestion of millions to tens of millions of agent trace records. Its vectorized execution engine returns complex analytical queries in seconds, ensuring Low-Latency response on observability gauges.
· Extreme Compression: Agent operational logs contain a large number of duplicate fields such as model names and project IDs. ClickHouse leverages columnar Storage and advanced compression algorithms to achieve 5–20x compression on agent operational logs, saving 80%+ in storage cost compared with traditional databases.

· Extreme Elasticity: Agent usage typically exhibits pronounced peak-and-trough patterns within a day or week. Alibaba Cloud ClickHouse Enterprise Edition adopts a storage-Compute separation Architecture and supports on-demand serverless capabilities for Compute and storage resources. It automatically scales in during off-peak hours, helping enterprises minimize costs.

If the open source Langfuse is an excellent DPI engine, then Alibaba Cloud's ClickHouse Agent-lens is a professionally tuned, out-of-the-box top-tier racing car.
▶︎ 100% compatible with the open source ecosystem, seamless migration:
100% compatible with open source Langfuse at the kernel layer. Whether you are trying it for the first time or migrating from an open source version, you can smoothly integrate without refactoring existing Code, enjoying enterprise-level stability while retaining open source flexibility.
▶︎ Minimalist O&M, no more widget stacking:
Traditional self-built Solution requires maintaining multiple independent widgets such as the metadatabase, cache, and backend. Agent-lens enables one-click launch deployment, encapsulating complex Architecture into simple console operations, allowing you to focus on business logic optimization without worrying about O&M configuration.
▶︎ More comprehensive frame adaptation:
In addition to supporting zero-Code data collection for 14 mainstream frames such as Dify and Ragflow, as well as data access based on the OpenTelemetry protocol, Agent-Lens also supports the OpenClaw data collection plugin.
▶︎ Bridging traditional logs with Agent observability:
Supports quick activation on your existing ClickHouse database, leveraging the same data foundation to bridge traditional IT monitoring logs with Agent Run data. Combined with business order numbers, User IDs, and other Info, you can quickly locate business abnormalities caused by Agent behavior, transforming continuous monitoring from "guesswork" to "visibility".
▶︎ LLM intelligent Analysis for business-aware observability:
On top of LLM-as-a-judge, Agent-Lens also provides intelligent insight capabilities for Low scores. When performance bottlenecks or invoke failures occur, the System not only provides scores but also offers root cause Analysis Suggestions based on context, upgrading Agent self-evolution from "manual debug" to "AI-driver automatic iteration".
Going back to the crash Story at the beginning, what would have happened if that User had enabled ClickHouse Agent-lens?
• Real-time alerting: When an Agent abnormally deletes Emails, the LLM evaluator immediately detects a "High-threat behavior" and triggers a business alert in time.
• Cost Circuit Breaker: When token consumption is abnormal, the Cost dashboard instantly turns red, triggering the business Circuit Breaker mechanism in time to prevent a 2-million-token bill from being generated.
• Root cause analysis: After an incident, engineers can combine sessions and traces to identify what caused the Agent's misoperations and high consumption, and perform prompt optimization Tests in the Playground. The Fix is published within minutes.
The arrival of the Agent era is unstoppable, but the "trust gap" introduced by its autonomy must be bridged through engineering. ClickHouse Agent-lens gives you not just data, but control: it enables business teams to see every path AI takes, Management to account for every Cost, and technical teams to uphold every Security red line.
[Infographic] Highlights | Database New Features in June 2026
Alibaba Cloud ApsaraDB Data Agent Enterprise Edition Helps You Master Your Data with Ease
ApsaraDB - January 15, 2026
Alibaba Cloud Native Community - April 20, 2026
ApsaraDB - June 26, 2026
Alibaba Cloud Native Community - May 25, 2026
ApsaraDB - May 21, 2026
Alibaba Cloud Native Community - June 8, 2026
Token Plan
Build more, spend less. One plan, every modality.
Learn More
Alibaba Cloud Model Studio
A one-stop generative AI platform to build intelligent applications that understand your business, based on Qwen model series such as Qwen-Max and other popular models
Learn More
Qwen
Full-range, open-source, multimodal, and multi-functional
Learn More
AI Acceleration Solution
Accelerate AI-driven business and AI model training and inference with Alibaba Cloud GPU technology
Learn MoreMore Posts by ApsaraDB