0 readers reading
How to Make Your AI Agent Learn From Any Book or PDF (2026 Guide)

How to Make Your AI Agent Learn From Any Book or PDF (2026 Guide)

AI agents that learn from books and PDFs are here. This guide shows how to turn any document into permanent agent knowledge using the /learn command, skill stacking, and open standards.

Sham

Sham

AI Engineer & Founder, The Tech Archive

14 min read
0 views

Most AI agents forget everything when a conversation ends. But a new wave of tools — built on the open Agent Skills standard — lets you hand your agent a book, a PDF, or a stack of internal documents, and have it permanently absorb that knowledge as a structured, on-demand skill it can reference forever. Hermes Agent's /learn command and the open-source book-to-skill converter make this possible today, no coding required, and the knowledge you build compounds week over week into a genuine competitive moat.

Last verified: August 8, 2026 · Skill stacking is the practice of converting one document at a time into a permanent agent skill, building a library that grows each week · Pricing/feature facts are volatile — re-check before committing to a specific tool version · Primary keyword: AI agent learn from books

What does it mean for an AI agent to learn from a book?

When an AI agent "learns from a book," it converts the document into a structured skill file — not a summary, but a navigable knowledge base with a table of contents, per-chapter reference files, a glossary of key terms, and quick-reference cheat sheets. The agent reads the book once, extracts the frameworks and decision rules, and then answers future questions by looking up the relevant chapter on demand rather than re-reading the entire text.

This is fundamentally different from pasting a PDF into a chat window. In the old approach, the AI either chokes because the document exceeds its context window, or reads it once and forgets it the moment the conversation ends. The next time you need something from that book, you upload the whole thing again. With skill-based learning, the knowledge becomes a permanent part of how the agent operates — it loads only the chapter it needs, when it needs it.

The underlying mechanism is called progressive disclosure: the agent first sees only the skill's name and description (~3,000 tokens for all installed skills combined), loads the full skill content only when a question requires it, and then opens specific reference files on demand. This keeps token costs proportional to the answer, not the size of the source document.

How does the /learn command work?

The /learn command is a feature of Hermes Agent — the open-source self-improving AI agent built by Nous Research with over 227,000 GitHub stars and an MIT license. You run /learn followed by a file path, URL, or description, and the agent gathers the material, authors a structured SKILL.md file, and saves it to your local skills directory. The command works identically whether you're in the CLI, messaging gateway (Telegram, Discord, Slack), or the web dashboard.

For large sources like books and document stacks, the agent creates what's called a knowledge-base skill: a lean main file carrying the source's core mental models plus a topic index, with one distilled file per chapter stored under references/. The agent loads these chapter files on demand using its built-in skill viewer — so query cost stays proportional to the answer, not the source size. If you later run /learn with new material on the same topic, it folds the new content into the existing skill rather than creating a duplicate.

Step-by-step: Convert your first book into an agent skill

  1. Install Hermes Agent. It's free and open-source. On Linux, macOS, or WSL2, run the one-line installer from the official docs at hermes-agent.nousresearch.com/docs. Verify the installation with hermes doctor.

  2. Pick one document. Start with a book you always recommend, your most-used internal document, or a set of brand guidelines. PDF, EPUB, DOCX, RTF, TXT, and Markdown files are all supported.

  3. Run the /learn command. In your Hermes session, type: /learn ~/books/your-book.pdf. The agent reads the file, extracts structure, and builds the skill. For a typical book, this takes a few minutes.

  4. Test with questions you already know the answers to. Ask your agent questions about the book's content. Watch it pull from the actual chapter files — not hallucinate. If the answers match what you remember, the skill is working.

  5. Stack the next skill. Once you trust the first one, convert another document. Each skill is independent and portable. In three months of one-skill-per-week, you'll have a specialist agent with a library of twelve skills.

What is the "discovery loop tax" and why does it matter?

The "discovery loop tax" is a term coined by the open-source book-to-skill project (18,385 GitHub stars, MIT license) to describe the hidden token cost of having an AI agent navigate a large PDF the traditional way. The project's own testing measured this cost on real books and found that skill-based learning uses 24 to 51 times fewer tokens than dumping the full book into the agent's context to answer a single question.

Here's why: when an agent reads a PDF the old way, it doesn't just read it front to back. It navigates — fetching the table of contents, jumping to a section, realizing it opened the wrong section, backtracking, re-reading. Every one of those hops goes into the conversation history and gets re-processed on every subsequent turn. The book never sticks. It's like hiring an assistant who reads your entire company handbook every morning and forgets it by lunch.

The skill-based approach pays the structuring cost once, at conversion time. After that, every question only costs what the answer costs — the structure is already built. The agent loads a small resident core (roughly 5,000 tokens for the main skill file plus the one chapter it needs) and answers from that.

Token cost comparison (measured on real books)

