File-backed AI handbook knowledge systems with progressive disclosure, evidence, and CRUD tooling.
Project description
Patchouli Handbook
Patchouli Handbook is a file-backed knowledge system for AI agents. It is inspired by skills, but it is intentionally thicker: a skill can trigger the right behavior, while a handbook can hold a full guide, routing map, reusable entries, glossary, source evidence, validation, and CRUD tooling.
Use it when an agent needs more than a short SOP: domain principles, decision rules, examples, anti-patterns, and source-grounded guidance that should be expanded progressively instead of loaded all at once.
What It Provides
- A stable on-disk handbook format built from Markdown plus
manifest.json. - A lightweight
entry_skill/SKILL.mdactivation layer for skill-aware agents. - A thicker
GUIDE.mdoperating manual for complex tasks. - Category and entry pages for progressive disclosure.
- Optional evidence pages and source indexes for provenance.
- A Python API and JSON CLI for creating, editing, validating, and inspecting handbooks.
- A complete example handbook generated from public game-design source summaries.
Repository Layout
patchouli_handbook/ Python library and CLI
docs/ Architecture, authoring, and agent protocol docs
example/ Example generated handbooks
tests/ Unit tests
pyproject.toml Package metadata and console script
Handbook Layout
<handbook_dir>/
├── manifest.json
├── GUIDE.md
├── INDEX.md
├── entry_skill/
│ └── SKILL.md
├── categories/
│ └── <category_slug>/
│ ├── CATEGORY.md
│ └── <entry_slug>.md
├── references/
│ ├── glossary.md
│ └── source_index.md
└── evidence/
└── <source_id>.md
Quick Start
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[dev]'
Python 3.10+ is supported.
Create a blank handbook:
patchouli-handbook init \
--output output/studio-handbook \
--title "Studio Handbook" \
--audience "AI agents and studio maintainers"
Add content:
patchouli-handbook categories create \
'{"title":"Planning","description":"Scoping, goals, and project framing."}' \
--handbook output/studio-handbook
patchouli-handbook entries create \
'{"title":"Scope First","category_slug":"planning","summary":"Decide the scope before choosing tactics."}' \
--handbook output/studio-handbook
patchouli-handbook validate --handbook output/studio-handbook
Inspect the included example:
patchouli-handbook inspect --handbook example/masahiro-sakurai-on-creating-games
patchouli-handbook validate --handbook example/masahiro-sakurai-on-creating-games
Start reading the example at:
example/masahiro-sakurai-on-creating-games/GUIDE.mdexample/masahiro-sakurai-on-creating-games/INDEX.md
CLI
Common commands:
patchouli-handbook structure
patchouli-handbook describe --handbook <handbook_dir>
patchouli-handbook validate --handbook <handbook_dir>
patchouli-handbook categories list --handbook <handbook_dir>
patchouli-handbook entries get <entry_slug> --handbook <handbook_dir>
Machine-readable integration point:
patchouli-handbook apply '{"action":"get_entry","slug":"scope-first"}' --handbook <handbook_dir>
apply accepts these actions:
describevalidatelist_categorieslist_entriesget_categoryget_entryupdate_bookcreate_categoryupdate_categorydelete_categorycreate_entryupdate_entrydelete_entry
CLI failures are emitted as JSON:
{
"ok": false,
"error": {
"type": "KeyError",
"message": "'Unknown entry: missing-entry'"
}
}
Python API
from patchouli_handbook import HandbookStore, create_empty_handbook
create_empty_handbook(
"output/studio-handbook",
title="Studio Handbook",
audience="AI agents and studio maintainers",
)
store = HandbookStore("output/studio-handbook")
store.create_category(
{
"title": "Planning",
"description": "Scoping, goals, and project framing.",
}
)
store.create_entry(
{
"title": "Scope First",
"category_slug": "planning",
"summary": "Decide the scope before choosing tactics.",
"use_when": ["The task is broad or under-specified."],
"do_this": ["Name the goal.", "Name constraints.", "Pick the smallest useful next step."],
"checklist": ["The scope is explicit.", "The next action is concrete."],
"anti_patterns": ["Do not choose tactics before defining the target."],
}
)
print(store.validate().model_dump())
Build From Source Summaries
The builder can generate a handbook from a channel_extractor-style job directory containing:
channel.jsonvideos.jsonclean/<video_id>.json
Example:
export OPENAI_API_KEY=...
patchouli-handbook build \
--input path/to/channel-job \
--output output/generated-handbook
The builder writes GUIDE.md, INDEX.md, category pages, entry pages, references, evidence pages, entry_skill/SKILL.md, and manifest.json.
Documentation
- Architecture: artifact layout and layer responsibilities.
- Agent Protocol: how an AI agent should progressively read a handbook.
- Minimal Integration Example: the smallest useful CLI loop for external agents and programs.
- Authoring Guide: how to add categories, entries, evidence, and links.
- Minimal Template: planning worksheet for a new handbook.
Included Example
example/masahiro-sakurai-on-creating-games demonstrates a generated handbook with:
- 14 categories
- 260 entries
- 299 evidence pages
GUIDE.mdplus a skill-compatibleentry_skill/SKILL.md
The example is included to show the intended scale and navigation pattern of a thick handbook.
Test
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file patchouli_handbook-0.1.0.tar.gz.
File metadata
- Download URL: patchouli_handbook-0.1.0.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f137e0000ce8132a29097e4ee318a7389228a958138e53fbdd1a4ef06ffa58b
|
|
| MD5 |
49ee749473de263816e531fdddde55fd
|
|
| BLAKE2b-256 |
33b61c73e8d864cbb5cd29982cf10bcacb19f4b48db3848a50351b61cc45d46f
|
Provenance
The following attestation bundles were made for patchouli_handbook-0.1.0.tar.gz:
Publisher:
ci.yml on Tritium0041/patchouli-handbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patchouli_handbook-0.1.0.tar.gz -
Subject digest:
6f137e0000ce8132a29097e4ee318a7389228a958138e53fbdd1a4ef06ffa58b - Sigstore transparency entry: 1604161092
- Sigstore integration time:
-
Permalink:
Tritium0041/patchouli-handbook@bb4561ec055140101e520d0bfa95f718f6f2bd1d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Tritium0041
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@bb4561ec055140101e520d0bfa95f718f6f2bd1d -
Trigger Event:
push
-
Statement type:
File details
Details for the file patchouli_handbook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: patchouli_handbook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbde8c7084cd5869361c3b75b984c5ca887270c9034ddd9273884eb87336d502
|
|
| MD5 |
858a95d5ec685a502d040605f7eb985d
|
|
| BLAKE2b-256 |
38ce406f7d6ed8c7960ead91c4ad2926f56b45b42d05fe1ddb191285ad35aef8
|
Provenance
The following attestation bundles were made for patchouli_handbook-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on Tritium0041/patchouli-handbook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patchouli_handbook-0.1.0-py3-none-any.whl -
Subject digest:
dbde8c7084cd5869361c3b75b984c5ca887270c9034ddd9273884eb87336d502 - Sigstore transparency entry: 1604161202
- Sigstore integration time:
-
Permalink:
Tritium0041/patchouli-handbook@bb4561ec055140101e520d0bfa95f718f6f2bd1d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Tritium0041
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@bb4561ec055140101e520d0bfa95f718f6f2bd1d -
Trigger Event:
push
-
Statement type: