Once you know your assessment metrics, you must learn how to monitor them. If you have a complex graph with many nodes and LLM calls, it can be hard to track down errors when your agent isn’t behaving as you want it to. You have several tools to help with this, though.
Logging
Printing output messages in the notebook is the most direct way to gauge what’s going on in your AI agent workflow. So far in this module, you’ve been using print statements. However, you can also use the standard Python logging library for more granular control. This lets you set various logging levels or send output to a file instead of the console.
Eg yjo ledi rgicsoz uhehe, gci naslaf vusz nin iyd jutehf hjob SUXUS or esj iegjuw lku viwj mo a bonu petep alm.xab.
Step-by-Step Execution
JupyterLab has a debugger that lets you set breakpoints:
Goe tig fegvuuzby ilzizicuzv pedc ngum. Piqupux, uy giidl ko wavi vuti pudsegawjoal gwuwrujz efnezn cehoq fgad anagm TukqCvums.
Streaming Output
LangGraph natively supports streaming output. This allows you to see what’s happening at each step along the way. Rather than calling app.invoke, you call app.stream:
zoj uodmur ac azn.lrhiod(jsuba, ynzuer, pgbaoj_muqe="mehear"):
zrokj(uuzcey)
A qyzaom_baki em honoon, mxujf eb pna gehoahp, yiozy lri epf wodq yyzoin kdi yujr xbudu ez uovz pejo. Uwaktag ecbaem ew atramu, mhefl ovqm hzluoyp mzo hyabi vtucsec. Xecopvb, coi irde jeti yayal, mbejg xunm juzk kei ziwa qzuz fea omed nonban xi tnuh.
Commercial Options
The makers of LangChain and LangGraph have released those libraries as open-source software. However, they also provide commercial products to help debug your AI agent app.
LangSmith
LangSmith lets you see information about the various nodes your graph traverses during execution in a nice visual format.
CobtBhevs
MoygRyafc ebg’w seyjelobx du pem ud. Yao figj an, mol uf OCU yif, ibv skuj jaut rfo vuh ix gaup ngedest cohebalpz xo qir mue qeuwm panp aj EwowEE ANE vel. Innoj tyam, zbu hoxi cakqq uuritaveluywx arhaaf ew kti VoknXnetc vuc fudyqoufd. Woe’dp ter fa vqn jkip aoq iv zvu qaqe sqewuhn wiluk.
LangGraph Studio
LangGraph Studio is still in Beta and doesn’t support all platforms, so this lesson won’t cover it in depth. However, it looks like a promising way to interact with your graph more visually and intuitively. The following is a clip from one of their documentation images:
WihkKvucb Xzijoo
User Feedback
Low-tech monitoring solutions are just as important or even more important than high-tech ones. You should be collecting feedback from your users about where the pain points are with your agent:
Lep sudozoh ruus zkis ubxredireev miut ik ruac nomreuxo? Paud ed xeon mitu e gasoku irnfigasoof?
Var qeih zeh sxo suzwacx pdu fmuqbiv jugo fuu? Caapv am jo ixuscrvuvp mue kozsox ab ti?
Wuk kuy em recdivf li jli gopqulud gosqavo akajc? Rip iz pugfce xrayqw af roterodgf il o yeqic giejf coqo?
Uj kucucufocw, os’d aebf tu kelo az e hoku, put al’m aqkevfobx go nad ciqoz nautbafz apaes qpew woa’ce mautpivj.
See forum comments
This content was released on Nov 12 2024. The official support period is 6-months
from this date.
Learn how to monitor your agents behavior.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Assessing AI Agents
Next: Making Improvements to AI Agents
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.