← lampt.org
Falconer with AI Agent

How to Deploy AI Agents in Production: The Falconer's Framework

Triển Khai AI Agent Trong Production: Khung Tư Duy Ưng Thủ

January 2026 · Pham Thanh Lam · Chief Data Science & AI Officer, Cake by VPBank

AI agents fail for the same reason untrained falcons fail: they follow instinct, not intent. After deploying 150+ voice agents handling millions of banking calls at Cake, I've found the fix isn't better models—it's better context engineering. Here's the framework.

In UAE, master falconers earn millions. They spend months building trust with a bird that could fly away forever. Two GPS trackers on every falcon—not because the bird is malicious, but because it follows instinct, not intent. You have a tool of terrifying capability. 300km/h dives. Genius-level pattern matching. Also: easily fooled by decoys, attacks wrong targets, zero clue why you want what you want.

Why AI Agents Attack Wrong Targets

The most common agent failure isn't capability—it's context. A generalist agent seeing everything attempts everything. At Cake, our early voice agents had a 34% misrouting rate. They'd hear "transfer" and initiate wire transfers when customers meant "transfer me to a human."

Falconers figured this out centuries ago: you don't say "go hunt." You choose terrain. Read wind. Pick target type. Time the release.

The fix was domain isolation. We route intents to specialized agents, not one general agent. A balance-inquiry agent never sees wire-transfer tools. A complaint agent never sees transaction APIs. Narrowing context from "everything" to "exactly what's needed" dropped our misrouting rate to 8%.

Context engineering isn't prompt engineering. It's choosing what the agent sees before it acts—routing logic, tool access, memory scope. Agents with narrower context outperform generalist agents on resolution rate.

Context Engineering: Choosing the Terrain

Every agent deployment requires three context decisions:

1. Intent routing. Which agent handles which query? We use a lightweight classifier (not the main LLM) to route before the expensive model runs. Misclassification here cascades into everything else.

2. Tool scoping. What can this agent touch? Our payment-dispute agent can read transactions but not modify them. It escalates to a human for reversals. Fewer tools = fewer attack surfaces = fewer hallucinated actions.

3. Memory boundaries. How much conversation history? We cap at 4 turns for transactional queries, unlimited for complex disputes. Long memory invites confusion. Short memory loses context. Match memory to task complexity.

Verification Before Reward: The RLVR Pattern

Falconers never reward mid-flight. The falcon returns. You check: Right prey? Actually caught? Not someone's pet? Only then: reward.

This is RLVR—Reinforcement Learning with Verifiable Rewards. Math has right answers. Code runs or crashes. Banking transactions either reconcile or they don't.

At Cake, every voice agent call gets scored after completion: Did the customer's stated intent get resolved? Did any compliance flags trigger? Did the customer call back within 24 hours? We weight resolution (40%), compliance (35%), and repeat-call rate (25%). Agents that score below threshold get their prompts reviewed, not retrained blindly.

Never optimize agent behavior on intermediate outputs. Verify the final outcome. A confident-sounding wrong answer is worse than an uncertain right one.

Monitoring: Two GPS Trackers

Every falcon wears two GPS trackers. Redundancy. Our agent monitoring follows the same principle:

Runtime logging: Every call captures intent classification confidence, tool calls made, tokens consumed, and latency. This catches drift before customers complain.

Outcome tracking: Resolution rate, escalation rate, customer satisfaction, repeat contacts. This catches whether the agent actually helped.

The gap between runtime metrics (agent did things) and outcome metrics (things worked) is where failures hide. An agent can execute perfectly and still fail the customer.

When Humans Take Over

Our human override rate sits at 23%. That's not a failure metric—it's a design choice. Agents handle volume. Humans handle edge cases, emotional situations, and anything involving regulatory judgment.

The falcon doesn't hunt for you. It hunts with you. You bring judgment it'll never have. It brings speed you'll never have. Current AI agents are falcons, not dogs. Dogs understand intent. Falcons follow training.

