> For the complete documentation index, see [llms.txt](https://stakpak.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stakpak.gitbook.io/docs/how-it-works/knowledge-sources.md).

# Knowledge Sources

## Introduction

Stakpak does not treat all knowledge equally.

When you ask a question or give a task, the agent follows a clear knowledge hierarchy to decide where to look first and why.

This ensures answers are aligned with your environment, your standards, and real world DevOps practices, not generic advice.

This page explains the different knowledge sources Stakpak uses, how they are prioritized, and when each one is applied.

## Knowledge Source Hierarchy

Stakpak evaluates knowledge sources in the following order:

1. [Rulebooks](/docs/how-it-works/rulebooks.md)\
   Rulebooks teach Stakpak your organization’s way of doing things. They’re Markdown based SOPs (standard operating procedures) &#x20;
2. [Paks](https://github.com/stakpak/paks)\
   Reusable [Agent skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview) packages contributed by the community.
3. Documentation Search\
   It retrieves official external documentation for precise, version-specific information.
4. [Memory (Knoweldge Store)](/docs/how-it-works/memory-knoweldge-store.md)\
   Knowledge Store is a persistent operational memory layer that lets Stakpak agents and users save, search, and reuse infrastructure knowledge across sessions.

This hierarchy exists to ensure responses are:

* Aligned with your standards
* Safe to execute

| Knowledge Source                                                         | Trust Level | Ownership                |
| ------------------------------------------------------------------------ | ----------- | ------------------------ |
| [Rulebooks](/docs/how-it-works/rulebooks.md)                             | Very High   | Organization             |
| [Paks](https://github.com/stakpak/paks)                                  | Medium      | Community                |
| Documentation Search                                                     | Medium      | External (official docs) |
| [Memory (Knoweldge Store)](/docs/how-it-works/memory-knoweldge-store.md) | High        | Sessions                 |

**Ready to turn your team’s operational knowledge into something reusable?**

Check [How to Write a Rulebook?](/docs/how-it-works/rulebooks/how-to-write-a-rulebook.md) to create rulebooks that encode how your team operates, or explore community contributed [Paks](https://paks.stakpak.dev/) for battle tested, reusable infrastructure patterns.
