Open Reader

Paving the Road to Production: Governed Enterprise AI Agents — Harish Gaggar, Credit Karma

completed 29:26 Oct 14, 2026 Watch on YouTube

Current Status

completed

Video ID

tZycGA_Fbfo

RAG / Chat

Enabled
Paving the Road to Production: Governed Enterprise AI Agents — Harish Gaggar, Credit Karma
Description

Register an agent through an internal portal and receive more than a repository: the deployment also needs identity, memory, traces, evaluations and secret handling. Harish Gaggar walks through that paved path for enterprise agents at Intuit Credit Karma. Local development progresses through container builds, review, security scanning and Kubernetes deployment, with the supporting resources provisioned consistently. The architecture places a centralized MCP gateway between agents and tools so authentication and routing are part of every request. Custom MCP servers expose reviewed tools, while OpenTelemetry, Tempo, Prometheus and Grafana make failures, latency and access behavior visible. Gaggar then follows a LangGraph workflow from interpretation and planning through evidence gathering, policy checks and human approval for sensitive actions. Threads, runs and checkpoints preserve state, while separate tracking tables record model use, tool calls, costs and evaluation fields. Demonstrations inspect those records rather than establish a validated quality score for the whole system. A PII filtering layer aims to intercept sensitive inputs before they reach models, memory or traces; detection and redaction remain controls to evaluate, rather than a guarantee that no secret can escape. The final component prunes, reranks, deduplicates and compresses context. Its examples show large token reductions, including about 90% in a demonstrated query, without a paired answer quality study or measured business ROI. The practical point is to build the surrounding framework from the start, giving each agent a consistent route through access control, observability, durable state and accountable action. Speaker info: - https://www.evidyafoundation.com/about-us Timestamps: 00:00 - From experiments to enterprise agents 1:28 - Missing production foundations 2:54 - The agent and supporting frameworks 4:06 - Registration, local development and the paved path 6:27 - Review, containers

Summary

Generated by gpt-5.6-terra

At-a-Glance

  • Verdict: Watch fully
  • Core thesis: Production enterprise agents require a governed platform—centralized MCP authentication and routing, approved tools, policy-aware workflows, observability, durable state, data protection, and cost controls—rather than a standalone agent framework.
  • Why it matters: This is a concrete reference architecture for turning agent prototypes into an operable control plane, with reusable patterns for MCP gateways, tool authorization, human approval, telemetry, evaluation, and token governance.
  • Best use: Use it as an architecture review checklist for an enterprise agent platform or OpenClaw-style control plane; extract the lifecycle, gateway, telemetry, and context-management patterns rather than treating its named products as mandatory.

Executive Summary

Harish Gaggar argues that agents fail in production less because of model capability than because teams ship them without foundational controls. His proposed answer is an enterprise agent framework that standardizes the entire path from developer onboarding to deployment and runtime governance: an agent registry and developer portal, generated repositories and cloud resources, containerized CI/CD, workload identity, an MCP gateway, internally reviewed MCP tools, and centralized auditability.

The architectural center is a mandatory MCP gateway. Agents and coding assistants should not access endpoint systems directly; they authenticate to the gateway, which maintains session state, issues a JWE access token, routes requests by MCP namespace, and forwards the applicable user identity to the destination MCP server. The MCP server then invokes the underlying service with scope-based access. In air-gapped environments, Gaggar recommends building internal MCP servers, for example using FastMCP, and having security review every exposed tool and filter its allowable fields.

At the workflow layer, he uses LangGraph to interpret a request, classify it by operational risk, plan and collect evidence through the gateway, validate policy, and either execute read-only actions or send sensitive writes and deletions through human-in-the-loop approval. Every path, including rejection, is logged. Around this core, he adds checkpointed thread memory, tracking and evaluation data, PII/secret interception before data reaches models or telemetry, and context optimization.

The strongest practical point is that governance and economics must be instrumented from day one. He distinguishes infrastructure monitoring—logs, traces, and metrics—from agent-level tracking and evaluation that records prompts, outputs, models, tokens, quality dimensions, tool calls, and graph trajectory. His context-optimization demo reports reducing equivalent Artifactory requests from roughly 24,000 tokens to 2,400 or 1,500 tokens; he says typical savings are 70–78%. These figures are speaker-reported demo results, not independently benchmarked quality-preserving savings.

