{
  "video_id": "MtwWHXYFqbQ",
  "channel_slug": "dataindependent",
  "channel_handle": "dataindependent",
  "title": "The man behind Cursor's \"memory\" feature",
  "duration_seconds": 694.0,
  "url": "https://www.youtube.com/watch?v=MtwWHXYFqbQ",
  "upload_date": "",
  "transcript": "[Music]\nHey guys.\nCool. Um, yes. So, my name is Yash. Um,\nI work at Kurs on the engineering team.\nAnd, um, I'll apologize in advance\nbecause we don't have anyone who work\nwho has slides. So, I had to just kind\nof put these together my own. So uh you\nknow bear with the very poor design but\nanyways um so I'm gonna talk a little\nbit about how we approach context\ngenerally.\nWait ying one key point here.\nYes and um I have been working on\nmemories um by myself at cursor for the\npast few months just prototyping and\nwe're kind of making our way out of the\nwoods so going to talk about that.\nOkay so Yash isn't bragging for himself\nas much as he wants to ask them how many\npeople are working at memory and cursor\nand he goes I'm the only one. So we're\ntalking about a $9 billion IDE here\nwhere memory is a loadbearing process\nfor it and Yasha is the one that's\nworking on it. So very excited to see\nthis.\nThank you so much.\nUm\nthank you. Um but yeah, so I think like\nvery similar to um what other folks have\ntouched upon, uh when you try and look\nat context as this big kind of word, I\nthink it gets really really confusing\nand muddy. And so we kind of tried to\nbreak it down into three different\ncategories for our agent. Um and\nobviously this is very much an art and\nnot a science. So and it's very product\ndependent as well. But for us we kind of\nhave three different types. So you have\ndirectional and the idea there is uh\nwhen you present a highle task to the\nagent um usually like it will kind of\nbegin its search um wide and directional\ncontext will allow it to narrow that\nsearch early and earlier and kind of get\nto the relevant set of files as quickly\nas it can. Um the next thing is\noperational and that's kind of runbook\nrelated. So how do I deploy a service?\nHow do I make edits in this particular\nfile? What are the conventions? Um and\nso we have already created cursor rules\nfor that which are written by a human,\nbut the model will basically fetch them\nwhen they're relevant to context and use\nthat to guide its edits. Um and the last\nthing is a little bit more fuzzy. It's\nkind of similar to the holistic theory\nof mind that Sam mentioned earlier. Um\nand that's kind of like a behavioral\ncontext where you want the model to act\nin a certain way when it's um going back\nand forth with you. And so we had this\nconcept of user rules um where you could\nspecify, okay, please only speak to me\nin Spanish or something like that. Um\nbut to be honest, most of our effort so\nfar has been just focused on the first\ncategory of codebased search. And\nrecently we've kind of been branching\nout, which is what I've been working on.\nUm, and so the goal of memories was is\nbasically to augment all three of these\ntypes of contexts with the idea that,\nyou know, you can rely less and less on\ncursor rules, less and less on user\nrules, and maybe even less and less on\ncodebased search once we've learned more\nand more about how you interact with the\nagent.\nOkay. Um, and yeah, so like most things\nat Cursor, we start with prototypes. So\nI've been prototyping memories for about\na month and a half now. Um, and our\ngeneral principle was to start pretty\nconservative. And the reason for that is\nbecause um cursor is a coding agent\nwhere the user generally likes to feel\nin control. And one of the most\nfrustrating things about using cursor is\nwhen it kind of goes off the rails and\nstops listening. Uh which I'm sure if\nany of you have used it, you must have\nexperienced it before. Um, and so one\nworry and one thing that we saw a lot\nduring prototyping is if the model gets\nan incorrect memory about your codebase\nor about how you like to run the\nterminal or anything really um it's a\nreally frustrating experience um because\nthe model will refuse to do certain\nthings or will do things incorrectly and\nthen when you try and tell it like hey\nthis isn't the right way it will\nactually like double down because it's\nlike oh no I have a memory like this has\ngot to be correct. Um and so I'll get to\nthat part later but basically when we\nstarted prototyping um we began with\nkind of two parallel approaches that I\ntried out. So one we called like the\nsidecar approach and this is where uh\nthe model doesn't call any tools to\ngenerate memory but rather in the\nbackground as you interact with the\nagent we kind of pull relevant parts of\ncontext into a smaller model and that\nsmaller model makes a decision on what\nto save if to save anything at all and\nalso what to update in the existing uh\nknowledge that it has. Um and then the\nsecond approach we tried was a tool call\napproach where you just give the model a\ntool called update memory. Um and the\nmodel kind of as it detects you\ninteracting with the agent will decide\non its own you know this memory is\nincorrect. I'm going to update it or I'm\ngoing to delete it or I'm going to add\nsomething new.\nSo in the second one the mo\nokay so in the sidecar approach you\nbasically have a small model listening\nto your conversation and at some points\nyou basically send the conversation off\nto that small model and the small model\nmakes the decision completely\nindependent of the main of the main\nthread. Um and then versus the tool call\napproach is all in the main thread. Um,\nuh, the sidecar doesn't necessarily have\nto be an agent. Like you can choose to\ngive it tools if you want to, but you\ncould also, we've tried, we tried both.\nUm, so yeah. Um, also feel free to\ninterrupt me with questions at any\npoint. Um, no, no, no, that was great.\nI'm sure other people had questions,\ntoo. Um, and so yeah, I'll start with\ntool call memories. Um, this was\ndefinitely the simplest thing to to\nimplement. Um and so you just have the\nmodel kind of reflect um and decide when\nthe user has expressed something to it\nthat it determines is like worth\nremembering and in that case um it will\ncreate a memory itself. Um and so what's\ninteresting is we noticed like as I was\nprototyping over the past few months\nlike model capabilities have improved in\nsuch a way that this is like a legit\napproach where you can just give the\ntool to the model and it works. Um, and\nso specifically, Sonnet 4 and Opus 4 as\nwell are really good at instruction\nfollowing and they've also been RL\nspecifically on anthropic's definition\nof memories. But the tricky thing is\nAnthropic actually has a different\ndefinition of memories than what we\nhave. And it kind of goes to the point\nthat everyone has you need to decide\nwhat memories are for your product. You\ncan't just think of it in the abstract.\nUm, and what Sonnet wants to do with\nmemories is kind of create a task log.\nSo you can see that in like their\nPokemon example where they where the\nagent kind of keeps a log of all the\nthings that it's tried to do. Um and so\nwhen we just gave the gave sonnet 4 a\nmemory tool, it would try and save like\ntask specific memories which is in\ncoding agents like at least for us it's\nkind of the opposite of what you want\nbecause you don't want to remember like\nthe things that were specific to one\nparticular conversation. You want to\nremember the things that were\ngeneralizable and will be useful in a\nfuture like completely unrelated\ngeneration. Um and to that end uh we've\nnow like kind of tried to keep sonnet 4\nand keep um opus 4 from generating new\nmemories but they are still really good\nat reflection. So uh if the model has an\nincorrect memory and the user just in\nnatural language kind of expresses\ndisagreement then they're really good at\njust updating their memory themselves\nwithout having to do anything fancy in\nthe background.\nAnd the second approach is the sidecar\nwhich I was talking about. And so I\nspent weeks iterating here on the\nprompting. It was like a whole roller\ncoaster of up and down where I kind of\nlost hope and got hope back and kind of\nsettled in somewhere where I'm happy.\nUm, and the biggest thing that I was\nfighting is this concept of like a task\nspecific memory because in an coding\nagent interaction probably 90 plus% of\nwhat you're saying to the agent is not\nworth remembering. It's very specific to\nthe task that you've given the agent.\nUm, and so probably in most\nconversations there isn't even anything\nworth remembering. um for this\nparticular type of memory. It depends on\nwhat you want to remember. Um and so I\ntried a bunch of different approaches to\nbasically keep the model from focusing\ntoo much on task specific things. Um and\nsimilarly like with the uh tool calls it\nkind of changed as the models got\nbetter. So, um, you know, back when\ncloud 3.7 was the latest model, um, I\nwas kind of prompting it super\naggressively, like giving it a bunch of\nexamples. Um, and it sort of worked, but\nit also wasn't super great and a lot of\nthings kind of slipped through the\ncracks. Um, and with the newer set of\nreasoning models, um, essentially you\ncan just kind of give them like a very\nbrief description of the problem. uh you\ncan lay it out very you have to lay it\nout very precisely like every word will\nmatter but you don't actually need that\nmuch text you don't need that many\nexamples and they'll do a pretty good\njob at the task um so eventually like we\ndidn't end up with a super complicated\nsystem for the sidecar model it was very\nsimple um and the last thing was\nevaluation so um evaluating memories in\nour experience has been really tough\nbecause it's the type of feature that\nyou notice when it's taken away not when\nit's like necessarily there and So um\nyou can try and think of evals where\nlike the memories would help you get to\nthe solution faster but in some sense\nit's kind of cheating because you come\nup with the examples such that the\nmemories are useful and so when we\nevaluated the memories sidecar model\nlike I focused it basically on the\nquality of the me memory generated not\non the retrieval side and specifically\nmostly just filtering out these task\nspecific memories. Um and so we ended up\nin a place where we're pretty happy with\num the quality of memories that were\ngetting generated. And then the next big\nquestion was kind of UX which is um how\nmuch do you want to expose your memory\nbank to your users and I think one big\nlearning has been what users think the\nmodel should remember are not\nnecessarily what are useful and\nespecially like users get really frantic\nand think that their memory bank has to\nbe perfect which is like so far from the\ntruth because in reality like even if\nyou give a model like 50% memories 50%\nof them are junk 50% of them aren't\napplicable like the models are smart\nenough now to kind of filter about the\nnoise largely. Um, and so that was like\na really interesting thing. And so as a\nresult, we've kind of kept the\ngeneration a bit hidden. And like\nobviously you can go in and change it if\nyou don't like it. Um, but most of the\nediting of memories happens like when a\nmodel will choose to site a memory in\nits generation. And then you can kind of\nhover over and delete. But on the actual\ngeneration side, we don't use it. Cool.\nUm, but yeah, so it's kind of what I've\nbeen talking about, but what's next? Um,\nso so far now we can understand the\nusers. Um, but we want to learn a lot\nmore about your codebase. Um, and in\nparticular like we want to have an\nunderstanding of the things that happen\nin your codebase outside of just the\ncode because like you know we can turn\nthrough and uh embed your entire\ncodebase and probably get a decent\nrepresentation of just what's happening\nbut there's a lot of things that you do\nwith your codebase that you know you\nexpress in the sidebar like when you're\nchatting with the agent but they don't\nlive anywhere. Um, and so we're trying\nto figure that out basically. Um, going\nto be a lot more prototyping and just\nlike you know shooting in the dark but\nwe'll I'm confident we'll get there. Um,\nand then with that kind of new set of\nmemories where they can't just be\napplied all the time in context, um, we\nneed new approaches to including\nmemories in context. And so, um, there's\nsome things we've been experimenting\nthere with changing the way that our\nsearch pipeline works to include\nmemories. Um, but it's all just\nprototypes so far. Um, and then kind of\nthe north star we're shooting for is\nteamwide knowledge where um the if if\nsomeone can learn from my mistakes um\nthat I made with the agent and they\ndon't their agent won't make that same\nmistake, like that's the north star. But\nit's also like really really important\nto get it right because if you start\nsharing bad memories teamwide, it's like\nit's a huge degradation of quality. Um,\nso this is what we're working towards,\nbut you know, we've still got some ways\nto go. Uh, but yeah, I had a Q A slide,\nbut I think we're gonna save the night.\nThank you guys.\n[Applause]",
  "transcript_chars": 12671,
  "ingested_at": "2026-05-15T04:39:51.799560+00:00",
  "source": "channel",
  "yt_meta": {
    "view_count": 2663,
    "like_count": 71,
    "channel_id": "UCyR2Ct3pDOeZSRyZH5hPO-Q",
    "categories": [
      "Science & Technology"
    ],
    "tags": []
  }
}