About a scenario of whether to activate deep_agent

I am working on an intelligent agent. I need it to complete a task based on the methods in a book. This is not RAG retrieval, because RAG retrieves specific text content. What I want to do is use the methods from the book to accomplish tasks, such as using the book’s methods to predict, calculate, or reason. I need to ensure the integrity of the content. Should I create a deep_agent? Should I turn the content from my book into skills and dynamically inject them into the context to achieve functionality? Because I may be dealing with different methods for accomplishing the same task, coming from different books.

If feasible, the content of the book may be obscure and difficult to understand, and if specific methods are not extracted, will injecting the entire book cause context overflow?

hi @Huimin-station

imho create_deep_agent with the skills system is the right architecture for this use case

The TodoListMiddleware inside create_deep_agent provides a built-in write_todos tool that lets the agent track progress through the steps systematically

The SkillsMiddleware implements the Agent Skills specification with progressive disclosure: only the skill name and description appear in the system prompt at all times; the full methodology is loaded on demand when relevant. This prevents context window overflow from large book content.

Large book content that would overflow the context window can be offloaded to the virtual filesystem. The FilesystemMiddleware gives the agent read_file, write_file, glob, grep tools to load sections on demand — similar to how a human flips to the relevant chapter rather than memorizing the whole book.

For huge datasets you could involve RLM, PageIndex for optimizing the context window.

If the use case is simple (single methodology, single step, small content), a basic create_agent with the methodology in the system prompt is simpler and faster.

If the book uses obscure domain-specific terms, store a glossary in the memory parameter’s AGENTS.md so the agent always has definitions available

agent = create_deep_agent(
    skills=["/skills/book-methods/"],
    memory=["/memory/domain-glossary.md"],  # always in context
    backend=FilesystemBackend(root_dir="/my-project"),
)
1 Like