Key Takeaways

  • Claim: Build a standardized enterprise agent platform, not one-off agents, so every team inherits the controls that individual developers otherwise omit. | Evidence: The proposed developer portal registers the use case and agent ID, collects framework/language/skill choices, and generates a repository containing the agent framework plus memory, tracking/eval, context-optimization, and PII-blocking components. It also provisions workload identity, memory storage, tracking/eval tables, and secret management. | Implication: Treat agent creation as a paved-road product: scaffold mandatory controls and infrastructure through templates and provisioning rather than relying on application teams to add them later. | Caveat: The design is presented as a recommended architecture and demo pattern; the transcript does not provide production adoption metrics, operational cost, or comparisons with lighter-weight alternatives.
  • Claim: A centralized MCP gateway should be the mandatory authentication and routing layer between agents or coding assistants and enterprise tools. | Evidence: On initial access, the gateway stores session state in Redis and returns a JWE access token. Subsequent calls target a namespace/MCP route such as GitHub or Artifactory; the gateway unwraps the token, attaches the user token, and forwards the request to the appropriate MCP server. Gaggar explicitly argues against direct endpoint access. | Implication: Centralize identity propagation, routing, logging, and enforcement at the tool boundary, rather than letting each agent embed credentials and call SaaS or internal APIs directly. | Caveat: The token and session flow is a high-level description; important implementation details such as token lifetime, delegation boundaries, authorization policy language, replay prevention, and service-account impersonation controls are not covered.
  • Claim: Tool access needs its own governance layer: expose narrowly defined MCP tools, security-review them, and constrain returned fields before they reach the model. | Evidence: For internal or air-gapped environments, the speaker recommends building MCP servers with FastMCP and defining a controlled set of tools. Each tool should be reviewed by internal security, with filters and limits that block unnecessary fields from being sent to the LLM. | Implication: Model tool schemas as governed APIs with least-privilege inputs, outputs, and actions—not as broad wrappers around enterprise systems. | Caveat: An MCP server is not itself a sufficient authorization boundary; the transcript assumes the underlying service enforces scoped access after identity exchange.
  • Claim: Agent workflows should classify operational risk before execution and require human approval for sensitive writes, modifications, or deletions. | Evidence: The LangGraph flow interprets the request, creates a plan, classifies it as read, modification, deletion, or another sensitive operation, fetches evidence through MCP, validates policy, and automatically executes read-only operations. Write or sensitive actions enter a HITL approval step; both approval and rejection are audit logged. | Implication: Separate planning/evidence gathering from side-effect execution, make action class explicit in the graph state, and default high-impact actions to approval rather than relying on prompt-level guardrails.
  • Claim: Operational telemetry and agent-quality evaluation are distinct systems and both are required to manage an agent fleet. | Evidence: Gateway monitoring uses operational logs plus OpenTelemetry, with traces sent to Tempo, metrics such as tool P95 latency and authentication-rejection spikes sent to Prometheus, and visualization in Grafana. Separately, agent tracking/eval records request/session/agent identifiers, prompts and outputs, model used, duration, token cost, eight per-run quality checks including safety and tool accuracy, tool invocation outcomes, and node-by-node trajectory. | Implication: Define a shared telemetry schema that supports both incident response and portfolio management: reliability and auth failures at runtime, plus quality, cost, tool correctness, and ROI across agents over time.
  • Claim: Persisted thread/run/checkpoint state makes multi-turn workflows recoverable and inspectable, but it must be treated as governed data. | Evidence: Each initial query creates a thread and run ID; graph-node checkpoints are stored as the workflow progresses, with follow-up questions on the same thread generating additional run IDs. The speaker suggests SQLite for local development and Cloud Spanner for GCP production, while noting equivalent databases can be used on Azure or AWS. | Implication: Make workflow state first-class infrastructure with explicit lifecycle and access controls, rather than treating chat history as an unstructured application artifact. | Caveat: The presentation explains state persistence and inspection but does not specify retention policies, encryption, tenant isolation, deletion rights, or how memory quality is evaluated.
  • Claim: Pre-LLM data redaction and context shaping are required both for security and for sustainable unit economics. | Evidence: The PII framework assigns data-type severity and immediately blocks/redacts secrets above a stated roughly 90% threshold so they do not enter the LLM, memory database, tracking/eval tables, or tracing systems. The context optimizer selects within a token limit, reranks, deduplicates, and compresses payloads; demos show 24,000-token Artifactory queries reduced to 2,400 and approximately 1,500 tokens, while the speaker says typical savings are 70–78%. | Implication: Place a data firewall and context compiler ahead of every model call, then evaluate savings jointly with task success so cost reduction does not silently degrade agent behavior. | Caveat: The reported token reductions are from the speaker's examples, and the transcript provides no corresponding answer-quality, recall, latency, or false-positive measurements for pruning or redaction.

Detailed Brief

Paved-road development and deployment lifecycle

  • Claims: Agent registration is intended to make ownership, use case, framework choice, language, skills, and prompts discoverable before an agent is deployed.; The path from local development to production should be consistent: developers test a containerized agent locally, obtain two PR approvals, then use CI/CD to register, scan, publish, and deploy it.; Deployment identity should be pre-bound to the resources created for the agent so the workload starts with its intended access pattern rather than receiving ad hoc credentials.
  • Evidence: The described pipeline builds a Docker image, scans it for vulnerabilities, puts approved images in a registry, and deploys them to a Kubernetes namespace through an internal deployment or orchestration platform.; The speaker refers to a Kubernetes-service-account to Google-service-account binding before the agent communicates with memory stores, tracking/eval resources, AI gateways, MCP servers, tracing systems, and other APIs.; The registry is described as providing a LangSmith URL for trace visibility.
  • Caveats: The architecture is strongly GCP and Kubernetes flavored, even though the speaker says equivalent memory databases can be used across clouds.; The transcript does not explain promotion environments, rollback procedures, policy-as-code checks, or how agent versions and prompts are governed after release.
  • Implications: A useful platform maturity test is whether a new agent can be created with compliant identities, storage, logging, evaluation, and guardrails by default, without a bespoke security-integration project.; Separate the developer experience layer from the runtime control plane: the portal provisions and standardizes; the gateway and deployment platform enforce.

Data model for agent observability and evaluation

  • Claims: The speaker's evaluation model preserves both executive-level scorecards and forensic records for individual runs.; A fleet-scale view becomes possible only if every agent emits compatible tracking data from its first day.
  • Evidence: The six illustrated data categories are job tracking, quality checks, aggregate evaluation score, detailed quality metrics, tool invocations, and agent trajectory.; Quality checks are described as eight dimensions per run, while an aggregate score ranges from zero to one. The trajectory captures each LLM call and graph state such as planning and summarization.; Gaggar frames aggregation across many agent-specific projects and tables as the basis for dashboards showing response quality, token burn, and ROI six months later.
  • Caveats: The transcript does not define the evaluators, scoring calibration, ground-truth sources, thresholds that block release, or safeguards against metric gaming.; Storing prompts, responses, and trajectories expands the sensitive-data surface, making the preceding redaction controls operationally critical.
  • Implications: Use a common event model across agents, but retain run-level lineage so an executive cost or quality anomaly can be traced to a model call, graph node, tool call, and identity path.; Do not collapse evaluation into a single score; preserve separate safety, quality, latency, cost, and tool-accuracy dimensions because remediation differs by dimension.

Notable Concepts & Terms

  • MCP gateway: The proposed central enforcement point for authenticating clients, maintaining session state, routing requests to named MCP servers, forwarding user identity, and preventing direct endpoint access.
  • MCP server: A governed adapter exposing narrowly defined tools to agents and then calling an underlying service; the speaker positions internally built servers as especially appropriate for air-gapped environments.
  • FastMCP: The package/wrapper the speaker cites for constructing internal MCP servers and their tool sets.
  • JWE access token: The encrypted token the gateway returns to a client after initial authentication in the described request flow.
  • LangGraph: The graph-based agent framework used for branching, loops, state, planning, risk classification, evidence retrieval, policy checks, and approval paths.
  • HITL: Human-in-the-loop approval applied to writes and other sensitive operations before execution, with outcomes retained in audit logs.
  • Agent trajectory: A stepwise execution record containing LLM calls and graph states, intended to explain how a run progressed rather than only whether it succeeded.
  • Context optimizer: A pre-LLM pipeline that token-bounds, reranks, deduplicates, and compresses supplied context to reduce token use.

