Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
e35b15c
Show namespace placement and structured memory use
abrookins Sep 14, 2026
770f120
Make Agent Memory docs easier to learn and apply
abrookins Sep 15, 2026
7287b09
Make Agent Memory guides easier to find
abrookins Sep 15, 2026
f408e76
docs: expose namespace routing in the memory API reference
abrookins Sep 16, 2026
1825638
docs: explain sortable session listing
abrookins Sep 29, 2026
9650c36
DOC-7121 Consolidate agent-memory Python/TypeScript SDK quickstarts i…
andy-stark-redis Sep 29, 2026
de6e1f2
Preserve published guidance while updating Agent Memory docs
abrookins Oct 9, 2026
6d65f5f
docs: make namespace session discovery visible
abrookins Sep 15, 2026
8f1a9df
Explain how to use memory before asking readers to act
abrookins Oct 9, 2026
64d3c58
Distinguish memory ownership from authenticated access
abrookins Oct 15, 2026
980af20
Merge remote-tracking branch 'origin/main' into docs/namespace-routin…
abrookins Oct 21, 2026
7d921c1
Merge remote-tracking branch 'origin/main' into docs/MOD-18775-sessio…
abrookins Oct 21, 2026
33cca9a
Merge remote-tracking branch 'origin/main' into docs/agent-memory-nam…
abrookins Oct 21, 2026
db36282
Keep SDK quickstart current with beta releases
abrookins Oct 21, 2026
9ff1238
Show how to list sessions with the beta SDKs
abrookins Oct 21, 2026
6c656f9
Cover beta retrieval and placement behavior
abrookins Oct 21, 2026
b4df6ab
Keep routing guidance aligned with the beta API
abrookins Oct 21, 2026
79a1039
Merge branch 'docs/MOD-18775-session-listing' into docs/sdk-tce-beta-…
abrookins Oct 21, 2026
1b31209
Merge branch 'docs/namespace-routing-openapi' into docs/MOD-18775-ses…
abrookins Oct 21, 2026
c2db789
Merge branch 'docs/sdk-tce-beta-audit' into docs/agent-memory-namespa…
abrookins Oct 21, 2026
b479234
Honor hidden footers in SDK examples
abrookins Oct 21, 2026
b748e39
Merge branch 'docs/sdk-tce-beta-audit' into docs/agent-memory-namespa…
abrookins Oct 21, 2026
abbdbbe
Keep quickstart links valid after consolidation
abrookins Oct 21, 2026
8a520fa
Merge branch 'docs/sdk-tce-beta-audit' into docs/agent-memory-namespa…
abrookins Oct 21, 2026
ecd52ad
Show the beta namespace sorting call shapes
abrookins Oct 21, 2026
0d4468d
Reuse SDK examples for the unified quickstart
abrookins Oct 21, 2026
03e4cdd
Preserve the developer connection link
abrookins Oct 21, 2026
a56a107
Write routing setup for stable publication
abrookins Oct 21, 2026
25257db
Merge branch 'docs/namespace-routing-openapi' into docs/MOD-18775-ses…
abrookins Oct 21, 2026
5e292c9
Use stable SDK packages in session setup
abrookins Oct 21, 2026
912d122
Merge branch 'docs/MOD-18775-session-listing' into docs/sdk-tce-beta-…
abrookins Oct 21, 2026
1530cb2
Install stable SDKs in the published quickstart
abrookins Oct 21, 2026
7205a07
Prepare stable install instructions for publication
abrookins Oct 21, 2026
b0c3771
docs(iris): add Context Gateway developer and self-managed docs
nkanu17 Oct 22, 2026
5ac63cc
docs(iris): apply the Context Gateway docs review
nkanu17 Oct 22, 2026
5db6186
Merge remote-tracking branch 'origin/main' into RED-220418/context-ga…
nkanu17 Oct 22, 2026
ca516ad
docs(iris): remove the Context Retriever docs in favor of Context Gat…
nkanu17 Oct 22, 2026
85cd136
docs: scaffold Agent Playbooks guides and review handoff
tylerhutcherson Oct 1, 2026
114112c
docs(iris): refine Playbooks developer guides and examples
tylerhutcherson Oct 12, 2026
5ddff46
MOD-19391 Add Python, TypeScript, and cURL pseudo-clients for Iris ex…
andy-stark-redis Oct 14, 2026
eb745e9
docs: align Playbooks navigation with the Iris docs space
tylerhutcherson Oct 14, 2026
e2f9e31
docs: give the FAQ authoring guide a task-specific URL
tylerhutcherson Oct 14, 2026
6c6a2b9
docs: simplify cross-language naming explanations
tylerhutcherson Oct 14, 2026
c442956
docs: use standard TCE sources for Playbooks examples
tylerhutcherson Oct 14, 2026
67f9016
docs: separate Playbooks MCP and agent integration guides
tylerhutcherson Oct 14, 2026
03da1f1
docs: simplify Playbooks MCP examples and guide navigation
tylerhutcherson Oct 14, 2026
f5a1e09
docs: improve Playbooks navigation and Python examples
tylerhutcherson Oct 15, 2026
b07e7ee
docs: add Playbooks workflow diagrams
tylerhutcherson Oct 15, 2026
772939a
docs: clarify Redis Agent Playbooks terminology
tylerhutcherson Oct 15, 2026
9996b99
docs: align Playbooks guides with alpha.3 SDKs
tylerhutcherson Oct 18, 2026
05a9897
docs: add unified Python and CLI Playbooks examples
tylerhutcherson Oct 21, 2026
c51fa40
docs: focus Proposals guide on reusable agent knowledge
tylerhutcherson Oct 21, 2026
12bd469
docs: show Iris CLI commands directly
tylerhutcherson Oct 21, 2026
428b113
docs: simplify Playbooks examples and fix retention diagram
tylerhutcherson Oct 21, 2026
7520513
docs: fix Playbooks quickstart navigation
tylerhutcherson Oct 22, 2026
d6d2388
Merge pull request #4249 from redis/MOD-19391-playbook-developer-docs
tylerhutcherson Oct 22, 2026
2ad7d8e
Consolidate Agent Memory docs for the GA branch
abrookins Oct 22, 2026
319a93e
Make new Agent Memory features usable from the docs
abrookins Oct 23, 2026
6947a0e
MOD-20119: Add the Lens developer docs design
therealaditigupta Oct 23, 2026
e5c947f
MOD-20119: Remove the reviewers table from the Lens docs design
therealaditigupta Oct 23, 2026
8546bce
MOD-20119: Remove review and approval steps from the Lens docs design
therealaditigupta Oct 23, 2026
29a1d6a
MOD-20119: Settle deployments, banner, read API inputs, and validatio…
therealaditigupta Oct 23, 2026
9cc32f5
MOD-20119: Draft Lens concepts and quickstart
therealaditigupta Oct 23, 2026
95dd9f4
MOD-20119: Use the Iris example tabs for the Lens quickstart
therealaditigupta Oct 23, 2026
a22c72d
MOD-20119: Draft the remaining Lens developer docs
therealaditigupta Oct 23, 2026
15d7056
MOD-20119: Apply accuracy and reader review fixes to the Lens docs
therealaditigupta Oct 23, 2026
bb5e133
MOD-20119: Lead the Lens tagline with debugging agent answers
therealaditigupta Oct 23, 2026
2b7a154
Merge remote-tracking branch 'origin/iris-ga-docs' into RED-220418/co…
nkanu17 Oct 23, 2026
202acc5
Merge pull request #4323 from redis/RED-220418/context-gateway-docs
nkanu17 Oct 23, 2026
d14a0b0
Separate operator setup and clarify memory examples
abrookins Oct 23, 2026
d8f2a65
Keep ownership enforcement guidance scoped to on-prem
abrookins Oct 23, 2026
f6c7ac8
Clarify the Agent Memory overview
abrookins Oct 23, 2026
0185cb1
Remove repetition and correct Agent Memory setup
abrookins Oct 23, 2026
c7bc156
docs: open the Context Gateway landing with What is Context Gateway
nkanu17 Oct 23, 2026
3c5d5fa
Merge pull request #4343 from redis/RED-220418/context-gateway-landin…
nkanu17 Oct 24, 2026
c294d5f
Update content/develop/ai/context-engine/lens/agent-integration.md
therealaditigupta Oct 26, 2026
7ad5b1f
Update content/develop/ai/context-engine/lens/_index.md
therealaditigupta Oct 26, 2026
ae0fe55
Update content/develop/ai/context-engine/lens/agent-integration.md
therealaditigupta Oct 26, 2026
2d054fe
Update content/develop/ai/context-engine/lens/_index.md
therealaditigupta Oct 26, 2026
8aa2cd4
Update content/develop/ai/context-engine/lens/_index.md
therealaditigupta Oct 26, 2026
064c43f
MOD-20119: Apply docs review suggestions to the Lens pages
therealaditigupta Oct 26, 2026
3a09e9a
docs: document per-Gateway result cache and handle settings
nkanu17 Oct 26, 2026
00e27db
Add Redis Intent Router developer and self-managed docs
simba-git Oct 26, 2026
cf52efa
Fix Intent Router docs from live testing and source review
simba-git Oct 26, 2026
7916b0e
Merge pull request #4329 from redis/MOD-20119-iris-lens-developer-docs
rbs333 Oct 26, 2026
9feac3d
Merge remote-tracking branch 'origin/iris-ga-docs' into RED-220418/co…
nkanu17 Oct 26, 2026
ecb3956
Nest list-sessions and namespace-routing under parents; use tile card…
rbs333 Oct 26, 2026
80b9457
Merge pull request #4001 from redis/docs/agent-memory-namespaces-cust…
rbs333 Oct 26, 2026
b6f7ae7
Merge pull request #4349 from redis/RED-220418/context-gateway-gatewa…
nkanu17 Oct 26, 2026
234322a
docs: rename Gateway result feature fields to cache and compression
nkanu17 Oct 26, 2026
14f9baa
docs(iris): align Iris docs with the redis-iris SDK and CLI (MOD-20269)
rbs333 Oct 26, 2026
3e0ac4b
docs(iris): drop preview wording from Iris product pages (MOD-20269)
rbs333 Oct 26, 2026
57c9517
docs(iris): Lens is beta; use Agent Playbooks in Lens pages (MOD-20269)
rbs333 Oct 26, 2026
249a921
docs(iris): use Agent Playbooks in sample error messages (MOD-20269)
rbs333 Oct 26, 2026
10fb8bf
Avoid listing all hook statuses when inspecting one event
abrookins Oct 27, 2026
e3b0716
Merge remote-tracking branch 'upstream/iris-ga-docs' into intent-rout…
simba-git Oct 27, 2026
f933090
Apply review suggestions to the Intent Router docs
simba-git Oct 27, 2026
edde1b1
docs: rename the last resultCache policy reference to cache
nkanu17 Oct 27, 2026
efb1c9a
docs: sync the Gateway Control Plane OpenAPI contract with cache and …
nkanu17 Oct 27, 2026
978a8b5
docs(agent-mesh): add preview overview and browser quickstarts
jruaux Oct 27, 2026
ced653b
docs(agent-mesh): add A2A and FastAPI SDK integration guides
jruaux Oct 27, 2026
94d3a31
Merge pull request #4352 from redis/RED-222240/context-gateway-cache-…
nkanu17 Oct 27, 2026
4e949b4
docs(RED-222240): use the cache and compression names for Gateway con…
nkanu17 Oct 27, 2026
08492be
Update Iris concepts, landing page, and tour for the GA services
mich-elle-luna Oct 27, 2026
2aef0b7
docs(MOD-19196): document the on-prem Gateway and Surface database de…
nkanu17 Oct 27, 2026
32aa48b
Add Redis Cloud setup docs for the Iris GA services
mich-elle-luna Oct 27, 2026
745c28d
Merge pull request #4355 from redis/docs/iris-ga-review-followups
abrookins Oct 27, 2026
4ab9e25
Drop the intro from the Intent Router control-plane API reference
simba-git Oct 28, 2026
bae0ba1
Merge remote-tracking branch 'upstream/iris-ga-docs' into intent-rout…
simba-git Oct 28, 2026
9ea379b
Open every Intent Router page with an introduction
simba-git Oct 28, 2026
5a16d44
docs(agent-mesh): demonstrate agent progress in FastAPI quickstart
jruaux Oct 28, 2026
b0a79ce
Update content/develop/ai/context-engine/agent-mesh/_index.md
jruaux Oct 28, 2026
af87d73
Update content/develop/ai/context-engine/_index.md
jruaux Oct 28, 2026
ffd42b6
Update content/operate/iris/_index.md
jruaux Oct 28, 2026
136cd69
docs(agent-mesh): document compatible combined SDK installation
jruaux Oct 28, 2026
531aa8f
docs(agent-mesh): clarify subscriptions to already-waiting tasks
jruaux Oct 28, 2026
6cd7e13
docs(iris): add SDK and CLI setup page (MOD-20269)
rbs333 Oct 28, 2026
ae24f7c
docs(iris): link the product quickstarts and the SDK and CLI setup pa…
rbs333 Oct 28, 2026
9a30082
docs(agent-mesh): migrate FastAPI examples to scoped runs
jruaux Oct 28, 2026
895b072
docs(RED-222240): document the on-prem database defaults and database…
nkanu17 Oct 28, 2026
274b4b2
docs(RED-222240): drop the old result cache and result handles names …
nkanu17 Oct 28, 2026
40c447e
docs(RED-222240): use the compression_unsupported rule the API returns
nkanu17 Oct 28, 2026
0bc1138
docs(RED-222240): add Gateway database sizing guidance
nkanu17 Oct 29, 2026
67d6a3d
Rework the Iris request flow, tour, and concepts diagram
mich-elle-luna Oct 29, 2026
6cd910f
Merge pull request #4357 from redis/codex/agent-mesh-preview-docs
jruaux Oct 29, 2026
9d06453
Move Intent Router beside the agent and add a Lens step to the Iris tour
paoloredis Oct 29, 2026
457448c
docs(iris): tighten the SDK and CLI setup page (MOD-20269)
rbs333 Oct 29, 2026
06771ab
Merge remote-tracking branch 'origin/iris-ga-docs' into MOD-20269/red…
rbs333 Oct 29, 2026
ad0577e
docs(iris): point Lens at the Iris host for the unified Iris API (MOD…
rbs333 Oct 29, 2026
c0753a1
Merge pull request #4348 from redis/MOD-20269/redis-iris-alignment
rbs333 Oct 29, 2026
86c1c91
Merge branch 'iris-ga-docs' into iris-ga-concepts
mich-elle-luna Oct 29, 2026
81700f2
Merge pull request #4359 from redis/iris-ga-concepts
mich-elle-luna Oct 29, 2026
f22a44c
docs(agent-mesh): align guides with current SDK contracts
jruaux Oct 29, 2026
5370626
docs(agent-mesh): use beta availability terminology
jruaux Oct 29, 2026
acb8afd
docs(agent-mesh): add agent SDK streaming recipes
jruaux Oct 29, 2026
c1e65a0
Iris docs: name the console menu Iris, and match the console's key steps
rbs333 Oct 30, 2026
193d884
Iris docs: refresh the Iris OpenAPI references from the unified API c…
rbs333 Oct 30, 2026
8464dfe
Iris docs: move the Agent Playbooks REST examples to the unified API
rbs333 Oct 30, 2026
52519be
Iris docs: move the self-managed Agent Memory examples to the unified…
rbs333 Oct 30, 2026
5e22c5a
Iris docs: move the Agent Memory developer REST examples to the unifi…
rbs333 Oct 30, 2026
486b016
Merge pull request #4387 from redis/docs/iris-console-naming
rbs333 Oct 30, 2026
6232bd3
docs(agent-mesh): document A2A task hand-off between processes
jruaux Oct 30, 2026
3414e3e
Merge pull request #4392 from redis/docs/MOD-20320-rest-resync
rbs333 Oct 30, 2026
94ee7ba
Merge iris-ga-docs into intent-router-docs
rbs333 Oct 30, 2026
e3f2127
Intent Router: refresh API reference specs from the 1.0.0 contract
rbs333 Oct 30, 2026
ca6de3a
Intent Router: update examples to redis-iris 1.0.0b1 and the 1.0.0 SDKs
rbs333 Oct 30, 2026
ec76138
Intent Router: align page prose with 1.0.0 paths, SDKs, and CLI
rbs333 Oct 30, 2026
52ad25b
Merge pull request #4347 from simba-git/intent-router-docs
rbs333 Oct 30, 2026
cd36257
docs(agent-mesh): explain first-frame deadline responses
jruaux Oct 30, 2026
a78bc22
docs(agent-mesh): simplify A2A installation commands
jruaux Oct 29, 2026
938c97f
Merge pull request #4379 from redis/codex/agent-mesh-sdk-contract-update
jruaux Oct 30, 2026
852fdc9
Merge pull request #4381 from redis/codex/agent-sdk-recipes
jruaux Oct 30, 2026
2f9e515
Merge remote-tracking branch 'origin/iris-ga-docs' into docs/agent-me…
jruaux Oct 30, 2026
5988f14
Merge pull request #4394 from redis/docs/agent-mesh-a2a-handoff
jruaux Oct 30, 2026
e053f61
Align the Iris Redis Cloud setup docs with the current console
mich-elle-luna Oct 30, 2026
87b0059
Iris docs: GA consistency pass on the 1.0 release and CLI
rbs333 Oct 30, 2026
8419ba4
Merge iris-ga-docs into cloud-setup-docs
mich-elle-luna Oct 30, 2026
a7e2919
Iris docs: Agent Memory SDK snippets on the 1.0 SDKs
rbs333 Oct 30, 2026
436402a
Iris docs: Playbooks examples on the 1.0 SDKs
rbs333 Oct 30, 2026
59601f4
Iris docs: Lens read examples on the 1.0 SDK
rbs333 Oct 30, 2026
9bd0c7f
Merge pull request #4401 from redis/docs/iris-ga-1.0-consistency
rbs333 Oct 30, 2026
1755db7
Merge pull request #4402 from redis/docs/agent-memory-sdk-1.0
rbs333 Oct 30, 2026
690e908
Merge pull request #4403 from redis/docs/iris-examples-1.0
rbs333 Oct 30, 2026
35ca248
Merge pull request #4360 from redis/cloud-setup-docs
mich-elle-luna Oct 30, 2026
06c7031
docs(MOD-20222): align Gateway GA reference and examples
nkanu17 Oct 31, 2026
aace5e9
docs(MOD-20222): correct the self-managed Gateway pages against main
nkanu17 Oct 31, 2026
30f6026
docs(MOD-20222): correct the Gateway developer pages against main
nkanu17 Oct 31, 2026
4ae6468
docs(MOD-20222): clarify search limits and conditional Gateway behavior
nkanu17 Oct 31, 2026
2c169f6
Merge pull request #4410 from redis/MOD-20222/gateway-ga-docs
nkanu17 Oct 31, 2026
1dadb82
docs(MOD-20222): merge current Iris docs and resolve quickstart conflict
nkanu17 Oct 31, 2026
3f343bd
Merge pull request #4358 from redis/RED-222240/drop-result-cache-names
nkanu17 Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/check-playbook-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check Playbooks documentation

on:
pull_request:
paths:
- 'content/develop/ai/context-engine/agent-playbooks/**'
- 'build/agent_playbook_docs/**'
- 'local_examples/iris/playbooks/**'
- 'build/components/example.py'
- 'build/local_examples.py'
- 'build/example-test-harness/clients.tsv'
- 'config.toml'
- 'layouts/partials/process-markdown-content.html'
- 'layouts/_default/apireference.html'
- '.github/workflows/check-playbook-docs.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: build/agent_playbook_docs/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: build/agent_playbook_docs/package-lock.json
- run: python -m pip install -r build/agent_playbook_docs/requirements.txt
- run: npm ci --prefix build/agent_playbook_docs
- run: python build/agent_playbook_docs/check_sdk_source.py
- run: python build/agent_playbook_docs/examples.py build/agent_playbook_docs/.generated
- run: build/agent_playbook_docs/node_modules/.bin/tsc -p build/agent_playbook_docs
- run: python -m pytest build/agent_playbook_docs --rootdir . -q
2 changes: 2 additions & 0 deletions build/agent_playbook_docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.generated/
!package-lock.json
71 changes: 71 additions & 0 deletions build/agent_playbook_docs/check_sdk_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""Check the docs API against the locked iris-sdks public contract.

Without arguments, verify the vendored contract without network access.
With --sdk-repo, also verify the local SDK contract, example overlay, and version.
An upstream change requires reviewing the source lock and SDK pin together.
"""

import argparse
from copy import deepcopy
import hashlib
import json
from pathlib import Path

import yaml


ROOT = Path(__file__).resolve().parents[2]
LOCK = Path(__file__).with_name("source-lock.json")
SPEC = ROOT / "content/develop/ai/context-engine/agent-playbooks/api-reference/openapi.json"


def wire_contract(document):
result = deepcopy(document)
result["info"].pop("title", None)
result.pop("tags", None)
for methods in result["paths"].values():
for operation in methods.values():
if not isinstance(operation, dict) or "operationId" not in operation:
continue
operation.pop("tags", None)
operation.pop("summary", None)
return result


def digest(document):
content = json.dumps(wire_contract(document), sort_keys=True, separators=(",", ":"))
return hashlib.sha256(content.encode()).hexdigest()


def check(sdk_repo=None):
lock = json.loads(LOCK.read_text())
expected = lock["data_plane_contract_sha256"]
if digest(json.loads(SPEC.read_text())) != expected:
raise ValueError("Docs contract differs from the locked SDK input. Regenerate and review it.")
if sdk_repo is not None:
upstream = json.loads((sdk_repo / lock["sdk_contract_path"]).read_text())
if digest(upstream) != expected:
raise ValueError("SDK contract changed. Review the API, examples, version pin, and source lock together.")
overlay = sdk_repo / lock["sdk_example_overlay_path"]
if hashlib.sha256(overlay.read_bytes()).hexdigest() != lock["sdk_example_overlay_sha256"]:
raise ValueError("SDK usage examples changed. Review the docs walkthroughs before updating the source lock.")
config = yaml.safe_load((sdk_repo / "playbook-python-sdk/.speakeasy/gen.yaml").read_text())
if config["python"]["version"] != lock["sdk_generator_version"]:
raise ValueError("SDK version changed. Review the docs dependency pin.")
typescript = json.loads((sdk_repo / "playbook-ts-sdk/package.json").read_text())
if f"{typescript['name']}@{typescript['version']}" != lock["typescript_package"]:
raise ValueError("TypeScript SDK version changed. Review the docs dependency pin.")
return lock


if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--sdk-repo", type=Path)
args = parser.parse_args()
try:
lock = check(args.sdk_repo)
except ValueError as error:
parser.exit(1, str(error) + "\n")
print(f"Docs match the locked SDK contract ({lock['python_package']}).")
if args.sdk_repo:
print("Local SDK contract, usage overlay, and generator version also match.")
160 changes: 160 additions & 0 deletions build/agent_playbook_docs/examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"""Read the standard TCE sources for Playbooks validation.

Site builds use build/local_examples.py and clients-example. This adapter exposes
those same processed source files and named steps to the API example checks.
"""

from functools import lru_cache
from pathlib import Path
import re
import shutil
import sys
from tempfile import TemporaryDirectory

ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT / "build"))
from components.example import Example
from local_examples import get_example_id_from_file, get_language_from_extension

DOCS = ROOT / "content/develop/ai/context-engine/agent-playbooks"
SOURCES = ROOT / "local_examples/iris/playbooks"
GUIDES = ("quickstart", "faqs", "skills", "proposals", "retrieval", "mcp", "limits")
AGENT_GUIDES = ("openai_agent", "langgraph_agent")
PAGE_NAMES = {"faqs": "manage-faqs", "skills": "manage-skills"}
CLIENTS = {}
for row in (ROOT / "build/example-test-harness/clients.tsv").read_text().splitlines():
if row.startswith("iris-") and not row.startswith("iris-cli\t"):
fields = row.split("\t")
CLIENTS[fields[6].rsplit(".", 1)[1]] = fields[1]
assert set(CLIENTS) == {"py", "mts", "sh"}
ALL_CLIENTS = {**CLIENTS, "cli.sh": "CLI (Iris)"}
CALLS = re.compile(r'\{\{< clients-example\s+([^>]*?)/>\}\}', re.S)
ATTRS = re.compile(r'(\w+)="([^"]*)"')
FENCE = re.compile(r"```(?:python|typescript|bash)\n(.*?)\n```", re.S)


def source_path(page, suffix, action=None):
name = f"{page}_{action}" if action else "mcp_client" if page == "mcp" else page
return SOURCES / page / f"{name}.{suffix}"


@lru_cache(maxsize=128)
def _processed(path, mtime):
with TemporaryDirectory(prefix="playbook-tce-") as directory:
target = Path(directory) / path.name
shutil.copy2(path, target)
example = Example(get_language_from_extension(path.name), str(target))
assert example.named_steps, f"No named steps in {path}"
return target.read_text(), example.named_steps


def processed(path):
return _processed(path, path.stat().st_mtime_ns)


def bundle(set_id):
result = {}
for path in SOURCES.rglob("*"):
suffix = "cli.sh" if path.name.endswith(".cli.sh") else path.suffix.lstrip(".")
if suffix in ALL_CLIENTS and get_example_id_from_file(str(path)) == set_id:
assert suffix not in result, f"Duplicate {suffix} source in {set_id}"
result[suffix] = path
assert result, f"Unknown Playbook example set: {set_id}"
return result


def step(path, name):
source, steps = processed(path)
assert name in steps, f"Missing {name} in {path}"
start, end = map(int, steps[name].split("-"))
return "\n".join(source.splitlines()[start - 1:end])


def calls(page):
source = (DOCS / f"{PAGE_NAMES.get(page, page)}.md").read_text()
return [dict(ATTRS.findall(body)) for body in CALLS.findall(source)]


def blocks(page):
"""Collect published shared steps and their retained TypeScript test fixtures."""
result = []
seen = set()
for attrs in calls(page):
if not {CLIENTS["py"], CLIENTS["sh"]}.issubset(attrs.get("lang_filter", "").split(",")):
continue
name = attrs["step"]
assert name not in seen, f"Duplicate step in {page}: {name}"
seen.add(name)
files = bundle(attrs["set"])
result.append((name, [step(files[suffix], name) for suffix in CLIENTS]))
return result


def skill_package():
return step(source_path("skills", "sh"), "playbook-skill-package")


def scripts(page, omit=()):
selected = [block for block in blocks(page) if block[0] not in omit]
if page not in ("quickstart", "mcp"):
setup = next(block for block in blocks("quickstart") if block[0] == "playbook-connect")
selected.insert(0, setup)
result = ["\n\n".join(block[1][i] for block in selected) + "\n" for i in range(3)]
if page == "skills":
result[2] = skill_package() + "\n\n" + result[2]
result[2] = "set -euo pipefail\n\n" + result[2]
return dict(zip(CLIENTS, result))


def full_examples():
return {source_path(page, suffix): processed(source_path(page, suffix))[0]
for page in ("quickstart", "skills") for suffix in ALL_CLIENTS}


def cli_script(page):
selected = [attrs for attrs in calls(page)
if "CLI (Iris)" in attrs.get("lang_filter", "").split(",")
and not attrs["set"].endswith(("_delete", "_withdraw"))]
if not selected:
return None
pieces = []
if page != "quickstart":
pieces.append(step(source_path("quickstart", "cli.sh"), "playbook-connect"))
for attrs in selected:
pieces.append(step(bundle(attrs["set"])["cli.sh"], attrs["step"]))
if page == "skills":
pieces.insert(0, skill_package())
return "set -euo pipefail\n\n" + "\n\n".join(pieces) + "\n"


def agent_scripts():
return {(page, suffix): processed(source_path(page, suffix))[0]
for page in AGENT_GUIDES for suffix in ("py", "mts")}


def standalone_python(page, heading):
assert (page, heading) == ("quickstart", "Use Python asynchronously")
return processed(SOURCES / "async/async_example.py")[0]


if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("output", type=Path)
args = parser.parse_args()
args.output.mkdir(parents=True, exist_ok=True)
for path in args.output.glob("*_download.*"):
path.unlink()
for page in GUIDES:
for suffix, source in scripts(page).items():
(args.output / f"{page}_example.{suffix}").write_text(source)
if source := cli_script(page):
(args.output / f"{page}_example.cli.sh").write_text(source)
for path, source in full_examples().items():
suffix = "cli.sh" if path.name.endswith(".cli.sh") else path.suffix[1:]
name = path.name.removesuffix("." + suffix)
(args.output / f"{name}_copy.{suffix}").write_text(source)
for (page, suffix), source in agent_scripts().items():
(args.output / f"{page}_example.{suffix}").write_text(source)
(args.output / "async_search_example.py").write_text(standalone_python("quickstart", "Use Python asynchronously"))
Loading
Loading