Best way to insert context

Hi everyone,

I’m building a complex multi-agent system, and I need each sub-agent to follow a detailed guide as closely as possible. The guides I’m using are long, ranging from 8,000 to 15,000 characters. I’m unsure about the best way to ensure the agents stick to them effectively.

My main questions are:

Is RAG the best way to handle this, or would it be more effective to inject the guide directly into the system prompt?

Since the guide is long and written for humans, should I consider re-structuring or rewriting it specifically for the agents?

In general, how can I determine which approach (RAG, prompt injection, or other methods) works better for different use cases?

I also have additional questions regarding the use of the Todo List middleware in this context:

Are the default prompts for the Todo List middleware suitable when an agent has a very specific job, or will customizing them lead to better performance?

In this scenario, is it better to:

- Give the agent the Todo List middleware directly, or

- Create a small graph where one agent takes the context and generates a comprehensive todo list, and another agent executes it?

Is keeping the todo list in an external file, like storage, better than relying solely on middleware?

For context, quality and precision are more important than token cost. I’m currently testing with GPT-4o. Any insights, examples, or best practices you can share would be really helpful!