Book Size Context-dump cost Discovery-loop cost Skill-based cost Savings vs. context-dump
Think Python 2 119K tokens ~119,264 tokens ~12,152 tokens ~5,000 tokens ~24x fewer
Working Backwards 175K tokens ~175,253 tokens ~33,444 tokens ~5,000 tokens ~35x fewer
AI Engineering 256K tokens ~256,287 tokens ~77,866 tokens ~5,000 tokens ~51x fewer

Source: book-to-skill project's discovery_tax.py benchmark tool. The advantage scales with chapter size — larger books benefit more. Note: the discovery-loop figures are a one-time cost; the context-dump cost recurs on every single turn.

Which documents work best for AI agent skill conversion?

The most valuable documents for skill conversion are ones you re-open often enough that you wish you'd memorized them. Based on the book-to-skill project's documented use cases and Hermes Agent's knowledge-base skill capabilities, these categories deliver the highest ROI:

Document type Example Best for Skill outcome
Sales / marketing books Bestseller in your field Email drafting, objection handling Agent writes using the book's actual frameworks
Internal SOPs Client onboarding checklist Process consistency Every task follows your exact process
Brand voice guidelines Tone and style guide Content production Product descriptions and emails in your brand voice
Coaching / course materials Your own program content Client support Agent answers questions the way you would
Technical specs / APIs RFCs, compliance docs Development reference Agent looks up specs on demand
Research paper clusters Stack of papers + your notes Literature synthesis Unified knowledge base, updatable as new material lands

The key test: if you find yourself re-opening a document more than once a month, it's a candidate for skill conversion. The knowledge compounds — a library of ten skills built over ten weeks is a permanent asset that makes every future conversation cheaper and more accurate.

Do AI agents hallucinate when learning from documents?

Skill-based learning actually reduces hallucination compared to the alternative, because the agent answers from the actual content of your document rather than guessing. When the agent loads a skill built from your book, it reads the real chapter file — the extracted frameworks, definitions, and decision rules from the source text. The structure exists specifically to stop guessing.

The opposite problem is worse: when an agent has no access to the source material, it fills gaps with plausible-sounding but wrong outputs. That's what makes the traditional approach — pasting a PDF into chat and hoping the AI remembers — unreliable for business-critical documents. The skill-based approach grounds every answer in the actual content.

One important caveat: the distillation process synthesizes structure (frameworks, definitions, rules) and never reproduces full passages of the source text. This is by design — it's the difference between study notes and photocopying. The skill format ensures the agent has the knowledge without copying the content.

Are skills portable across different AI tools?

Yes — and this is one of the strongest arguments for building a skill library now. The skill format follows the open Agent Skills standard published at agentskills.io, which was originally developed by Anthropic and released as an open specification. As of early 2026, the same SKILL.md format works across at least 10 platforms:

Platform Skill location Compatibility
Claude Code .claude/skills/ Full standard
Hermes Agent ~/.hermes/skills/ Full standard + extensions
GitHub Copilot CLI ~/.copilot/skills/ Open standard
Cursor .claude/skills/ Open standard
Gemini CLI .claude/skills/ Open standard
OpenAI Codex CLI .claude/skills/ Open standard
Amp ~/.agents/skills/ Open standard
Goose (Block) .claude/skills/ Open standard
Windsurf .claude/skills/ Open standard
Roo Code .claude/skills/ Open standard

Source: agentskills.io specification and platform adoption documentation. The practical upshot: skills you build for Hermes Agent are not locked in. The knowledge travels with you if you switch to Claude Code, GitHub Copilot, or any other tool that reads the standard.

Old way vs. new way: what changes for your business?

The difference between the traditional approach and skill-based learning is the difference between renting knowledge and owning it. Here's the contrast that matters for a business:

The old way (context dumping): You find a great book on sales. You read it. Three months later you remember maybe 5% of it. Your AI never saw it at all, and that knowledge is effectively gone. Every time you need something from it, you re-upload the PDF, the agent re-reads it, and the cost compounds. Knowledge leaks out of your business constantly.

The new way (skill stacking): You find a great book on sales. You run /learn. Ten minutes later, your agent has a permanent, structured knowledge base built from that book. Every follow-up email it drafts, every objection-handling script it writes, every piece of outreach — it can pull from that book's actual frameworks forever. Then you stack the next book on top. Knowledge accumulates.

The critical insight: the gap between the person who builds a library of 50 skills over a year and the person who starts from zero doesn't close on its own. It widens. Because each new skill makes the agent more useful, which means you use it more, which means each subsequent skill has more context to draw on.

What this means for you