We explicitly train agents to recognize their limits: "I'm not confident I can help with this. Let me connect you with a specialist." A graceful handoff beats a botched resolution.

The Framework Summary

Deploying AI agents at scale requires four things:

1. Context engineering: Route to specialized agents. Scope tools narrowly. Bound memory appropriately.

2. Verified rewards: Score on outcomes, not outputs. Resolution rate > confidence score.

3. Dual monitoring: Track both what agents do and whether it worked.

4. Designed handoffs: Know when humans take over. Build the escalation path first.

The best falconers aren't those with fastest birds. They're those who know when to release, when to recall—and honest enough to check if the catch was actually what they asked for.

Pham Thanh Lam is Chief Data Science & AI Officer at Cake by VPBank, Vietnam's largest digital bank, where he leads a team running 100+ AI models and 150+ voice agents in production.

AI agent thất bại vì lý do tương tự chim ưng chưa được huấn luyện: chúng theo bản năng, không theo ý định. Sau khi triển khai 150+ voice agent xử lý hàng triệu cuộc gọi ngân hàng tại Cake, tôi nhận ra giải pháp không phải model tốt hơn—mà là context engineering tốt hơn. Đây là framework.

Ở UAE, ưng thủ bậc thầy kiếm hàng triệu đô. Họ mất nhiều tháng xây dựng niềm tin với một con chim có thể bay đi mãi mãi. Hai thiết bị GPS trên mỗi con ưng—không phải vì chim có ác ý, mà vì nó theo bản năng, không theo ý định. Bạn có công cụ với khả năng đáng sợ. Bổ nhào 300km/h. Nhận diện mẫu cấp thiên tài. Nhưng cũng: dễ bị lừa bởi mồi giả, tấn công nhầm mục tiêu, không hiểu tại sao bạn muốn điều bạn muốn.

Tại Sao AI Agent Tấn Công Nhầm Mục Tiêu

Thất bại phổ biến nhất của agent không phải năng lực—mà là context. Agent tổng quát thấy mọi thứ sẽ cố làm mọi thứ. Tại Cake, voice agent đầu tiên của chúng tôi có tỷ lệ định tuyến sai 34%. Chúng nghe "chuyển" và khởi tạo chuyển tiền khi khách hàng muốn "chuyển máy cho nhân viên."

Ưng thủ đã hiểu điều này từ nhiều thế kỷ: không ai nói "đi săn đi." Chọn địa hình. Đọc gió. Xác định loại mồi. Tính thời điểm thả.

Giải pháp là cô lập domain. Chúng tôi định tuyến intent đến agent chuyên biệt, không phải một agent tổng quát. Agent kiểm tra số dư không bao giờ thấy công cụ chuyển tiền. Agent khiếu nại không bao giờ thấy API giao dịch. Thu hẹp context từ "mọi thứ" xuống "đúng thứ cần thiết" giảm tỷ lệ định tuyến sai xuống 8%.

Context engineering không phải prompt engineering. Đó là chọn những gì agent thấy trước khi nó hành động—logic định tuyến, quyền truy cập tool, phạm vi memory. Agent với context hẹp hơn vượt trội agent tổng quát về tỷ lệ giải quyết.

Context Engineering: Chọn Địa Hình

Mỗi lần triển khai agent cần ba quyết định về context:

1. Định tuyến intent. Agent nào xử lý query nào? Chúng tôi dùng classifier nhẹ (không phải LLM chính) để định tuyến trước khi model đắt tiền chạy. Phân loại sai ở đây lan sang mọi thứ khác.

2. Giới hạn tool. Agent này được động vào gì? Agent tranh chấp thanh toán có thể đọc giao dịch nhưng không sửa được. Nó chuyển cho người cho hoàn tiền. Ít tool hơn = ít bề mặt tấn công hơn = ít hành động ảo giác hơn.

3. Ranh giới memory. Bao nhiêu lịch sử hội thoại? Chúng tôi giới hạn 4 lượt cho query giao dịch, không giới hạn cho tranh chấp phức tạp. Memory dài mời nhầm lẫn. Memory ngắn mất context. Khớp memory với độ phức tạp task.

