Ask HN: How do you manage your AI agents' context across clients and projects?
103 pointsHi Guys,
like many of you I work with AI agents every day and across several clients.
The major time cost for me is to re-explaining context and past decisions, client rules, that we already do. To finish every tools as its own memory.
So I’m curious how you actually handle this:
1. When you start a new session, how do you give context to the agent (context came from chat, mail, ticket ...) ?
2. Do you use more than one agent type (claude, codex ...) ? And if yes, how do you carry context between agents ?
3. If you work for several clients, how do you keep their context separate ?
4. The last time something went wrong ( an agent used a rejected approach, forgot a decision ...), what happened, and how much time did it cost to you ?
5. Did you paid or built a tool that helped you with these problems ? Do you still use it ?
I’m exploring whether to build something, so I’m trying to learn how other people really work.
Thanks for your return.
Comments (75) 97 threads
Earlier commentsThere are _great_ tools for this, but the biggest part of this is managing your own attention, and mental load. You can craft something that really helps _you_ manage all the spinning plates.
In the case of my harness, I hoover up all the PR state into one place and then have a bunch of rules on how I interact with them (or not). Even down to a "swipe right to merge" card system. Works for me.
My recommendation: A cloudflare PWA fully vibe coded with zerotrust on the front. Don't get too attached, tools are changing fast. Make it work and be prepared to ditch it when something better comes along.
[1] https://jonathannen.com/build-your-own-lightsaber/
Effectively I just need to connect the MCP and set the preferences/rules in the agent (codex, claude, opencode, etc.) to: "Read instructions and rules from PriBrain before doing anything." Its pricing is targeted at startups/SMBs, not freelancers, though (but we could arrange something if you're interested).
You can achieve a similar result with a markdown file and change "PriBrain" to that file path, then you just need to manage the core rules/instructions in a single place.
A great thing I leverage with PriBrain is using different PriBrain accounts per client, so each agent only gets the core rules/information for each client.
To your specific questions:
1. Just what's necessary. If it is a long wall of text I'll finish with "Read PriBrain first." just to make sure that initial instruction won't be ignored, because sometimes Claude and Codex will ignore them.
2. Yes. Similar answer, the shared brain.
3. I use separate Spaces (think of them as directories or some other kind of taxonomy).
4. Happens many times, but it's not related to the shared brain and that's why I verify work.
5. I used gbrain before and it still caused a lot of hallucinations, so I built my own solution.
Hopefully that helps.
My knowledge base contains notes about my goals, projects, tasks, products, ideas, etc. It also contains my articles (dsebastien.net), my tools and infrastructure, my open source and private projects with their repositories, specific instructions for each, etc.
In addition, I have built tools to help understand the taxonomy/ontology of my knowledge base, know which types of notes exist, which properties, which template to use, where to store what, etc.
On the human side, everything is automated, which lets me capture efficiently. On the AI side, all the knowledge is easy to find and leverage.
The whole knowledge base is like composable context for AI.
I can start sessions with sentences like "let's work on the music practice plugin; add xxxx" and AI will understand what project it is, where to find the sources, where to clone or update the repo on my machine, etc. And from the context within the repository itself, it will then know how the code is organized etc. The nice thing is that this also enables me to work on multiple projects in parallel easily; either in different AI sessions, or in a single session for work that spans multiple projects/repositories. For instance I have a repo which a product, another with the product documentation. When I ask for something in the context of that project, AI works seamlessly on both.
BTW this product of mine is a 1:1 copy of what I use for myself: https://store.dsebastien.net/osk
I was using LLM Wiki for a while, it seemed to work well but when I decided to measure token usage, I ran into a surprising +23% in token usage (model was often double checking or query was finding more matches than intended). I also tried static graphs for codebase structure, like graphify, and saw a +5% increase in token usage in the same benchmark.
In the end, I created this hybrid solution, called wayfinder: https://github.com/zaterka/wayfinder
It's a simple rust application that build a knowledge graph on top of the LLM wiki, with metadata that helps the model navigate through the markdown files, tracking files that are up to date and the structural relationships inside the project. It also led to -30% token usage on the same benchmarks both LLM Wiki and graphify increased the token usage.
For managing context between different teams, I use my memory by project, so personal and professional work is kept separate, and I just reuse templates as needed (for agent prompts for example).
All comments shown.
Couldn't load more comments. Check your connection and try again.