# Optimizing AI Agent Context Quality

**Podcast:** The AI Native Dev - from Copilot today to AI Native Software Development tomorrow
**Published:** 2026-11-24

## Transcript

Overwhelming the agent with context, that's always going to be bad.
It's going to have too much context.
It's not going to listen to the right pieces.
And also I would say counter-intuitively not only too much context, but it can also be too little context because of the way that people today are opening the firehose, which is usually through MCP servers, right?
When you provide an agent with like 10 different MCP servers and it starts asking them for context, it might stop after the third MCP server, right?
Because it thinks, oh, I got some context now, let's move on, right?
But what if there's more relevant context?
in the other data sources.
The AI Native Dev is a podcast for developers and engineering leads at the cutting edge of AI and agentic coding.
Join your hosts, Guy Pajani, and me, Simon Maple, every week as we chat with the most exciting voices in AI and tackle the biggest questions facing developers today.
This is the AI Native Dev.
AI DevCon is coming back to London.
Our first London event sold out in June.
After our second New York event this November, we're heading back to the brewery Moorgate in 2027 with a bigger line-up and two full days of talks from the people actually building with agents.
You'll hear honest takes on where the industry's at, real stories from teams adopting AI, the wins as well as the messy bits, and where they think things are heading next.
It's on June 7th and 8th.
And don't tell anyone, but we've got a really great deal for you.
Scan this QR code to grab an early bird ticket for just £100.
See you in London.
Hello and welcome to another episode of AI Native Dev.
And again, I'm wearing this ridiculous yellow shirt.
That can only mean one thing.
I'm at AI DevCon in New York again.
And actually right now, I think Shavam Jindal...
Previously working at Cursor, obviously acquired by SpaceX AI, is giving a session right now on how Cursor and now SpaceX AI are using software factories and how Cursor on Cursor, SpaceX AI on Cursor is working.
So we're live at AI DevCon.
And joining me, look who I bumped into, an alumni of the podcast, Brigitte Buckler.
Brigitte.
Another welcome, kind welcome to the podcast.
How are you doing?
Good.
Thanks for having me again, Simon.
It was a really nice conversation last time, so I'm sure it's going to be the same today.
I remember it well.
But actually, a few things have changed, one of which your role.
You are now a Principal Engineer at Unblocked.
Tell us a little bit about the new role and the company.
Yeah, so I used to work for ThoughtWorks, a consultancy, and my role there was all about, you know, building up the company's subject matter expertise around using AI on software teams.
And I recently made a change after almost 14 years in the same place, and I joined Unblocked.
They're a startup out of Vancouver, Canada.
I was saying before, you know, I'm dressing the part.
I just moved to Canada, right?
And so Unblocked basically builds a context layer for software engineering.
teams.
So, you know, more colloquially, people call it like company brains, right?
Organizational brains, right?
Context layer, context engine, there's like different terminology for it out there in the market right now.
And it's basically connecting your agents and humans as well, for that matter, to all the environmental information that there is, right?
Your Slack threads, all of your PR discussions, previous PRs, commit history.
your wiki, whatever you have in your environment to plug in and kind of like put a big, you know, let's say like search engine.
So kind of like retrieval reasoning over what's retrieved, resolving conflicts and so on in front of that to really give agents and humans a good signal to noise ratio about all the stuff that's going on in their environment.
And there's some really interesting challenges before we jump into the context layer.
There are some really interesting...
security, least privilege, kind of like challenges there about what context should the LLM, the agent, have access to?
Obviously, there is sensitive data there as well.
And where you put the security checks, is that something that the LLM should think about?
Is that something that should be done before giving the LLM context?
Is that something that are fairly reasonably big?
topic of discussion yeah i mean definitely not the llm right yeah it shouldn't it should be filtered even um before that and um i mean maybe i can already like take a smaller step back and like uh talk about i was i was telling you before about this great article in the communications of the acm uh about uh context quality right so it's a group of authors some people from dx nicole force grant some other people wrote about what are the quality categories, the quality attributes that we want context to have when we give it to agents.
And they came up with a really good set, I think.
They call it cafes, C-A-F-E-S, and the S is kind of in brackets, not because it's an afterthought, but because security should be like a...
an overarching thing.
And we can talk about the other ones later, but the security one, of course, is super important.
And they put it in two categories.
One is you don't want untrusted content in your context, right?
So hashtag prompt injection or injection, whatever.
And secondly, you don't want the agent to have access to information that it shouldn't have access to, right?
And that's like the really tricky thing.
Like, first of all, is the agent...
acting on behalf of a human so it has the human's permissions or is the agent like its own entity that has certain permissions depending on the task and also when you have agents that can post information in different places where other people might see it as well you have to think about you know context that Simon can know but Birgitta is not allowed to know like leaking over to me right so for example when you have a slack bot that is answering questions based on this context it's answering it uh with the permissions of the person who asked the question but it might be in a public channel yes so it's first like you know i would see like uh simon asked unblocked a question but simon still has to approve that the rest of the channel may see this right so it's like all of these types of things that you have to think about to not leak things and run into the lethal trifecta.
Yeah, absolutely.
And it's fascinating.
It's fascinating to, you just can't trust it.
Like you say, absolutely not the LLM.
We can't trust the LLM to make these decisions.
And maybe, maybe we'll talk a little bit about, about guidance versus real policy, like actual, you know, saying you can never do this.
The LLM just doesn't respect that in any way.
Well, it'll try to, but you're not guaranteed it will respect that.
So you have to put this outside of the LLM decision because you need it to be right and deterministically right every time.
Super interesting.
Earlier today, you gave a session and the session was called Context Does Not Equal Context.
Tell us a little bit about what that means.
In my Java brain, I'm thinking there's an object equality versus a string equality, but that's just my geeky nerdy.
Yeah, it's always like, does it have two equal signs or no?
Exactly, right, yeah.
So yeah, let's not like make it more complicated than it is.
Yeah, so I mean, it's always, it has really started bothering me like over the last year or so, like the way that we use the word context because it seems to have lost all meaning somehow, right?
And it like, it occurred to me the other week that maybe it's because we call it the context window.
So an agent or a model has obviously its context window and everything that's in there, all the tokens that are in there, we call context now.
But we also don't say our customer data is bytes and our code is bytes as well.
That's not useful for us.
All of these bytes have different meanings.
So there's all of these.
I think we should have more categories of...
what types of context we have and, you know, depending on the category, we need to do things differently in how we engineer it, right?
So, for example, yeah, you were already talking about guides or like feed forward feedback, right?
What role does this context play in my workflow, right?
Is it like part of the guidance or is it part of giving feedback, right?
So that might lead to different things.
Who is the context coming from?
Where is the context coming from and from whom?
And what are the permissions?
There's all of these different things, right?
And what I talked about today is one specific lens on that, which is kind of we have a bucket of context that is very deliberately authored and reusable, right?
So those would be skills, agents MD files, maybe a set of predefined rules and natural language for our code review, right?
So that's all very...
codified.
So we really think of it almost as code.
We want to version it.
We want to have evals on it and all of that because it's very reusable and therefore has a huge impact on what agents are doing, right?
Built to be context as well.
Purely built to be context and nothing else.
Yeah.
Yeah.
It's deliberately for that.
Yeah.
And then there's another bucket of context that is this kind of like more, you know, what Unblocked is providing, for example, that is more ambient, right?
So it's kind of like connecting the agent to the...
constantly changing environment.
So that type of context is not as reusable and it's changing all the time.
So we don't really have like a chance to deliberately sit there and constantly update it.
Right.
So it's really all these signals in the environment that that happen around the agent.
And then why is it useful to distinguish between the two?
It's because we need very different delivery mechanisms to get those to the agent.
Right.
Like.
Skills, like I said, maybe you have them in a registry or in a repository and you want to somehow distribute them to everybody, right?
But then on the other hand, with the ambient context, you need really like a big pipeline of deciding what information do you index?
How do you keep the permissions and respect them?
And then it's really put together just in time when an agent asks for additional context during planning or something like that, right?
I mean, Patrick Dubois, right, also a regular speaker at AI DEF CON and part of the programming committee, I think, right?
So he's been talking about the context delivery lifecycle, right?
Specifically in the context of this codified context, right?
Again, evals, versioning, and so on.
Treating it as code, essentially.
Yeah, codified, literally, right?
And so what I was then talking about this morning was in the context of unblocked context.
No pun intended.
The word can be used for so many things.
But yeah, what I was talking about was what does that context delivery lifecycle look like for ambient context that changes, that is dynamic all the time, right?
Yeah, absolutely.
And during that session, actually, one of the things, interesting areas that you went into is talking about organizational context.
First of all, what do you mean by organizational context?
Yeah, so that's basically, I think I didn't literally use that word, but that is basically what I just, described, right, that this environmental context, so everything that's relevant for an agent to deliver software, right.
There's also, I mean, there's...
Yeah, the terms in the market are kind of, like I said, like context layer, context engine.
Some people call it enterprise AI search or like just like the company brain or something, right?
And I think there's like different buckets there as well.
And one of the buckets is specifically for software teams, right?
So there's kind of like enterprise AI search specifically for software teams.
And we have like a big advantage in our domain of software delivery that we actually have at the core of everything.
We have a source of...
reality, which is the code, right, which can actually play a huge role in all of this reconciliation, like after the retrieval, like when there's conflicts between information, you know, the code often actually can settle that, right?
Or we can take the history of our code and derive who is an expert and what from it.
And again, that can help us resolve conflicts and stuff like that.
So in the software delivery domain, we have this big advantage of having that piece of truth or at least reality in the middle of it that can really help make, yeah, settle a lot of or put a lot of balance into this system.
And very often intent debates as well versus code that doesn't always hold intent.
It rather holds the status quo of what's happening today.
So for example, like a designer.
might be using Figma with AI to create designs, but then at the same time have access to all of the information in the environment, including the code in a functional way.
So they can kind of go, oh, this change doesn't make sense because it contradicts with how the feature is currently built in that area.
So there's this constant feedback without them having to go to an engineer for every single thing.
So they can just take like, have stronger assumptions about what they're doing.
And what are the symptoms of, for example, if people are using organizational context, what is the symptom that a development organization is using that is weighting the organizational context all the same?
And so they kind of like throw it all in.
What are the typical symptoms that maybe our listeners are already seeing?
but they don't necessarily know it's because of a potentially a weighting issue, you know, in the agent recognizing this is more important context than this context.
Yeah, I would say it's the signal to noise ratio, right?
Like, so I mentioned before these quality attributes, right?
The C-A-F-E, and I think I didn't even spell out what they are, right?
So they are like clarity, actionability, fidelity, and efficiency.
And the fidelity and efficiency are the ones that you can kind of, that are super important for the organizational context.
So fidelity is how much can the agent trust the truth of the context that it gets.
And efficiency is what's the signal to noise ratio, right?
So when you just open the fire hose and it's only retrieval and there's no other...
reconciliation and reasoning about it, then, yeah, there can just be a lot of distraction for an agent.
And there's, again, like the conflicting information, right?
If you...
Potentially getting answers wrong as well.
So it's overwhelming, the agent with context.
That's always going to be bad.
It's not going to have too much context.
It's not going to listen to the right pieces.
But actually getting things wrong as well, because some of the context could be stale, out of day, or actually you've got...
pieces of conflicts where one is right, one is wrong, but because they're weighted the same, it struggles to understand which one is true.
And also I would say counterintuitively not only too much context, but it can also be too little context because of the way that people today are opening the fire hose, which is usually through MCP servers, right?
So when you provide an agent with like 10 different MCP servers and it starts asking them for context, it might stop after the third MCP server, right?
Because it thinks, oh, I got some context now, let's move on, right?
But what if there's more?
relevant context in the other data sources.
So if you have it all in one system, then you have a much more holistic kind of set of data.
So it's almost like when you, yeah, like let's say an agent that has a bunch of MCP servers connected that it gets context from, it is a search function ultimately.
And so the agent, the large language model basically has to take care of precision and recall, which is like when you actually build something for that, specifically with all of the techniques, like some of the techniques that we've had before about search and some of the new techniques that we have with vectors and so on, right?
It's like much better technology to actually get good precision and recall than when you leave that to a large language model bumbling along in a coding session.
And when we think about when that organizational context is most valuable, is it more at the planning stage?
implementation stage?
Are there different times when certain types of context from the organization will be more valuable during the lifecycle, the workflow?
Yeah, definitely.
I recently experienced this myself when I onboarded to Unblocked and I got a task to do in the code base.
It was a really interesting experience.
I said, don't give me any context from the humans.
I first want to try it with the product.
And so during the planning phase in particular, so I went into kind of like a grill me skill with Claude, you know, like asked me lots of questions and it had access to Unblocked.
And it surfaced like so many useful things to me that I would never have known as a new joiner otherwise.
Right.
So I could, again.
create a really strong set of assumptions to then sit down with one of the engineers who had been on the team for a while and kind of go through the open questions and what I had found and double check it and so on.
And then later, when I went into the actual implementation based on the plan that I had made with Claude, it mostly actually relied on the code, which is also a kind of ambient context, right?
But it's the...
access to code is of course like built into our harness right so we don't need to build like think about it in extra way so during implementation just the harnesses access to the local the code in our mono repo was enough mostly to do the implementation right but whenever I kind of hit like new open questions or like things that hadn't quite worked out with the plan then it would become useful again right so I did kind of like an analysis on all my coding sessions after I had finished that to kind of see like where was the highest usage and also impact of this context and it was definitely more during the earlier the planning phase.
I presume this is when it's super important as well to have different environments and different context windows completely separate yeah because So much of the context from a planning may be completely stale in an implementation.
You don't just want one agent to do more than it should.
You want them to be very focused on a specific task with the right context.
And it's also about preventing rework later, right?
I think one of the things during the onboarding that happened to me is that I think intuitively I was building something and I was going for, oh, I probably need a feature toggle for this.
And I knew the team had some kind of feature toggle system.
But before I could even look into how that works, the agent had already told me, oh, hey, look, this would actually be a really nice way to test it just for your organization and the customers won't see it yet.
And so I had a much easier way of doing this without spending a while to figure out how does feature toggling work, right?
Which is not just a technical code thing, but you also have to understand what is the impact on the rest of the team and the customers.
So it would have taken me quite some extra time.
So what happens when there are conflicts then?
So let's say there's two pieces of context that are almost like jostling for position because they're essentially saying two different things and they can't be both right.
Maybe one's a readme, maybe one's a slack message.
First of all, who makes the decision?
And secondly, how is that determined?
If the readme's right or if the slack is right?
What's the process for?
I'm also only just like starting to discover exactly what techniques the team is using, right?
So there might be more than I'm aware of at this moment.
But I would say it starts with like just basically having an LLM reason about the conflict, right?
That's already helpful, right?
And then it all depends on what are the signals, what is the information that this LLM, so basically like our agent, right, has available to resolve that conflict.
And one of them is, of course, obviously recency, right?
So it has all of this metadata, including when was this piece of information created, right?
Is the Slack message from six months ago or from yesterday?
And is the, you know, when was the README last updated, right?
But then there's also these other signals, including, like I was mentioning before, the code, right?
What is the most recent state of the code, right?
So when it's something related to that.
often like 50% of the conflicts can just be resolved by looking at the current state of the code, right?
And then there's other things you can do like in Unblocked, there's like an expert graph that is derived from the commit history.
So you know, Simon knows a lot about this area of the code base that the person's working on just now.
And so whatever Simon said on Slack should be like the gospel.
Right?
And not what Vigitta said, who just joined the company.
So you see, as Simon says, Slack bot is what you mean.
Very good.
Yes.
And so, yeah, that's just like one of the other signals.
So you can kind of try to, part of it is in like how you prompt that agent and how it should resolve this.
Part of it is in what metadata you provided.
Part of it is in like supplementary information, like an expert's graph that you kind of like update continuously.
So...
I think in other tools, maybe there's also signals like organizational hierarchy.
Some people might argue that, you know, somebody at the top of the hierarchy should not be listened to.
Right.
But, you know, so I don't know quite how these other tools are doing that.
But all of those like networks between people can also be a good indicator.
Right.
I'd also love to talk and I'll help you out with this next answer.
The answer is it depends.
But let's chat through it because I'd love to.
I'm sure there's good ways that we can think about this.
Whenever something useful from a conversation, a piece of context maybe in a Slack thread or something like that, when something like that becomes...
not key necessarily, but something which can persist and that we want the agent to remember and think about.
We might want to turn it into something which is maybe more organised, maybe part of an existing skill or maybe a rule or something like that.
I guess, what's a good way for our listeners or us to think about when that promotion or transition should exist for...
I guess, what were the two types of contexts?
Codified and ambient is what I call them.
So when does ambient really become codified, I guess is my question.
Yeah, so I would say one of the big distinctions that I mentioned in the beginning was reusability, right?
Like when there's a piece that is just relevant to so many of your sessions that you just want to like have it right there and just more reliably be part of the session, right?
And then another thing to watch out for is maybe like typically the codified context is usually very prescriptive.
Like it's norms, coding conventions, it's instructions for workflow and stuff like that, right?
So whenever it's that type of like prescriptive stuff that you feel like is relevant to a lot of your sessions, then it probably belongs there.
But you probably shouldn't put stuff in there that changes a lot, right, in the environment.
So be careful not to put that into the codified context.
But also be careful, like you were saying, right?
When something's in ambient context that is prescriptive and is needed a lot, then you shouldn't just trust on like an MCP server or a context engine to magically surface that for you, right?
Because it's more important, right?
So I would look out for, yeah, usability and prescriptive stuff.
It seems to me that decision models could, you know, decision models can be used everywhere, right?
A lot of the discussion that we've had are kind of like decisions that a model or an agent needs to make.
Actually, a level of confidence would actually be super valuable here as well.
Is this something that is very valuable in this kind of area?
Yeah, the team has been experimenting with things like JEV in different parts of the engine already.
I don't know if they've...
done it specifically in the examples that I mentioned.
But for example, there are also a lot of decisions to be taken before you even index something.
So like I was mentioning, part of this is retrieval, of course, is retrieval augmented generation before you do the reasoning over it.
But you don't want to index every single thing.
Slack thread that you have, right?
Some of them are just like people talking about the weekend or, you know, just like making a joke or something, right?
So there's this like, there's definitely something in place that decides, you know, will we index this Slack thread or will we not, right?
So that's, I can imagine like one really good example of where that could help.
Or also, yeah.
and conflict detection and yeah so there's like lots of good use cases for that as well which may be actually the speed and the the cost although of course luna is equally cheap these days yeah and very fast as well um i guess this kind of we're talking a lot about you know the the giving the agent the highest chance of being successful with its action um That won't always, obviously, even if we give it all the correct information.
High context quality, basically.
Yes, and even if we give it the best quality context, it still doesn't guarantee you're going to get the correct outcome.
So when an agent keeps making the same mistake over and over, how do you decide what the change is required to improve the outcome?
Maybe it's better improved guidance, or maybe it's stronger sensor checking.
How do you make that decision?
I mean, it's a very big question, right?
And it's one that lots of people are grappling with right now in terms of like, how do you know that your harness set up, like, you know, the combination of the harness itself and all the things that you kind of like plug into it, right, that they're actually working and how to improve them, right?
It's like a super tough problem, I think.
I think there's like some things...
Evolving now there's a lot more really like observability data, right?
So some of the harnesses now support open telemetry so that you can send some like basic data about what's happening, but we need a lot of qualitative data, right?
So that's not really enough.
But then there's more evolving in the sense of analyzing the transcripts, right?
The agent.
traces, right?
So there are some products emerging in that space.
There are some organizations who try to get their developers to send all of the transcripts of all their coding sessions to a place so that they can be analyzed there to see what can we improve, right?
Which, of course...
a lot of engineers don't like very much because it feels kind of like, you know, imagine like all the people who don't like pair programming who now are supposed to share.
So yeah, it's an interesting problem there.
But you can, of course, like ask your agent yourself, right?
So a lot of people have skills that at the end of a session, ask the agent to reflect on the session and kind of say like, you know, was there anything?
that we can improve in our general setup, agents MD and so on.
I've also done, as I was mentioning, for example, during my onboarding sessions, when I was trying to understand what was the impact of Unblocked on my sessions, you know, I asked Cloud Code and I was using Codex as well.
So I asked them, like, look at all the conversations and tell me, like, what impact this had and, like, how I can improve the usage of this context.
And then finally, like when it comes to because you mentioned sensors, right?
So something that gives feedback that ideally is even deterministic, right?
Like, I mean, simplest example, but definitely not the only one is a linter, right?
I would like whenever there's any way to have like a CPU based deterministic tool, like do a lot of the checking, I would like always go for that and try to like reduce all of my markdown.
To a minimum.
It's a parallel, but this is exactly why we brought in TESOL verifiers.
It's a part where sometimes if you give too much to an agent during a code review, it'll actually sometimes not go over certain things in the code review thoroughly enough.
Whereas sometimes if it starts missing a couple of things, having a TESOL verifier, which more deterministically performs the same check, but a smaller, simpler check, still by an LLM, but deterministically calls it.
actually provides you with a way better chance of hitting that issue, identifying those across the board.
And there are so many knobs to turn, and that's, of course, the challenge that people have with knowing, okay, when I turn this knob, and then the next day there's a new model and suddenly things fall apart again, right?
But I think something that...
Somebody was asking me about that today.
is it better if everybody has their own setup or if we share it or right?
I think because it's also not so easy with AI to just build your own custom setup, a lot of developers have like all of their own.
And I think you've also seen that in your data at Tesla that people don't like using other people's skills and all of that, right?
And of course it takes time.
You have to sit in a room and coordinate and agree on like, what do we want to use, right?
But there's like so many knobs to turn and Every individual has good ideas of how to, you know, or different type of perspectives on how you can make it better.
So I think it is definitely worth also sharing with each other and figuring out a shared setup that actually has everybody's learnings and improvements inside of it, right?
Hey, everyone.
Hope you're enjoying the episode so far.
Our team is working really hard behind the scenes to bring you the best guests so we can have the most informative conversations about agentic development.
Whether that's talking about the latest tools, the most efficient workflows, or defining best practices.
But for whatever reason, many of you have yet to subscribe to the channel.
If you're enjoying the podcast and want us to continue to bring you the very best content, please do us a favor and hit that subscribe button.
It really does make a difference and lets us continue to improve the quality of our guests and build an even better product for you.
All right, back to the episode.
So before we have a look at the session that you gave at DevCon, let's wrap up with some advice.
What would you say to the average developer or organization that are probably growing their context?
How can they take steps?
to really recognize how to create high quality context that will have a positive impact on their agent works.
Yeah, I think the first step might even be like getting more...
getting a better grip on like that there are these different types, right?
And what types of practices are useful for what types of context, right?
We talked about the codified part to kind of see, okay, what are really our core things that influence a lot of our workflows?
Maybe we can create more skills in those areas, right?
Or there's like this...
constant advice to reduce the amount of guidance you have because the models can do all of this themselves now, right?
So that's like all about the codified part, but then also become more aware of the ambient context, both of the many different ways in which you can actually get it to the agents, right?
And also in terms of, you know, what is...
in my presentation I call it the ambiance, right?
So what's even available and how does that get to the agent?
And maybe even if you don't have a context layer or context engine, maybe consider something like that, of course, right?
Or also as a developer, if that's not available in my environment, but I have multiple MCP servers connected, maybe think about those things like...
conflict detection and stuff like that and give your agent a little bit of help like what signals it should be looking for to to resolve the conflicts.
So that's almost like increasing the quality of the context that the agent should be using rather than just overall quality.
So if you have certain things and there are conflicts, it's just providing the agent with just enough.
that they need and making sure that what they do get is the highest quality.
Yeah, and maybe look at that CAFES framework and maybe think about, you know, can you maybe derive prompts, analysis prompts or something from that that helps you analyze, like in a session, like how, you know, how is the quality of the context in this session?
And, you know, maybe from those angles might also be interesting to see how models are interpreting it from those different lenses.
Awesome.
Birgitta, this has been another fascinating conversation.
Really pleased we got to get you on the podcast for a second time.
Let's now watch your recording of your session in full.
Great.
Yeah, morning, everybody.
It's nice to give a talk in daylight for once.
We're often like stuck in these dark rooms, right?
So yeah, at this conference, there will be a lot of content about software factories or more generally, how do we increase agent autonomy and reduce our own supervision in a way that we still have high trust in what the agents are doing, right?
And I think at this point in 2026, everybody agrees and has heard this thing like, oh, context is really important, right?
But there's this thing that has always bothered me about us all using the word context, which is that it's like very fluffy, very high level, like certainly it's not just one thing, right?
And the other week it kind of hit me.
It's like maybe it's because we call it the context window, right?
And at that level, at the inference level, it makes sense to call it context because everything, all the tokens in the context window, our context for the token prediction, right?
But on a semantic level, for us kind of like thinking about how do we engineer this context, how do we get it to the agent, what are the different types of context we need, we need to have more categories of this, right?
We also don't say customer data is bytes and I don't know.
Yeah, so we don't call every kind of data bytes, right?
We look at this, so there's different types of context here in this example.
There's an agents.md file.
There's what I type in as the human, as my intent, or speak into the machine.
There's maybe a skill file that defines a workflow I want to use.
There's maybe some discussion about a feature in Slack, and I might have an MCP server that can pull that in.
There's a wiki.
There's maybe an architecture markdown file.
There's all of these different things in there.
You know, there's differences between these, right?
Some of these are instructions, kind of the workflow instruction, for example.
Some of these are kind of descriptions of the status quo of the system.
Some of these are kind of like history of decisions of what the team has been talking about.
So that's one way to, you know, how these things are different.
Some of these, in this case, are all feed forward, right?
They're all guides.
They're all kind of telling it, this is what I want to do.
And you can use all of these as well to give feedback.
So there's all of these different lenses that we can look at, how we can look at context.
The lens I want to talk about today is kind of the lens that distinguishes these two differently colored types of context.
So the difference between an AgentsMD, what's in the skill, usually an ArchitectureMD, and the things that come from Slack Wiki or maybe the GitHub CLI.
So what's the difference between these darker and lighter colored ones?
So what's in the agents MD and maybe in the architecture MD, skill MD, so those are things that are relatively deliberately authored, right?
So depends maybe on the team.
You know, some teams just have those generated by agents, never look at them, so then maybe it's not as deliberate, right?
But these things are reused, right?
So they have quite a bit of impact on a lot of agentic sessions.
And then so ideally, you also want them versioned and ideally even test it, right?
Like maybe use some skill evals or something like that.
Whereas when you go to stuff that you get from MCP servers, for example, those are assembled at task time, and they connect the agent to the environment around it, right?
To all the things that are happening around it.
So it's very different delivery mechanisms, right?
And so if I then try to reverse engineer why are we using different delivery mechanisms for these two types of context, the differences in them are, as I already mentioned, reusability.
On the left, we want to deliberately author things because we want to reuse these things.
They're like a workflow that we need a lot or norms like our coding conventions that we want to reuse.
Whereas on the right-hand side, there's low reusability in the sense that in the environment, there's all of these different things.
And a lot of them are only relevant for one or two tasks a month, let's say.
And then also on the left-hand side, we have a lower frequency of change of these things.
Like our coding conventions and code review rules, they don't change as often.
And on the right-hand side, of course, the environment changes all the time, right?
And the frequency of change is even increasing when you have 40 PRs per developer per week, as Gaipo was just giving an example in the keynote.
So I think we need different names for these different delivery mechanisms or where we're getting this context from.
And so I'm going to use these two in the rest of the talk.
Like on the left, we have codified context that we codify into our into our agents.
And on the right-hand side, I will call this ambient context that comes from the environment.
And they complement each other.
So here's an example of a code review for that.
So a codified context will be like our code review rules that we, again, we use all the time.
So this can be like, again, agents MD, or it's probably more a skill, where the code review agent is kind of interpreting, OK, do we need exponential back off for this?
And if so, does it actually follow that?
And so on.
And then on the right hand side, you kind of see examples of avoidance of relearning cost, right?
So for example, there's the top thing here with the Slack thread is an example of where there was an incident last month where we learned something, and now the agent doesn't know about that learning.
So it's kind of like doing something that might repeat that incident, right?
So relearning, one of the seven ways of software delivery.
So having access to this ambient context can prevent a lot of that.
The importance of codified and ambient context depends on the task, I would say, or let's say on where we are in the delivery lifecycle, right?
So I also put a gray bar here for code that is in the repository, which of course is a very special kind of dynamic context, ambient context as well, right?
But usually how we access that context is built into our harnesses, right?
So the people who built the coding harnesses, they have all of these like, yeah, they spend a lot of time on optimizing how an agent can do code search and stuff like that.
So that's usually built in.
But then additional ambient context, like the one I was mentioning before, like old PR discussions, Slack conversations, and so on, they are especially useful in the planning and design phase.
I was recently building a feature where I just onboarded into a new company and was building a new feature, and I didn't have any context yet.
So I went with an agent and told it what I was asked to do, and it kind of pulled all of this.
previous learning that the team had already had in for me.
So that was really important during planning.
But then when I was doing the actual implementation, my agent hardly used the ambient context that I made available to it because it was fine mostly with just having access to the repository, to the mono repo that I was working on.
So this familiar face to DEF CON attendees, hopefully, Patrick Dubois.
So he was talking, I think this was earlier this year, about how context is the new code, right?
And kind of taking inspiration from the DevOps loop and saying, you know, there's a similar delivery lifecycle here that we have to think about, a loop of how we improve our context continuously, right?
And he called those stages generate, evaluate, distribute, and observe.
When Patrick was talking about this, he was basically talking about codified context, right?
Mainly skills.
So how do you write skills?
How do you evaluate them?
How do you distribute them to your developers' agent harnesses or to your software factories?
And then how do you observe them in the wild and see if the skills are actually good or bad, right?
But it doesn't work quite the same way when you have ambient context, right?
So how do you...
How do you use all of these stages?
How do you deliver ambient context to your agents?
And before I go into that, I just want to take one step back briefly and talk about the green ones here, evaluate and observe.
For us to do those, we have to know what good looks like, right?
And there was recently a really good article in the communications of the ACM by some folks from DX and Dr.
Nicole Forsgren.
And so they basically came up with a framework of how we can define what good quality context is.
So these are quite high-level categories, but they say that anything you can think about about quality of context usually fits into one of those buckets.
So it gives us a high-level mental model of how to think about what good quality context is.
And they say here it's about clarity and actionability.
Those are obviously very important, especially for the type of codified context I was talking about.
And then fidelity and efficiency.
So fidelity is how much can the agent actually trust that the context is true, that it actually represents a fact or something that we want.
And efficiency is all about signal-to-noise ratio so that it can actually have attention on the right stuff.
And then they have the S for security in brackets, not because it's an afterthought.
But because they say it kind of cuts across all of these things, right?
So you have to make sure that there's no untrusted content in your context.
And you also want to make sure that there's nothing in there that the agent isn't allowed to see, for example, right?
So there's different ways to deliver ambient context to the agent.
And the most widely used one these days, of course, are MCP servers, right?
So what's responsible for efficiency, fidelity, and security when you have MCP servers?
So, yeah, so an agent basically, like, calls these different MCP servers.
And then the agent itself, or maybe a human who is sitting next to it with the agent, has to make sure or has to kind of think about efficiency and fidelity, right?
Has to figure out what's noise, what's relevant, what's stale, what are maybe conflicting pieces of information between these things.
And yeah, security, of course, is being taken care of by how you set up your MCP servers, which, as we all know, is not always ideal.
And there's also a lot of things you have to think about, like in terms of, OK, if this agent has access to this information, but it can also post that information over there, then what does that mean?
So it's not just a technical problem.
It's also like a design problem for us as humans, right?
an agent that has many MTP servers available, it might not even call some of the ones that might have relevant context for it, right?
So it's almost like the agent itself has to take care of recall and precision because this is kind of a search problem, right?
So, and yeah, I just recently moved to Canada.
I don't know if you can tell to join this company Unblocked.
And they are, or I should say we now, right?
So we are building something that is trying to move that, you know, taking care of efficiency and fidelity into like a separate component, right?
So we call that a context engine out in the market.
I think context layer is also quite a typical word for it.
There's this more colloquial thing of like company brain, right?
Or like enterprise AI search or something like that.
So this is basically, simply put, the idea that you have all of those different systems and you put all of those things in one place and kind of connect them to each other in a way that is useful for the types of like questions that you have in software delivery and then at re so at the time of an agent or a human asking a question just in time you put together that ambient context for the task at hand so you also have a step of like reasoning about the information ranking it reconciling conflicts and so on yeah and so that's kind of like the part that takes care of efficiency fidelity and security for you So I just want to go almost like a lightning round through all of these four steps and give you some examples of what it takes to build a system like this.
So I would call the generate step, I would call it ingest here, and the distribute step I would call assemble, so kind of what happens when a question is coming in.
So let's start with ingest.
So this is just all to give you an idea of, like, there are a lot of technical challenges to this.
But it's not unsolvable, right?
So first thing is, of course, when you ingest all this data, the freshness of the data and the reliability of the syncing are key, right?
So you have to think about durable execution and how you get all of this data into this engine reliably.
And so here are a few additional lessons that the team has had over the last three years of building this.
The first one is that, of course, the variety of syncing mechanisms and data models that you have when you plug in a lot of these different data sources can be quite challenging, right?
And this is like a very pedestrian annoying type of challenge, let's say, right?
So it's the different data models.
It's like some of them have web hooks, some of them have polling.
Then you also have to do kind of like scheduled backfills when sometimes the web hooks are not reliable and stuff like that.
And there's also, even more importantly, different permission models across all of the different systems, right?
When you plug in Slack and you plug in a wiki and so on and so on.
And then keeping up with changes efficiently is another technical problem to constantly solve.
So there was one incident in the past with lots and lots of rewrites a day just from every single PR change thinking things.
So then the team had to kind of think about back pressure and debouncing to make sure that that works well so again all very kind of like pedestrian pre-ai types of challenges right and then the last one i want to call out is the challenge of identity reconciliation right especially when you want to resolve conflicts and maybe find out uh things like you know there's there's like an expert graph in unblocked that kind of knows who knows a lot about which parts of the system which is very useful when you try to resolve conflict But you can only do that if you know that this account on Slack is that account on GitHub, right?
Because I derive from my GitHub commit history, oh, Peter is an expert in this topic, and he said this thing on Slack.
So I give that thing on Slack, that message, more importance than Bigittas, who just joined the company, than Bigittas Coach that's in the PR, right?
So when it comes to evaluate, like I was mentioning before that for codified context, this is mainly about skills evals and stuff like that.
So you would have the instructions that you deliberately authored, right?
And then you have to think about a handful of scenarios and edge scenarios and run that.
So Tesla, for example, has a feature for that that can help you get started with this type of stuff.
This is a lot more elaborate when you have an ambient.
context engine like that, right?
So we, for example, recently used the Enterprise Rack benchmark data set to try and expand that with coding tasks to kind of evaluate and find as a new way to evaluate our pipeline, our engine.
And so here you basically need this retrieval and reasoning over a whole simulated company data set, right?
And the Enterprise Rackbench data set has 500,000 documents from nine different data sources simulated like Slack and so on, right?
And then kind of like the cases you want to look for is, can the system resolve conflicts?
Can it find that things are kind of duplicate or almost duplicate?
Does it hallucinate answers that aren't there?
And you kind of have to think about in all the cases about what are the gold documents, the gold answers, and so on.
So this is a lot more elaborate, unfortunately.
Then when it comes to the assemble step, so this is the part where an agent or a human actually asks for context for a particular task.
And this is just like constant work just tuning this loop, right?
So this is basically a separate little agent next to your own agent that is doing this work for you, right?
So you have to think about, of course, latency, right?
versus the quality of the result or the depth of the search that you can do.
These are things, by the way, that are not part of all the benchmarks out there, right?
The benchmarks are just about how good are the answers and all of that.
But how long it takes or how much money it costs, that's more product reality.
That doesn't show up on a benchmark.
So this is something that constantly has to be tuned with things like what model is being used for what, how many turns do you allow when you answer a question.
And here on the right, I've called out the thinking about caller personas.
So when the MCP server comes in with a question versus a chat UI interface where a human asks it or versus an agent that is doing code review, you can think about different latencies, different number of turns that you allow for each of these things.
But it can be quite tricky, especially with the depth versus latency, because sometimes you can get, obviously, much better answers if you just give it more time and cost.
And for Assemble, also, I just want to call out conflict detection in particular because I find it something really powerful.
So this is some data that I pulled from one of Unblock's customers from across about two weeks where the agent loop decided in about 13,700 cases, oh, this kind of looks like a conflict, and then did like an extra check.
Is there actually a conflict happening here?
In 10% of those cases, it decided, yes, this is a conflict of different sources of information that contradict each other.
And then in 92% of the cases, it could actually settle the conflict based on other signals and reasoning that it had.
And you can see here at the bottom the two purple bars of that, the dark purple bar, sorry.
809 of those, so what is that, a little bit over 50%, right, were settled by checking the code.
And this is actually a super important factor here that when you have a context engine like this, specifically for software delivery and not like a generic enterprise AI search, it's a huge advantage that in our domain of software delivery, we have the code as our...
Let's not say source of truth, but source of reality.
So the code is like a super useful signal for all of these things to even be able to do this, which is not as easy when you have other domains where it's not quite as clear cut what the truth or the reality is.
Yeah, and then in some cases, of course, when it cannot really figure out what the conflict is, then it's telling the agent about this conflict and leaving it.
to the actual agent to figure this out.
And then finally, observe.
So how do you observe this in the wild?
And I'll stay with conflict detection here.
And this is an example of not like observe to improve the pipeline, to improve the context engine itself, but more for the users of the context engine to observe and monitor the quality of their ambient context.
So we can also track For example, oh, this is one document that keeps coming up in the results.
and the agent keeps saying, oh, there's a conflict here, and I'm not trusting this document for the following reasons.
And then you can kind of say as users of this, oh, let's look at that page.
Like, is something wrong with that?
Or is there something really wrong going on in the engine, right?
Or I also find it quite interesting here to see which types of systems are overruled in conflict detection.
Maybe, obviously, I was just talking about code and the authority of code, right?
GitHub here is the lowest one, right?
So that one is being overruled the least.
But the engine is also skewed towards, like it has a strong bias towards choosing code as the truth, right?
And maybe also not surprisingly, the wiki is overruled most of the time, like the most frequently.
And here's just one example of observing to actually tune the pipeline, tune the engine itself.
So this is an example of an exercise the team did in May where they took a set of downvoted answers.
So this is, of course, human feedback is one of the most high quality but also hardest to get, kind of like feedback to get.
And then they kind of clustered the most common problem to then try and improve that over time.
So for example, The engine should also always kind of keep in mind who is asking and what that person is working on.
So that seemed to have been ignored a bunch of times or wrong conflict resolution or just like missing context.
So stuff that was relevant, but that was not retrieved in the first place.
Yeah, so like I said, this was just to give you an idea that this is not trivial, but I've also often heard people say, oh, I don't believe this works, right?
It does actually work quite well.
And these challenges are all solvable when you break them down into smaller pieces.
And this space is still very busy, right?
So I was talking about how there's things like people calling context layers or AI search.
And some of these systems are quite retrieval heavy and light on the kind of reasoning and reconciliation side.
Some use literal graph technologies under the hood to implement this.
Others don't.
Some specialize on the domain of software delivery, others don't, right?
And for completeness sake, I just also want to mention here that, of course, another source of ambient context is systems that, you know, more or less are kind of like, let's say, memory-type systems.
And I don't just mean personal memories and, like, team memories and, you know, what we usually use this for, but just in general things where we periodically do this.
reasoning and reconciliation and kind of almost like a cache kind of put things into persistence.
So it can also be things like regularly generating a high-level wiki of everything.
which could save agents a lot of time to figure it out again and again, every single question.
Or there's a lot of tools that kind of create these repository maps where you can navigate.
And all of those things you can also use inside of a context engine, of course.
And I think I didn't mention before, so also when you sync and index data in the beginning, you can have large language models in there to help you think about what do you even index in the first place.
If you imagine all the stuff that's on Slack, You don't want to index every single conversation.
Not every conversation on Slack is knowledge.
So that's just one example of where you can already put in some quote-unquote intelligence before you even index data.
And I want to end a little bit on talking about maintaining the context itself.
So this was all about this engine that produces this, but it has input.
So for example, you want to think about where you put what.
So you don't want to bother codifying, frequently changing environmental data into your skills because then you're just constantly trying to keep up with either updating the skills or cleaning up after an agent who has outdated information.
On the other hand, you don't want to trust that key reusable instructions will just magically emerge from ambient context.
So you don't want to put your code review rules and conventions into your wiki and just hope that it just comes up.
In terms of ambient context in particular, what is a good ambiance?
So what are things that context engine can handle and what are things we have to handle?
We here meaning the users of the context engine.
So context engines can handle knowledge that is spread across many systems.
So it doesn't matter as much anymore where the conversation happened.
If it happened in a PR conversation, a PR discussion, or if it happened on Slack.
It also obviously doesn't need any common structure or categorization, right?
So the holy grail of maintaining wikis and knowledge management, right?
I was a consultant for 20 years, and I've never seen an organization that had like a cleanly structured and organized wiki or documentation, right?
So finally, we have something that to a certain extent can actually help us handle this a little bit better, right?
And it can also handle outdated conflicting information as long as there are signals that help it resolve that, right?
And I already mentioned that, fortunately, in software delivery, code is a really powerful signal for that.
And from code, you can derive things like experts.
There's also, even if you don't have software delivery, sometimes the org hierarchy can also be a good signal for an agent to think about, like, what to service to a person, what authority some piece of information.
has.
So what do we still have to handle?
We have to write things down, think out loud, right?
When I just onboarded, as well, this may be a slightly different angle, but when I just onboarded, I was also encouraged to ask my questions, not directly to the unblocked product, like in private, but to ask them out loud on Slack so that my coworkers could potentially correct what came back.
So there's also these corrections happening on Slack.
But yeah, you have to put it somewhere.
And it has to be then wherever you put it, it has to be accessible to the engine.
So this comes back to this challenge of permissions.
Who is allowed to read what?
And also from my experience, some enterprises It would really be maybe a struggle for them because again as a consultant often when I onboard it every two days I would have to ask for a new wiki space to get access to or a new repository to get access to kind of weight myself through that right?
So I think a good concept of like what are the zones where you kind of want to say this is all like trustworthy information for the agents is very useful.
And then finally, yeah, so if that's possible, if that's made possible by whatever solution we're using, we can monitor for documents or information or knowledge that constantly impede this conflict resolution and make it worse and kind of clean that up.
And I'll end on something like, kind of like an open question, but of course the sources of this ambient context are evolving, right?
So today still, especially I would say in a lot of organizations, This, you know, humans communicating with each other.
I mentioned PRs a lot, tickets, chat, and so on.
So it's like a lot of the context that goes into this engine comes from humans.
But of course, that's trending towards coming less from humans and more agents writing this, right?
Agents writing PR comments, agents working on adding details to tickets and so on, right?
So the question is maybe in the future, depending on how this evolves, how can we build in more human correction steps?
Will we need even more of this monitoring of how much quality, high-fidelity context agents are creating so they're feeding it into themselves again?
So this is yet another example of how large language models amplify indiscriminately, right?
So this could also go into a death loop of getting very bad context that keeps getting fed back.
This will definitely still evolve and lead to interesting new challenges of how to do this.
In closing, you need codified context, but you also need to see the environment for what it is.
That's all I have.
Thank you.
Wonderful.
Thank you very much, Birgitta, for both the chat that we've had here today and also the wonderful session that you just gave at DevCon.
It's been a pleasure having you here in our New York edition of DevCon.
Thanks for having me.
Pleasure.
And even though the conference has ended by the time this goes out, all of the sessions have been recorded and are available on demand.
Use the QR code on screen now or follow the link in the show notes and that will take you to register for a free virtual ticket.
From there, you'll have unlocked all of that wonderful content.
So enjoy it in your own time and thanks for listening.
Bye for now.
The AI Native Dev is not just a podcast, it's a community, and we host monthly meetups at the Tesla offices in central London.
Visit tesl.io forward slash community to learn more, and I hope to see you there.