Xác Minh Trước Thưởng: Mô Hình RLVR

Ưng thủ không bao giờ thưởng giữa chừng. Chim về. Kiểm tra: Đúng con mồi? Thực sự bắt được? Không phải thú cưng nhà ai? Chỉ khi đó: thưởng.

Đây là RLVR—Reinforcement Learning with Verifiable Rewards. Toán có đáp án đúng. Code chạy hoặc crash. Giao dịch ngân hàng hoặc khớp hoặc không.

Tại Cake, mỗi cuộc gọi voice agent được chấm điểm sau khi hoàn thành: Intent đã nêu của khách có được giải quyết? Có flag compliance nào không? Khách có gọi lại trong 24 giờ không? Chúng tôi cân resolution (40%), compliance (35%), và tỷ lệ gọi lại (25%). Agent dưới ngưỡng được review prompt, không retrain mù quáng.

Không bao giờ optimize hành vi agent trên output trung gian. Xác minh kết quả cuối. Câu trả lời sai nhưng tự tin còn tệ hơn câu đúng nhưng không chắc.

Giám Sát: Hai GPS Tracker

Mỗi con ưng đeo hai GPS tracker. Dự phòng. Giám sát agent của chúng tôi theo nguyên tắc tương tự:

Runtime logging: Mỗi cuộc gọi ghi lại độ tin cậy phân loại intent, tool calls, token tiêu thụ, và latency. Phát hiện drift trước khi khách phàn nàn.

Outcome tracking: Tỷ lệ giải quyết, tỷ lệ escalation, satisfaction khách, contact lặp lại. Phát hiện agent có thực sự giúp được không.

Khoảng cách giữa runtime metrics (agent làm việc) và outcome metrics (việc hiệu quả) là nơi thất bại ẩn náu. Agent có thể thực thi hoàn hảo nhưng vẫn thất bại với khách.

Khi Nào Người Can Thiệp

Tỷ lệ override của người ở mức 23%. Đó không phải metric thất bại—đó là lựa chọn thiết kế. Agent xử lý volume. Người xử lý edge case, tình huống cảm xúc, và mọi thứ liên quan đến phán đoán pháp lý.

Chim ưng không săn thay bạn. Nó săn cùng bạn. Bạn mang phán đoán nó không bao giờ có. Nó mang tốc độ bạn không bao giờ có. AI agent hiện tại là chim ưng, không phải chó. Chó hiểu ý chủ. Chim ưng theo huấn luyện.

Chúng tôi huấn luyện agent nhận ra giới hạn: "Tôi không tự tin có thể giúp việc này. Để tôi kết nối bạn với chuyên viên." Chuyển giao nhẹ nhàng hơn giải quyết hỏng.

Tóm Tắt Framework

Triển khai AI agent ở quy mô cần bốn thứ:

1. Context engineering: Định tuyến đến agent chuyên biệt. Giới hạn tool hẹp. Bound memory phù hợp.

2. Verified rewards: Chấm điểm outcome, không phải output. Resolution rate > confidence score.

3. Dual monitoring: Theo dõi cả agent làm gì và có hiệu quả không.

4. Designed handoffs: Biết khi nào người can thiệp. Xây escalation path trước.

Ưng thủ giỏi nhất không phải người có chim nhanh nhất. Mà là người biết khi nào thả, khi nào gọi về—và đủ thành thật để kiểm tra xem thành quả có đúng thứ mình yêu cầu không.

Pham Thanh Lam là Chief Data Science & AI Officer tại Cake by VPBank, ngân hàng số lớn nhất Việt Nam, nơi anh dẫn dắt team vận hành 100+ AI model và 150+ voice agent trong production.

Disclaimer: The views expressed in this article are my own and do not represent the official position of Cake by VPBank or VPBank. Numbers and metrics cited are illustrative examples based on general industry patterns and personal experience, not official company data. Nothing in this article constitutes financial, legal, or professional advice.