How to Improve AI Coding Agents Output with Context (Augment, Cursor, Mermaid, Eraser.io)
June 11, 2025
Context is king: this daily video dives into practical ways to improve AI coding agents by optimizing context with Augment, Cursor, Mermaid, and Eraser.io. It covers a concrete workflow for just-in-time context, knowledge management, and hands-on tooling.
Key ideas on context and how it drives outputs#
- Context windows matter: model accuracy drops noticeably once you push past half the window.
- Goal: keep only what's needed for the current task in scope; avoid overloading the model with everything at once.
- Build around just-in-time context rather than a single, massive master doc.
A pragmatic product-management mindset for AI work#
- Three vertices in play: business (is this viable?), design (how will it look/feel?), engineering (how will it work?”
- PM focus: what and why; development/engineering focus: how.
- Use spikes (research or fast prototypes) to validate direction before heavy investment.
- For AI work, pass in only the information the feature needs; watch for cross-cutting work that touches many subsystems.
How to structure PRDs and docs for AI features#
- If a feature is meaningful, give it its own PRD.
- Include just-in-time context: a simple one-pager for tech stack, data fetching, libraries, and architecture.
- Use multiple forms:
- Rules and augment guidelines for shaping AI behavior.
- A file tree and architecture notes (current vs proposed).
- A central “AI refs” bank with variations of architecture docs for experimentation.
- Don’t dump the entire master doc at once; tailor the context to the task.
Just-in-time context and knowledge management in practice#
- Build and maintain an AI refs folder with architecture variants to learn what context is actually needed.
- Use a tiered approach: master docs for reference, task-specific docs for day-to-day work, and concise PRD-context for agents.
- Keep it lightweight: avoid sending the full 21,000-token master doc to the AI every time.
Tools and workflows showcased#
- Augment
- Use rules and augment guidelines to codify code standards, data fetching (server vs. client), caching strategies, and core architecture.
- Link rules to the relevant documents (one-pagers, architecture notes) to keep context tight and relevant.
- Cursor (auto rules)
- Leverages auto rules to inject relevant context automatically (example: switch from Node to Bun with SQLite already in mind).
- Great for parallel work: you can run two projects at once while Augment does the heavy lifting.
- XGPT CLI
- A lightweight CLI tool to gather domain knowledge on demand.
- Workflow: choose content type (tweets/replies), decide on embeddings, fetch a timeline, create embeddings (via a tool like Transcribe Mini), then query against those embeddings.
- Useful when you need fast, focused context without a full server setup.
- Eraser.io
- Connects your repo to automatically generate diagrams (cloud diagrams, ER diagrams, flowcharts, sequence diagrams).
- Diagrams auto-update on push, and you can reference them in PRDs and docs.
- Helps keep diagrams in sync with code and reduces manual diagram maintenance.
Diagramming and visualization#
- Diagrams are used to keep complex architecture and flows visible.
- Eraser supports multiple diagram types and can auto-sync with your repo for up-to-date visuals.
Why all this matters#
- Context, when managed well, unlocks reliable orchestration of AI agents across tasks and layers.
- Knowledge management and documentation aren’t fluff—they’re the backbone of scalable, multi-agent AI workflows.
- The approach aims to reduce wasted cycles, improve accuracy, and enable faster iteration.
Concrete takeaways you can apply now#
- Start an AI refs folder with modular architecture docs and a lightweight PRD for each feature.
- Implement just-in-time context: pass only the relevant docs, not the entire repository state.
- Add an AI guidelines doc (rules) and an augment guidelines doc to standardize how agents reason.
- Use Cursor auto rules to inject environment specifics (e.g., Bun vs Node, database choices) into context automatically.
- Build a small CLI (like XGPT) to gather niche knowledge and create embeddings for quick Q&A.
- Try Eraser.io to auto-generate and keep diagrams in sync with your repo; reference these diagrams in PRDs.
Community Q&A (highlights)#
- Readers ask about big-context LLM orchestration (e.g., Gemini) and task execution; the emphasis remains on practical context management rather than brute-force context expansion.
- Questions around infrastructure choices (cloud, local, home labs) and keeping momentum without burnout are addressed by focusing on repeatable, modular workflows.
Links#
Transcript
Context is king. It is literally the most important thing when we're building with AI. You've probably heard this. Context is super important. You might know about context windows, how the models have different sizes that they can fill up with all this AI goodness. You may not know that as soon as you get to halfway through your context window that the outputs reduce by about 60% in their accuracy. Maybe you didn't know that. So, I want to talk about all the different tactics that I'm trying out. And as proof, here's some stuff that I'm building right now. And I've had to change the way that I work to get the most out of the models. That includes the technologies that I use. That includes the file structure, the knowledge management and document management. So let's get into it. First of all, we had a question come in. We'll cover some questions and they actually have to do with context. So it's really convenient. So in VI, our private network of builders from people like Googlers and Microsofters who are part of it, we had a question and it was if I'm developing an app that has distinct areas of it, would you do separate PRDs for each given level of detail or just one? And I wanted to cover my answer because I think it covers the basis of this talk. So if it's a meaning meaningful piece of functionality, it should have its own PRD. It's just good PM hygiene and I understand that a lot of people have not been product managers. I was a product manager for a good portion of my life and also spanned into product design as well as engineering. So done all the things and product management the practice of it if we just take a step back is you basically have three different vertices that you're working on in between. So you have business. So is this going to be a commercially viable thing? Is this good for our business goals? You have design, which is how will this look and feel? And then you have engineering, which is how will this work? How will we actually build this? So product management is figuring out the what and the why. I wrote that backwards. And then development is the how. So we put the LLMs on the how, but we still need to focus on why are we doing this and what is it that we're building? And one of the things that came up in this conversation was one of our members Sam mentioned that it's worth maybe doing a spike. And in scrum terms, that is a dedicated time that is set aside for researching this area of potential development. So that could be building a really quick prototype that's fast and dirty to prove that this should be the direction that we go. Could be just strictly research. It's a research spike. So I think those are really underrated nowadays because if you worked in scrum, you probably hated it. But because we have AI, we can do scrum a lot quicker. And so what I said about this is there's a couple different ways to handle those PRDs, but the way I like to think about it is that you want to pass in just the information it needs for that one feature or that one block of work because you're trying to categorize them and group them into something that can be done sequentially that you can make sure if there are crosscutting pieces of work Cross cutting means if I have a database and an API and a middleware and a web app and a mobile app, cross cutting would mean it's touching a lot of these different things. Those are also good guidelines if you're trying to do multiple agent stuff. So the way I've approached this is first I just started out by adding in rules and that worked okay. You can add rules and then in those rules you can reference documents because it comes back to the documents such as a simple one pager that explains the text stack and your preference for things you use bun do you use mpn do you use pip uv all those things and then what are you using for data fetching what are the libraries all those things get included in that one pager so you can do it in the rules if you're using augment then you can do it in a user guideline or an augment guideline. We have those as well. So you can see I have an augment guidelines. This covers my code standards. Covers how I do data fetching on the server versus the client. How we think about cache, how we think about the core architecture, all those things. So you can do it that way. You can also do it within the PRD. If there are things that will be specific to that one area, but they're not global, then that might be a good option for you. You can include a file tree. Those are helpful and a text stack call out any sort of key files that are associated with it. And then you could also link into that highle arc doc that I mentioned before. So you could have the current architecture versus the proposed architecture. You're just trying to give it as much of that context that's actually relevant. And actually relevant is what I mean when I say just in time. So by doing this I realized that it's repetitive but it allowed me to learn what was working, what is not. Since then, I've evolved to having this AI refs folder with a few variations of the architecture docs so that I can learn and see if this is just in time context which part of this massive doc should be part of this PRD part of something that I give the developer because that's what the AI agent is. So the developer might not need all of this, right? might not need a high level system architecture, might not need request flow diagram, might not need the authentication flow, but having all these as a bank to then know, oh, this is what we need for this task. Maybe a table, but this is the master dock, 21,000 tokens. So, you wouldn't give this all at once because it just wouldn't be good. I'm going to say continue or do a deep dive on the phase 1.3 and complete ensure our task list is up to date. It's going to go ahead and continue and it has the context that it needs to continue. Great. So, right now I'm also testing out the cursor's new auto rules feature and so I build two projects at once typically. Sounds crazy, but while I'm waiting for augment to do the heavy lifting because it's doing sequential thinking, it's digging through its just in time context. I'm experimenting with building out a second thing while I'm going. And so in this case, I noticed that when I started this project and the latest release of Cursor has an update to their auto rules. It just made a simple rule that said we need to use bun instead of node. Here's all the things around bun that are relevant because it knows that we're using SQLite. It put that in there. It knows that we're using database. So, it automatically just put this in there, which is really nice. So, that's one option. And that allowed me to make this. This is a CLI. I call it XGPT. It came out of me doing the research to have context of what I needed to build. I wanted to build something and this guy who builds a lot of tools, I respect him and I respect what he does. He's single dev and he ships like crazy. He doesn't want to deal with servers. So I was trying to just use Grock to ask questions. Even with deep research, it was not giving me the results. So I just built a CLI tool that gives me the results. And what it does is I run XGPT space the name of the user and then it walks me through a CLI that says a couple things like basically let's find an example. It'll ask me if I want tweets or replies or both. And then it'll ask me if I want to create embedding so I can do questions and answers. And then it will go and take a timeline that I also define. And then it will go and scrape those that match to the keywords that I'm looking for based on the timeline that I said. And then it creates embeddings out of them using I think it's transcribe mini. And then it will allow me to ask questions against those. Nothing fancy. I made it in the last hour and a half just as I'm waiting for augment. So the job is changing also to orchestration. But why context is king is because you can't orchestrate unless you know what's going on. So I had gone and I had made a bunch of stuff in Python and I had no idea what was going on. So you can't orchestrate something when you don't know what's going on. So I switched everything back to Typescript. So end of the day it all comes back to knowledge management, documentation being king, and using Sniper's approach to delivering just in time context. So, I have that refs folder has a bunch of stuff in it and I find it really helpful. Now, on to some other stuff that I found that could be helpful for this is you'll notice I'm using this product called Eraser and Eraser, it makes it so that you can connect a repo and then generate different diagrams automatically. And because it's connected to your repo, when you push, it will update it automatically for you. So, I think this is eight bucks a month for me to try it, but I'm gonna start playing around with this as just part of my flow. So, I don't have to think about it. It's worth $8 to not have to think about it. So I want to start mapping the ones that I have in here to prompts that are in here such that these charts which are contained inside of they call them frames can then go automatically into my codebase and then also be referenced for the different PRDs that I'm working on and have them always up to date but also be automatically generated which is really cool. And so you can see we have one over here which is the system architecture. I can also pull the database or sorry the repo and then see if there's any changes that need new frames created which then go back and autosync and then inside of vi this is inside of a repo you have this eraser diagram file and then you can create cloud diagrams entity relation diagrams flowcharts and sequence diagrams. So, this all plays back into the context. And context, like I said, is king because ultimately this will be what I use and what people use to drive agents. And not just the one that's sitting in the right side of your codebase or your code editor, but remote ones. So, that's the lesson for today. Let's see if we have any other questions on YouTube. So, let's go to YouTube and let's go. We're on my main channel now. great beginners course on HTTP request and third party API research. Thank you. Yeah, that's definitely part of it. I think a lot of people just do tutorials that don't include stuff that you actually need to know if you want to make it interesting. And Mike says, "You taught me all the bits I wondered about was not taking the time to understand." Great. Appreciate it. Yeah, there are a lot of little nuances for sure. Loving this series. Thank you, sir. Thank you, sir. What iconthe package are you running? It's called Cat Pacine. And then I switch the colors probably every month. Right now I think I'm on just cursor dark, but Dracula is good as well. Demetri says, "That's a good video. Good video." Thank you. Thank you. Thank you. Never thought a whiteboard are moving above the video. Yeah, I added progress tracker and it was freaking everybody out. Sorry about that. Dan says, "I've been using M Dashes since high school." Oh my gosh. Dang. What was your score on the ACT though? I'm tired of all the new agents. Yeah, I think that we just need to have a couple in contact is king. Not a fan of the yellow line. Sorry. Absolutely love these videos. Keep them coming. Thank you. What's up with the free pabyte of data? This guy wants stuff on GCP. I can cover that at some point. Do you have a video on your workflow? Yes, that's guy from he works augment. Holy crap. I'm going to have to do the rest of those in another video. Let me go over to the daily uploads and see the questions. What about a big context LLM like Gemini orchestrating opus for tax task execution? Now, I'm going to go through all the daily ones because this is the daily channel. So, my bad. You can do that with cloud code MCP and just have Gemini run the show. Best of both worlds. What does your setup look like? A home lab with zero trust containerization and something novel for the memory later, which is about 2 to 3 years ahead of current production. I had read this before. Opus tells him that it's 2 years ahead of current production. But is Opus true? We don't know. That sounds interesting. Art says he's getting burnt out. That's all. Quit fiddling with AI then. And you can't get burnt out. That's why I stopped just doing news stuff on this channel. It's really just like I'm going to absorb the thing and then get a take on it after using it and then I'll feel comfortable talking about it. Same thing goes with my workflows because it's the concrete's not set and it won't fully set, but I want to at least have frameworks around how to think about these things. Have you tested cloud code? So these are all older questions. Cool. If you liked this, no, not if you liked this. If you learned anything in this video, then you can subscribe. That's your way to learn more stuff. If you want to be a part of the community and start building more, then join VI. You can see the link in the description. That's it for this video. See you in the next one.