If you use AI for your work, your small business, or your building projects, here's what to do this week:

  1. Start with one document. Pick the single book or internal document you reference most often. Don't try to convert everything at once — the value is in building the habit of skill stacking.
  2. Test against questions you can verify. Ask your agent things you already know the answers to from the book. This builds trust before you rely on it for high-stakes work.
  3. Set a weekly cadence. One skill per week. In 90 days, you'll have a specialist agent that knows more about your specific domain than most of your team.
  4. Prioritize business-critical documents. Your brand voice guide, your sales playbook, your standard operating procedures — these are the documents where permanent agent knowledge delivers immediate ROI. For a deeper look at building company-wide AI knowledge systems, see our guide on how to build a company brain with compounding AI knowledge.
  5. Combine with scheduled automation. Hermes Agent can run tasks on a schedule with persistent memory and spawn subagents for parallel work. Feed it your industry's key reference material, set a weekly newsletter draft task, and you'll have a knowledge worker that studied your exact field — working while you sleep. Our personal AI agent OS setup guide walks through the full architecture.
  6. Don't wait for things to settle. The people who set this up this week will spend the next few months building a library of skills while everyone else is still copying and pasting PDFs into chat windows. Knowledge compounds — starting today beats starting perfectly next month. For more on why self-improving AI matters, see our analysis of why self-learning AI changes the game in 2026.

FAQ

Q: What file formats can an AI agent learn from? A: Hermes Agent's /learn command and the book-to-skill converter support PDF, EPUB, DOCX, RTF, TXT, Markdown, reStructuredText, AsciiDoc, HTML, and MOBI/AZW/AZW3 (the latter requires Calibre's ebook-convert tool). Any document file you have on your machine can be converted into a permanent skill.

Q: Does learning from a book violate copyright? A: The conversion process synthesizes structure — frameworks, definitions, decision rules — and never reproduces passages of the source text. The output is a structured derivative, like handwritten study notes, not a reproduction. The book-to-skill project is explicit about this: the generated skill is for personal use. Don't redistribute skills of copyrighted third-party works. Internal documents and openly-licensed material can be shared within their license terms.

Q: Is there a size limit on documents the agent can learn from? A: The main skill file is designed to stay lean (the resident core runs approximately 4,000–5,000 tokens), but the system creates reference files for each chapter or topic section. There is no hard limit on the source document size — the agent breaks large books into chapter-sized files and loads them on demand. The book-to-skill project has been tested on books exceeding 256,000 tokens in length.

Q: Do I need to know how to code to use /learn? A: No. The command is literally /learn followed by a file path. The agent handles the extraction, structuring, and skill authoring autonomously. If you can attach a file to an email, you can use this feature. The hardest part is deciding which document to start with.

Q: What happens if I run /learn on a second book about the same topic? A: Hermes Agent folds new material into an existing skill rather than creating a duplicate. This means you can build a unified knowledge base that grows over time — add a new book on sales, and the agent merges it with your existing sales skill, updating the index and adding new reference files as needed. This is the "skill stacking" approach that makes the library compound.

Q: Can I use the skills I build in Hermes Agent in other AI tools? A: Yes. The skill format follows the open Agent Skills standard (agentskills.io), which is supported by Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, OpenAI Codex CLI, Amp, and other platforms. The same SKILL.md file works across all of them. Platform-specific extensions degrade gracefully — other tools simply ignore unknown fields.

Sources
  1. Nous Research, "Hermes Agent Documentation — Skills System" — hermes-agent.nousresearch.com/docs/user-guide/features/skills (official docs, accessed Aug 2026)
  2. Nous Research, "Hermes Agent GitHub Repository" — github.com/NousResearch/hermes-agent (227,413 stars, MIT license, v0.20.0 released Aug 3, 2026)
  3. virgiliojr94, "book-to-skill: Turn any technical book into an agent skill" — github.com/virgiliojr94/book-to-skill (18,385 stars, MIT license)
  4. virgiliojr94, "book-to-skill Performance Documentation — Discovery Loop Tax" — github.com/virgiliojr94/book-to-skill/blob/master/docs/performance.md (measured token savings: 24x–51x)
  5. agentskills.io, "Agent Skills Open Standard Specification" — github.com/agentskills/agentskills (Apache 2.0 license; originally developed by Anthropic)
  6. MarkTechPost, "Nous Research Adds /learn to Hermes Agent's Skills System" — marktechpost.com (June 24, 2026)
  7. PyShine, "Hermes Agent Orange Book: A Practical Guide to Self-Improving AI Agents" — pyshine.com (April 20, 2026)
Updates & Corrections
  • 2026-08-08 — Article published. All facts verified against primary sources on August 8, 2026. GitHub star counts and release versions are current as of this date and will change over time.

Every claim here is traced to a primary source, dated, and listed under Sources. Research and drafting are AI-assisted; editing, verification and publication are human decisions, and a person is accountable for what appears on this page. How we work →

Get the practical AI brief

Verified, no-hype AI tips you can actually use - in your inbox. Free.

No spam. We verify what we send. Unsubscribe anytime.

Discussion

0 comments