I've also been thinking about an interesting approach for agent initialization - instead of relying on traditional system prompts to define behavior, what if we fed the agent a synthetic conversation history? The idea is to create a pre-made JSON transcript that demonstrates exactly how we want the agent to behave, including tool usage patterns, response styles, and interaction flows.
For example, rather than telling the agent "use tool X when you see Y," we could include a conversation snippet where it successfully used that tool in the exact scenario we want. The history would use the same format as real conversations (roles, timestamps, tool results, etc.), making it feel more natural for the agent. Similar to the Few Shot prompting
This approach would also solve the previous discussion about conversation continuity - instead of reusing an existing conversation_id (which can be tricky to manage), we could simply initialize a new conversation with the real history from another conversation as input. We'd get a fresh conversation_id while maintaining all the context and interaction patterns we want to preserve. This gives us the best of both worlds: clean conversation management with the richness of previous interactions.
What makes this particularly interesting is that it shifts from prescriptive instructions ("do this") to demonstrated behavior ("this is how it's done"). It could potentially lead to more consistent tool usage since the agent sees concrete examples rather than abstract rules. Got this problem on my project
I've made a comparison diagram of both approaches, and while the prompt method gives us direct control over instructions, the synthetic history might offer better "muscle memory" for the agent. Still needs testing to validate the benefits, but I'm curious