# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stakpak.gitbook.io/docs/how-it-works/knowledge-sources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