Operator Notes / Why Ken Should Care

  • Adopt a default-deny rule for tool connectivity: require all agent and coding-assistant tool calls to traverse a gateway with identity propagation, route-level policy, and auditable logs.
  • Create a reusable agent template that provisions identity, secrets, checkpoint storage, redaction, telemetry, evaluation schemas, and context controls automatically; make deviations explicit exceptions.
  • Define an action-risk taxonomy now—read, write, destructive, privileged, and externally consequential—and map each class to approval, evidence, and audit requirements.
  • Benchmark any context optimizer against task success, source recall, latency, and safety in addition to token savings; do not accept cost claims based solely on reduced context size.
  • Set retention, access-control, encryption, and deletion policies for prompts, memory checkpoints, traces, and trajectories before broadly enabling agent logging.
  • Require security review and least-privilege schemas for each MCP tool, including allowed fields, output filtering, idempotency expectations, and approval requirements.

Source/Metadata

  • Title: Paving the Road to Production: Governed Enterprise AI Agents — Harish Gaggar, Credit Karma
  • Transcript words: 9521
  • Duration seconds: 1766
  • Timestamp note: No timestamps or chapters were present. The supplied transcript contains a substantial duplicated second pass of the presentation after the closing remarks.

Transcript

4829 words en Processed in 147.1s

