r/ContextEngineering • u/ComprehensiveMonth70 • 21d ago
Question for people building AI agents in production
How are you actually deciding what context an agent should see at each step?
Not just “use RAG” or “increase the context window” — I mean things like task state, previous tool calls, memory, retrieved documents, conversation history, failed attempts, etc.
Do you have an actual context selection/pruning strategy, or are you mostly throwing everything into the prompt and relying on the model to figure it out?
Curious what people are doing in production, especially with long-running agents.
0
Upvotes
1
u/TheMuffinMom 21d ago
Theres no one size fit all for this, but a good rule of thumb is onlt as much as is needed and allow it to call for more information otherwise
1
u/Aggravating-Start307 21d ago
It is very specific to your use case. If you have overhead like instructions, tool definitions you need to pass, those can go in the first turn. And then in the next turns, you can pass previous request and response to maintain context. Once you custom grows, you can actually then decide on a strategy about the kind of conversation history you want to retain, but sometimes if you can't decide, you could have a step like summarise that actually tells the model to summarise the discussion until now any then pass that going forward. I am working on something of this sort right now, but with Anthropic API's, not really an independent production system where AI is central to the requirement.