Hello, everyone. I would like to walk you through how we can transition AI agents from an experiment to the real enterprise environment. So before I begin, a quick introduction about me. My name is Sharish Gagar. I'm a senior staff software engineer at Intuit Career Karma, where I built and own the AI analytics infrastructure and services. And besides that, I'm an advisor, author, researcher, and also a program committee member for various organizations where I mentor young researchers as well. All right. So let's walk through the agenda here. First, we would like to talk about what are the challenges we have when we build AI agents and deploy them into production systems and how we can build different frameworks to address those challenges. Then how the architecture looks like for it. Then how you can build your own MCP servers and MCP gateway. And then some monitoring on top of that gateway as well. Then further, we're going to talk about what are the different types of agent frameworks you can have. And then some additional frameworks around managing memories, tracking and eval, how you can block PII data going before the LLMs, and then context optimizer to save your tokens. Right. So without delay, let me walk you through the challenges. Of course, there are many reasons why agents generally fail in production because their foundation controls are missing. The key reason behind this is that most people are missing the gateway to make sure that agents can communicate to the gateway to get authenticated first with the right auth providers so that they can redirect to the right MCP servers. Second, those MCP servers are missing the right tools to execute your queries. Third, do we have enough tracking and evaluation systems to make sure that every query when you send to the agents has been tracked, and are you evaluating their quality response? Right. Do we have any memory management system? For instance, if you're doing long interactions with an agent for many days, is it able to recall what you've been asked in the past? Right. And then there are other frameworks. Do you have context optimizers to save tokens? Or do you have enough protections in place to make sure that any secrets should not go into LLMs or tracking or tracing or any memory DB? Right. So there are a lot of open questions. In order to resolve this, we are not going to build a magical agent here in this demo. We're going to talk about different frameworks that you can build to address this. So first is the agent framework. This is where we choose to use the LangGraph framework, which is provided by the LangChain community. This helps us in building task-specific nodes based on your questions and which is easy to plug in any marketplace plugins, skills, and prompts to make sure that agents respond efficiently based on your query. Further, the second part is we are also building the MCP gateway to make sure that whenever an agent makes a call or any service account from that agent makes a call, they securely get authenticated to that MCP gateway and then get redirected to the right MCP servers. Third is the customized MCP, which means that you are building your own MCP servers with the right tools in place to execute your queries. And then finally, some audit on top of what operations you're performing. Right. And then we talk about some additional frameworks around how you can block PII secrets, how you're going to store the tracking eval into the cloud, and how you're going to persist memories, especially any threads and checkpoints on every context. And then also how you can optimize your overall context to make sure that you don't burn too many tokens when you run your queries. All right. So we'll talk about now the agent infrastructure. First, we'll go through local development. The approach should be that whenever you build an agent, first you have to register your agent into some system. You usually tell that, hey, this is my use case. And these are the use cases going to use for this particular vertical or system. And you feed all that information and generate an ID for your agent. Right. Once you have that, then you can have a dev portal, an internal portal where you can ingest all the details saying that, hey, this is my agent use case. This is my agent ID. This is the framework I'm going to use, either LangGraph, LangChain, or so on. These are the languages I'm going to use, either Python or TypeScript. And then you can choose your skills or prompts. And then you submit your information. Once you submit this, the dev portal is going to create a repository which is going to contain not just the agent framework, like your LangGraph agent framework, but is also going to contain your memory framework, your tracking eval framework, right? And then your context optimizer framework and your PII blocking framework as well. The reason for that is because not necessarily all your developers are taking care of all these frameworks. They just sometimes create the framework what generally AI assistant tools generally support, or they stick to one or two frameworks. So we just want to make sure that when you roll out such frameworks, they are consistent across the company and they can be centralized in one place so you can visualize the results as well. Right. So once you have that repository, developers basically clone that repository, they can build their agent as a Docker image into containers and test their agent input and output through the query. And they can also test this on their local memory, maybe Cloud Spanner evaluator here. And you can also store this tracking eval in some of your DB, maybe SQLite or maybe BigQuery to make sure that agents are fully working on your local. So once your agents are running locally, then you are ready to go ahead and generate a PR. And then once you get your two PR approvals, it goes to the CI-CD pipeline. So the PR is basically going to firstly register your agent into some centralized agent registry system, which provides a language URL to it to make sure that you see all the traces. And then the CI-CD pipeline is basically whatever the local Docker container you built here is going to build that container into production system. It will scan that image, make sure that there's no vulnerability. If everything looks great and security approved, you can move that image into the registry. Further, you have your own deployment platform or orchestrator platform which is going to deploy that agent into the Kubernetes cluster in a given namespace. So the good part here is that this dev portal is not just creating the repository. It also creates a bunch of other production resources. For example, the workload identity and then memory DB or tracking and eval tables, and then agent secret management. So based on whatever name we provide, it not just creates a repository but creates all those different resources as well. So what happens is when this internal orchestrator deploys the agents, the agent already knows what workload identity it's supposed to work with. That binding should already happen. So once this KSC to GSA binding happens, the agent will start communicating to all these resources. Once everything is in place, the agent is further going to communicate to the rest of your endpoint services, like for example, AI gateway or MCP servers, or LangSmith for tracing or some other API endpoints. So now firstly, we talk about the MCP server architecture. Now we're going to the different components. MCP server is something that you can definitely use something which is available outside. But if you're working on an air gap environment, it's highly recommended that you build your own MCP servers. And you can use the FastMCP server package or wrapper to build those MCP servers. And you can create a different set of tools inside that FastMCP wrapper to construct your overall servers. And then you make sure that every tool when you define an MCP server has to be fully reviewed by your own internal security team to make sure that only authorized tools can go into production. And that's how you can enforce some filters, limits, and block the fields which are really not required to go to LLM and get you information which you're not supposed to get. And the third part is, of course, you need to make sure that you build your MCP server in a way that whenever traffic is coming from your MCP client to MCP gateway to MCP servers, either coming from a user or service account, they have to be authenticated to the MCP gateway first so that they can access your MCP tools to get that right information. to construct your overall servers. And then you make sure that every tool, when you define an MCP server, they had to be fully reviewed by your own internal security team to make sure that only authorized tools can go in production. And that's how you can enforce some filters, limits, and block the fields, which are not required to go to the LLM and get you the information, which you're not supposed to get, right? And third part is, of course, you need to make sure that you build your MCP server in a way that whenever the traffic is coming from your MCP client to MCP gateway to MCP servers, either from user or service account, they have to be authenticated to the MCP gateway first. And so they can access your MCP tool to get that right information. All right. Now the gateway part. So how the gateway works. So this is again, you can build your own internal MCP gateway if you are working on your air gap environment. So the way it works is you are working on cloud assist, like local code assistance tool or maybe your agent, right? So the moment you submit your first query to your agent, it will send that one-time authentication request to the MCP gateway, right? MCP gateway recognizes and takes your request. First, it will save your session state into the Redis, right? And then it will return back the JWE access token back to your client, right? Once client receives that JWE token, it will know what MCP server needs to call, right? So it will submit that tool slash call request on a given namespace slash MCP, meaning let's say artifactory or github slash MCP with the auth bearer token into that. So once MCP gateway receives that, it will understand what namespace, meaning MCP server, needs to look up for, and then it will unwrap that JWE token. And then it will attach that user token in that request and send it to the respective MCP servers. Now, once MCP server receives it, it will make that respective API calls to that endpoint, to the service. And then it will exchange that ID token and return the response based on whatever scope that user is authorized to see, right? So once the user receives the token, MCP server basically unwraps that all the data, makes the payload, which is compatible for MCP gateway to receive. And then finally, the final payload will send back to the client to see the data points. So what it shows is that we build this MCP gateway to make sure that we have a centralized authentication and routing hub that securely connects any coding assistant tool or agents to the endpoint via this MCP gateway and MCP server. There should not be direct access provided on any endpoints. There has to go through the MCP gateway through proper authentications before they reach to the MCP server and the endpoints. All right. So now the part is the gateway monitoring, right? We talked about architecture, we talked about MCP server, MCP gateway. Now it's monitoring. Again, the AI agent cannot be trusted without continuous monitoring, evaluation and feedback, right? This is why we are building the MCP gateway monitoring. So the way the monitoring works is usually like the moment you submit any calls to your agent, it will send all the operation logs into the log store. You can use ELK, Loki or Cloud Virtual Source, right? And generally this contains information like show me all last 401s in my last 10 minutes call, right? And what did or do when the token refresh failed, right? So those kinds of requests can go to the log store. Now there are traces and metrics data, real-time data that goes to the OpenTelemetry as well. OpenTelemetry is an open source solution, which is going to collect all your traces and metrics and is going to process the data and redirect to the backend system, right? And in this case, the traces will go to Tempo. This is an open source solution, which is going to store all your traces in terms of traces, like what was the exact error on this field code or so, right? So these kinds of data are going to store into Tempo. And then the metrics is about Prometheus. Prometheus is all about the information about what are P95 latencies for a given tool, right? Whether my auth rejection is spiking on a particular time or not, right? So those kinds of metrics is going to store in Prometheus. So once you get all this data point like traces and metrics, this entire aggregate data actually saves into Grafana for your visualizations, right? All right. So the MCP server, gateway and monitoring is covered. Now we're going to talk about the framework. So the agent framework, right? So we use LangGraph for most of the cases and it's basically LangGraph. It's provided by LangChain and the community provides a graph-based architecture that supports loops, branching and state management for complex multi-agent AI workflows, right? And the way it works is like the moment you submit your first query, we do interpret your question first, like what type of questions it is and what response is looking for. And based on that, it creates a plan, right? Then it will send for classify where it will determine that whether it is just a read operation or whether it's a modification level change coming up or whether you really want to delete something, right? Or some sensitive operations. Based on that, it adjusts the overall structure measure and then plan accordingly. The next step is plan is actually itself a sub graph where you do the measure of your operations, meaning that in the plan, once you know what operation you're performing, it goes to the fetch evidence section where it actually calls whatever question you ask. After all interpret and classify, it actually goes ahead and makes the call to the MCP gateway, make sure they get authenticated. And then it makes the call to the MCP server using the right tool and gets the data and then generates that evidence, right? Once you validate all your findings, then it will check the policies. It will check whether it is read only, then go ahead and execute and save all the record points into our audit logs. But if it is a write and sensitive operation, definitely it will go through the HITL process where you wait for an approval. If it is approved, you go ahead and execute. If it is rejected, in either case, it's going to save into the audit log, right? So if we combine all this together, like MCP gateway, MCP server, and the agent, right? This is how things look like. So ultimately, whatever the agent you are building, whatever the call you are submitting, it will go to the MCP gateway for authentications, and then it will redirect to the right MCP servers to execute your query on a given tool so that it makes the API call to that endpoint and gets the response, right? All right. If we think from the infrastructure perspective, this is how it looks like. So agent is communicating to the MCP gateway, goes to the MCP server, and to the endpoint. All right. So now we talked a lot about MCP gateway, MCP servers, the monitoring, and the agent framework. Now we talked about three and four additional frameworks that we should have to take care of when building the end-to-end ecosystem, right? One of them is agent memory management. Again, it's basically a process where you can save and restore the state of your workflow over time, right? Ensuring that it provides you durability and seamless recovery across every query run. So the way it works is like whenever you submit any query to your agent, it actually generates a thread, right? On that given thread, when you ask your first question, it will create a run ID for that. So the moment you ask some deeper questions, it will go to a particular node in that LangGraph and execute that query. And on that node, it's going to save that respective checkpoint there, right? Now, if you ask a follow-up question on the same thread, it's going to create another run ID. So the data is going to create a SQLite DB. And again, depending on your follow-up question, it goes to a specific node and saves the checkpoint over there, right? And all this data for your local development, you can use the SQLite DB. But in production, unless in GCP, you can use Cloud Spanner. And with respect to databases, you can use in Azure and AWS as well, right? So just walk you through the quick demo here on the memory. So for example, I have just built this agent locally and then trying to run this query on SQLite DB to see if there's any data or not. So I'm initially I don't have any data. Now I submit my query. You will see that I receive the one record, which is saying that this is my thread ID. This is the question I have been asked and exact time. So the data is going to create a SQLite DB. And again, depending on your follow-up question, it will go to a specific node and save the checkpoint over there, right? And all this data for your local development, you can use the SQLite DB. But in production, unless in GCP, you can use Cloud Spanner. And with respect to databases, you can use in Azure and AWS as well, right? So just walk you through a quick demo here on the memory. So for example, I have just built this agent locally and then trying to run this query on SQLite DB to see if there is data or not. So I initially don't have any data. Now I submit my query. You will see that I received one record, which is saying that this is my thread ID. This is the question I have been asked and the exact time when this query was executed. Now, if I run the next query to see how many messages I've produced on a given thread, you can get this information by running further queries, right? Now, if I would like to run to see all the metadata level information on my query, I can run my query again. And you can see the detailed description around how many tools I got invoked, what is my thread ID, what is my run ID, and all that information. Now, if I want to also see what tool has been executed when I run this query, you can go ahead and see the exact tool name as well on that given MCP servers. Now further, I also want to see how the progression happened on my LangGraph framework, that you can also see by running this type of query on your memory DB. You can see here different kinds of nodes being called when that query has been run. All right. Now the tracking and eval. So just to make sure there is no confusion here, like we talked about earlier, the MCP gateway monitoring is the agent level tracking. So we do this because we really want to track what query you have been submitting to the agent and what the response is coming, what LLM model you have been used, what's the cost of your token, how many tokens you have been burned, and what your evaluation criteria looks like, what is the quality of your response or not, right? So you need to store that data from day one. And imagine if you have a thousand plus agents, every agent will have their own agent tracking and eval project and tables, right? So if you combine, let's say if you have a hundred agents, you will have a hundred different projects, and each project has their own respective tracking and eval tables. Now tomorrow, six months down the line, if somebody asks you how your agent has been performing, what was the response, what was the quality, how much token you've been burned, you can aggregate all this data and you can create executive dashboards around it to see what is the ROI in building so many agents, right? So let me walk you through the tracking and eval demo here. So here, if I look at this one, if you see there are six tables listed here, one is a job tracking table, which contains most of this information around what query, what is your query, what's the response and everything. And there are a bunch of other tables as well, like your quality related and your tool invocations, and then node level executions and all that. So in this case, I'm going to submit my first query on my agent. And you will see that there will not be any data in the first place, because it takes some time. So I will refresh this again. And this time I will see that when I refresh, I do see that for a given query, I get my request ID, my session ID, my agent name, what question I've been asked, and what was the output of that question, whether it has completed or not. And then what is the time it took? What is the model I've been used? And then some of the metadata level information, right? Further, if I look for the quality, there is eight quality checks per run, right? And you can see that this one row, each for success, latency cost, tool accuracy, safety, etc. All this has been stored here. Right? Now the eval scores, this is a one row, this is going to be a scoreboard for your given run, which basically varies between zero to one, which scores all the quality dimensions in a single row. Right? Now the quality metrics. So it's a deep dive on that particular run, basically a nested field for the response, quality, safety, latency, cost, and the tool stat in one wide row. Right? Now the tool invocation. So every tool call, which MCP tool ran, how long it took, and whether it succeeded or not. Right? And now the tool agent trajectory, which is talking about step by step story of the run, each LLM call and the graph state in order, like plan, summarize, etc. All right. So now the next is the agent PII treatment. This is very important because many times it happens that when you're working in agents, sometimes there is a possibility that there are some secrets being ingested as a part of your query, right? Let's say you are uploading some doc which has some sensitive information. And sometime by typing, you may have some API keys or so. So we have a framework which defines different sorts of data types and their severity level. If your severity is above 90% or so, we will block and redact those secrets immediately. So we have to make sure that secret never goes to LLM models, right? Neither will it go to your memory DB or tracking and eval tables or tracing systems as well. So the goal here is to just block this sensor data as it is the moment it gets ingested, right? The moment you type. All right. The last framework is all about now is the context optimizer. This is one of my favorite areas where whenever you submit, it's very important. Whenever you submit too many queries, sometimes you upload a lot of data points and you upload a bunch of file systems or so, right? It's very important that you make sure that you save your tokens in every query. So we built in context optimizer framework where you actually shape your query and then you prune it before it goes to the LLM. In the pruning system, we select the payload based on the token limit. Then we re-rank that, which is the most relevant information that we should target when you submit this huge giant context. And then we dedupe that, remove all the duplicates and create a very unique set of very curated data for the LLM. And then we finally compress this large payload before it goes to the LLM. So let's see this demo here. This will be quick. So for example, let's say I will submit my first query. Hey, find me all the artifacts in my JFrog Artifactory. You see that first, even before I submit any query, there is no data here. So the moment I submit this first query. And if I refresh my query here, you can see that the record has been added. So you can see there is 24,000 tokens has been used. I will go back a little bit just to show the thing. So you can see this 24,000 tokens has been used for given questions. Now, if I ask, now I enable the context optimizer behind the scene and I'm reading the exact same query again. So this time you will see that for the same query, if I refresh this run, and you will see that this time it used just 2,400 tokens, right, for the exact same query. So which is almost like 90% saving. I can rerun the same demo on the Slack bot as well, where I'm asking Slack bot, hey, tell me all my Docker images across all the repositories in Artifactory. When I run this query, there is no data. Now I'm going to submit my query. So once this query will run, and if I run my query again here, you will see that the record gets created. It's again used like 24,000 for this particular query. Now what I will do is I will turn on my optimizer behind the scene and I rerun the same query in the Slack bot. So if I run this query again, it will show like it exactly used 1,500 almost tokens, which is again like 90% saving. In most of the cases, we get like 70 to 78% token saves. So imagine that you have thousands of... So which is almost like 90% saving, I can rerun the same demo on the Slack bot as well, where I'm asking Slack bot, hey, tell me all my Docker images across all the repositories in Artifactory. When I run this query, there is no data. Now I'm going to submit my query. So once this query will run, and if I run my query again here, you will see that record get created. It's again used 24,000 for this particular query. Now what I will do is I will turn on my optimizer behind the scene and I rerun the same query in the Slack bot. So if I run this query again, it will show that it exactly used 1,500 almost token, which is again 90% saving. In most of the cases, we get 70 to 78% token saves. So imagine that you have thousands of agents which are running many queries per day. Imagine how much token you can save with this framework. All right. So now the key takeaway here is for us: make sure that we build an enterprise framework, not just an agent, which makes sure that you have all the framework underneath. Don't try to be in rush to building some agent quickly and deploy it. Make sure that it has to go through all the framework all together so that you should not realize the literacy that I should have this framework in place, right, in the very first place. Second, make sure that you have a proper gateway system. Make sure that every tool call request, either you are doing this from your local or through agent, it has to go through some sort of centralized MCP gateway. Make sure it's authenticated before it reaching to the MCP servers, and then make sure that your MCP servers take control on what tool you should use to execute a particular query, right. And make sure that you have monitoring in place and complete auditing in place for that tool executions. And of course, you should keep the always human in the loop process for every action item, every high risk item. Make sure that there is observability and auditing has to be in place. And last but not least, make sure that context optimizer should always be there to justify your cost on your agent, right. So just want to share that I released my MCP book recently on Amazon. So feel free to download. It's free on Kindle, and hard copies are also available. All right. Thank you so much for watching this video. And if you do have any questions, feel free to reach out to me over LinkedIn or Twitter. I'm happy to answer. Thank you again. redirected to the right MCP servers. Third is the customized MCP, which means that you are building your own MCP servers with the right tool in place to execute your query. And then finally, some audit on top of what actually operation you're performing. Right. And then we talk about some additional framework around, you know, like how you can block the PI secrets, how you're going to store the tracking eval into the cloud and how you're going to purchase the memories, especially any threads and checkpoints on every context. And then also how you can optimize overall your context to make sure that you don't burn too many tokens when you run your query. All right. So we'll talk about now the agent infrastructure. So the firstly, we'll go through the local development. The way the approach should be is that, you know, like whenever you build an agent, right, first you have to register your agent into some system. You usually tell that, hey, look, this is my the use case. And these are the use case going to use for this particular vertical or system. And you feed all those information and generate an ID for your agent. Right. Once you have that, then you can have a dev portal, internal portal where you can ingest all the details saying that, hey, look, this is my agent use case. This is my agent ID. This is the framework I'm going to use either Langraph, Langtion or so. These are my language I'm going to use either Python or TypeScript. And then you can choose, you know, like your skills or prompts. And then you submit your information, right, to this. Once you submit this, the dev portal is going to create a repository, which is going to contains not just the agent framework, like your Langraph agent framework, but is also going to contains your memory framework, your tracking eval framework, right? And then your context optimizer framework and your PII blocking in by framework as well. So the reason for that is because not necessarily all your developers are taking care of all this framework, right? They just sometimes, you know, create the framework, what generally like AI assistant tool are generally support, right? Or they stick to one or two framework, right? So we just want to make sure that when you roll out such framework, make sure they are consistent across the company and they can take care of and they can be centralized in one place. So you can visualize the results as well. Right. So once you have that repository, so developers basically, you know, clone that repository, they can build their agent as a Docker image into containers and test their agent input and output through the query. And they can also test this on their local memory, maybe cloud spanner evaluator here. And you can also store this tracking eval in some of your DB, maybe SQLite or maybe BigQuery to see, to make sure that agents are fully working on your local, right? So once your agents are running in local, then you are ready to go ahead and generate a PR. And then you can, once you get your two PR approval, then it's go to the CI-CD pipeline, right? So the PR is basically going to, firstly, is going to register your agent into some centralized agent registry system, which provide a language URL to it to make sure that you see all the traces. And then the CI-CD pipeline is basically, you know, whatever the local Docker container you built here is going to build that container into production system. It will scan that image, make sure that there's no vulnerability. If everything looks great, security approved, you can move that image back into the registry, right? Further, you have your own deployment platform or orchestrator platform, which is going to deploy that agent into the Kubernetes cluster in a given namespace, right? So the good part here is that this dev portal is not just creating the repository, right? It also do create a bunch of other production resources, for example, the workload identity, right? And then memory DB or tracking and eval tables, and then agent secret management, right? So it based on whatever the name we provide, it not just, again, like not just repository, create all those different resources as well. So what happened is when this internal orchestrator, when it deploy the agents, the agent already know that, hey, what workload identity I'm supposed to work with, right? That binding should already happen. So once this KSC to GSA binding happens, the agent will start communicating to all these resources. Once everything in place, agent is further going to communicate to the rest of your endpoint services, like for example, AI gateway or MCP servers, or length use for tracing or some other API endpoints, right? So now firstly, we talk about the MCP server as well. So we talk about architecture. Now we're going to the different component. So MCP server is something that you can definitely use something which is outside available. But if you're working on air gap environment, it's highly recommended that you build your own MCP servers. So, yeah. And you can use the, I will not go with the definition everyone knows about it. So the way the framework has been built here is that you can leverage the fast MCP server package or wrapper to, you know, build that MCP servers. And you can create a different set of tools inside that fast MCP wrapper to construct your, you know, the overall servers. And then you make sure that, you know, like every tool, when you define an MCP server, they had to be fully reviewed by your own internal security team to make sure that only authorized tool can be go in production. And that's how you can, you know, enforce some filters, limits, and block the fields, which is really not required to go to LLM and get you the information, which is you're not supposed to get, right? And third part is like a, of course, you need to make sure that you build your MCP server in a way that whenever the traffic is coming from your MCP client to MCP gateway to MCP servers, either is coming from user or service account, they has to be authenticated to the MCP gateway first. And so that they can be access your MCP tool to get that right information. All right. Now the gateway part. So the how the gateway works. So this is again, you can build your own internal MCP gateway if you are again working on your air gap environment. So the way it works is you are working on cloud assist, like local, you know, code assistance tool or maybe your agent, right? So the moment you submit your first query to your agent, it will send that one time authentication request to the MCP gateway, right? MCP gateway recognized and take your request. First, it will save your session state into the Redis, right? And then it will, you know, return back the JWE access token back to the your client, right? Once client will receive that JWE token, it will know that what MCP server needs to call, right? So it will submit that tool slash call request on a given namespace slash MCP, meaning let's say artifactory or github slash MCP with the auth bearer generally token into that. So once MCP gateway received that, it will understand that what namespace meaning MCP server needs to look up for, and then it will unwrap that JWE token. And then it will attach that user token in that request and send it to the respective MCP servers. Now, once MCP server receive it, it will make that respective API calls to that endpoint of that, you know, to the service. And then it will exchange that ID token and return the response based on whatever scope that user is authorized to see, right? So once the user received the token, you know, MCP server basically, you know, unwrap that all the data, make the payload, which is compatible for MCP gateway to receive. And then finally, the final payload will send back to the client to see the data points. So what it shows is that, you know, like we build this MCP gateway to make sure that we have a centralized authentication and routing hub that securely connect any coding assistant tool or agents to the endpoint via this MCP gateway and MCP server. There should not be direct access provided on any endpoints. There has to go through the MCP gateway through proper authentications before they're reaching to the MCP server and the endpoints. All right. So now the part is the gateway monitoring, right? We talk about again, we talk about architecture, we talk about MCP server, MCP gateway. Now it's a monitoring. Again, the AI agent cannot be trusted without continuous monitoring, evaluation and feedback, right? This is why we are building the MCP gateway monitoring. So the way the monitoring work is usually like the moment you submit any calls to your agent. It will send all the operation log into the log store. You can use ELK, Loki or Cloud Virtual Source, right? And generally this contains information like show me like all last 401s in my last 10 minutes call, right? And what did or do when the token refresh field, right? So those kind of requests can go to the log store. Now there are some, you know, traces and metrics data, like real-time data that goes to the open telemetry as well. Open telemetry again is open source solutions, which going to collect all your traces and metrics and is going to process the data and redirect to the backend system, right? And in this case, the traces will go to the tempo. This is again, open source solutions, which going to store all your traces in terms of like traces in the sense, like, you know, what was the exact error on this field code or so, right? So these kinds of data are going to store into the tempo. Oh, my bad. Okay. And then the metrics is about the prometheus is all about the information about like what are P95 latencies for a given tool, right? Whether my auth rejection is spiking on a particular time or not, right? So those kinds of metrics is going to store in prometheus. So once you get all this data point like traces and metrics, this entire aggregate data back actually save into the graph enough for your visualizations, right? All right. So the MCP server, gateway and monitoring is covered. Now we're going to talk about the framework. So the agent framework, right? So we use line graph for most of the cases and is basically line graph. Again, it's a provided by language and community is provide a graph based architecture that support loops, branching state management for complex multi-agent AI workflows, right? And the way it work is like with the moment you submit your first query, we do interpret, you know, like your question first, like what type of questions it is and what response is looking for. And based on that, it's create a plan, right? Then it will send for classify area where it will determine that, hey, whether it is just like a read operations or whether it is just like a, you know, modification level changes coming up or whether you really want to delete something, right? Or some sensitive operations based on that, it adjusts the overall structure measure and then plan accordingly. The next step is plan is actually itself is a sub graph where you do the measure of your operations, meaning that in the plan, like once you know what operation you're performing, it goes to the, like, let's say in a fetch evidence section where it actually call that whatever the question you ask here, after all interpret and classify, it actually go ahead and make the call to the MCP gateway, make sure they get authenticated. And then it make the call to the MCP server using the right tool and get the data and then generate that evidence, right? Once you validate all your finding, then it will check the policies. It will check whether it is a read only, then go ahead and execute and I will save all the record points into our audit logs. But if it is a right and sensitive operations, definitely it will go through the HITL process where you wait for an approval. If it is approved, you go ahead and execute. If it is get rejected, in either case, it's going to save into the audit log, right? So if we combine all this together, like MCP gateway, MCP server, and the agent, right? This is how things looks like. So ultimately, whatever the agent you are building, whatever the call you are submitting, it will go to the MCP gateway for authentications, and then it will redirect to the right MCP servers to execute, you know, your query on a given tool so that it make the API call to that endpoint and get the response, right? All right. If we think from the infrastructure perspective, this is how it looks like. So agent is communicating to the MCP gateway, goes to the MCP server, and to the endpoint. All right. So now we talked a lot about MCP gateway, MCP servers, the monitoring, and the agent framework. Now we talked about three and four additional framework that we should have to take care of when building the end-to-end ecosystem, right? One of them is agent memory management. Again, it's basically a process where you can save and restore the state of your workflow over the time, right? Ensuring that it provides you a durability and seamless recovery across your every query run. So the way it works is like whenever you submit any query to your agent, it actually generates a thread, right? On that given thread, when you ask your first question, it will going to create a run ID for that. So the moment you ask some deeper questions, it will go on a particular node in that line graph and execute that query. And on that node, it's going to save that respective checkpoint here, right? Now, if you ask a follow-up questions on the same thread, it's going to create another run ID. So the data is going to create a SQLite DB. And again, depend on your follow-up question, it go to a specific node and save the checkpoint over there, right? And all this data for your local development, you can use the SQLite DB. But in production, unless in GCP, you can use Cloud Spanner. And in respect to databases, you can use in Azure and AWS as well, right? So just walk you through the quick demo here on the memory. So for example, I have, you know, like just build this agent locally and then, you know, trying to run this query on SQLite DB to see if there isn't data or not. So I'm just, you know, initially I don't have any data. Now I submit my query. You will see that I received the one record, which is saying that, hey, this is my thread ID. This is the question I have been asked and exact time, you know, when this query was executed. Now, if I run the next query to see that, hey, how many messages I've been produced on a given thread, you can get this information by running the further queries, right? Now, if I would like to run to see that, you know, like all the metadata level information on my query, I can run my query again. And you can see the detail description around, you know, like how many tool I get invoked, what is my thread ID, what is my run ID, you know, like, and all those informations. Now, if I want to also see that, hey, what tool have been executed when I run this query, you can go ahead and see the exact tool name as well on that given MCP servers. Now further, I also want to see that how the progression was happened on my Langrub framework, that also you can see by running this type of query on your memory DB, you can see that here, like different kind of, you know, nodes been called when actually, you know, that query has been run. All right. Now the tracking and eval. So just to make sure that there is no confusion here, like we talked about earlier, the MCP gateway monitoring, this is the agent level tracking. So we do this because we really want to track that what query you have been submitting to the agent, and what the response is coming, what LLM model you have been used, what's the cost of your token, how many token you have been burned, and what's your, you know, evaluation criteria looks like, what is the quality of your response or not, right? So you need to store that data from the day one. And imagine that if you have a thousand plus agent, every agent will have their own, you know, agent tracking and eval project and the tables, right? So if you combine, let's say if you have a hundred agents, you will have a hundred different projects, and each project has their own respective tracking and eval tables. Now tomorrow, six months down the line, if somebody asks you that how your agent has been performed, what was the response, what was the quality, how much token you've been burned, you can aggregate all this data and you can create executive dashboards around it to see what is the ROI in building so many agents, right? So let me walk you through the tracking and eval demo here. So here, like if I look at this one, so first, like, you know, like if you see that there are six tables are listed here, one is a job tracking table, and which is contains most of this, like, information around what query, like, what is your query, what's the response and everything. And there are a bunch of other tables as well, like your quality related and your tool invocations, and then node level executions and all that. So in this case, I'm going to submit my first query on my agent. And you will see that there will not be any data in the first place, because it takes some time. So I will refresh this again. And this time I will see that when I refresh, I do see that for a given query, I get my request ID, my session ID, my agent name, you know, what question I've been asked, and what was the output of that question, whether it has completed or not. And then what is the time it took? What is the model I've been used? And then some of the metadata level information, right? Further, if I look for the quality, again, there is an eight quality checks per run, right? And you can see that this one row, each for, you know, like success, like latency cost, tool accuracy, safety, etc. Like all this has been stored here. Right? Now, the eval scores, this is again, this is going to be a one row, this is going to be a scoreboard for your given run, which is basically varies between zero to one, which is scores, you know, like all the quality dimension in a single row. Right? Now the quality metrics. So again, it's a deep dive on that particular one run, basically a nested field for the response, quality, safety, latency, cost, and the tool stat in one wide row. Right? Now the tool invocation. So every tool call, which MCP tool ran, how long it took, and whether it succeeded or not. Right? And now the tool agent trajectory, which is talking about step by step story of the run, each LLM call and the graph state in order, like plan, summarize, etc. All right. So now, the next is the agent PII treatment. This is very, very important because many times happens that when you're working in agents or this thing, sometimes there is a possibility that there are some secret being ingested as a part of your query, right? Let's say you are uploading some doc, which has some sensitive information. And sometime by typing, you may have some API keys or so. So we have a framework which define that different sort of data types and their severity level. If your severity is above 90% or so, we will block and redact that secrets immediately. So that, you know, we have to make sure that secret is never goes to LLM models, right? Neither it will go to your memory DB or nor it will go to tracking and eval tables or tracing systems as well. So the goal here is to just block this sensor data as it is the moment it gets ingested, right? The moment you type. All right. The last framework is all about now is the context optimizer. This is one of my favorite area where like you know, whenever you submit, it's very important, right? Whenever you submit too many queries, sometime you upload a lot of the data points and you upload a bunch of files systems or so, right? It's very important that time is, you know, like you make sure that you save your token in every query. So we build in context, optimize your framework where you actually shape your query and then you prune it before you go to LLM. In the pruning system, we do select the payload based on the token limit. Then we re-rank that, hey, which is the most relevant information that we should target for when you submit this huge giant, you know, context. And then we dedupe that, remove all the duplicates and create a very unique set of very curated data, like, I mean, the main data for the LLM. And then we finally compress this large payload before it goes to the LLM. So let's see this demo here. This will be quick. So for example, let's say I will submit my first query. Hey, find me all the artifacts in my Jeffrova Artifactory. You see that first, when even I not submitted any query yet, there is no data here. So the moment I submit this first query. And if I refresh my query here, and then you can see that the record has been added. So you can see there is a 24,000 token has been used. I will go back a little bit just to show the thing. So you can see this 24,000 token has been used for given questions. Now, if I ask, now I enable the context optimizer behind the scene and I'm reading the exact same query query again. So this time you will see that, you know, for the same query, if I refresh this run, and you will see that this time it used just 2,400 token, right, for exact same query. So which is almost like 90% saving, I can rerun the same demo on the Slack bot as well, where I'm asking Slack bot, hey, tell me all my Docker images across all the repositories in Artifactory. When I run this query, there is no data. Now I'm going to submit my query. So once this query will run, and if I run my query again here, and you will see that record get created, it's again used like 24,000 for this, this particular query. Now what I will do is I will turn on my optimizer behind the scene and I rerun the same query in the Slack bot. So if I run this query again, it will show like it exactly used 1,500 almost token, which is again like 90% saving. In most of the cases, we get like 70 to 78% token saves. So imagine that you have thousands of, you know, like, if you have thousands of like agents, which is running like, you know, many queries per day, you imagine how much token you can save with this framework. All right. So now the key takeaway here is, you know, like for us is like, make sure that we build an enterprise framework, not just an agent, right, which makes sure that you have all the framework underneath. Don't try to be in rush to building some agent quickly and deploy ship it, make sure that it has to go through all the framework all together so that you should not realize the literacy that, you know, I should have this framework in place, right, in the very first place. Second is like your make sure that you have a proper gateway system, make sure that every tool called request, either you are doing this from your local or through agent, it has to go through some sort of centralized MCP gateway, make sure it authenticated before it reaching to the MCP servers, and then make sure that your MCP servers take a control on what tool, you know, you should use to execute a particular query, right, and make sure that you have monitoring in place and complete auditing in place for that tool executions. And of course, you should, you know, keep the always human in the loop process for every action items, every high risk items, make sure that there is an observability and, you know, auditing has to be in place. And last but not least, make sure that context optimizer should always be there to justify your cost on your agent, right. So just want to share is that I released my MCP book recently on Amazon. So feel free to download, it's free on Kindle, and it's hard copies also available. All right. Thank you so much for watching this video. And if you do have any questions, feel free to, you know, like reach out to me over LinkedIn or Twitter. I'm happy to answer. Thank you again.