Ch 5 — Resources & Resource Templates

Application-controlled data: giving the model context to read
High Level
-
Click play or press Space to begin...
Step- / 8
AWhat Are Resources?Data the application can attach to the LLM context
1
description
ResourceRead-only data
identified by URI
provides
visibility
ContextFile contents,
DB records, API data
vs
2
build
ToolsActions with
side effects
3
arrow_downward Discovering resources: listing and reading
BDiscovery & ReadingHow the application finds and fetches resources
search
resources/listBrowse available
resources
pick
download
resources/readFetch content
by URI
returns
article
ContentText or binary
blob data
4
arrow_downward URI schemes: how resources are addressed
CURI SchemesEvery resource has a unique URI address
folder
file://Local files
on disk
or
database
postgres://Database
records
or
hub
custom://Any server-defined
scheme
5
arrow_downward Resource templates: dynamic URIs with parameters
DResource TemplatesParameterized URIs for dynamic resources
data_object
TemplateURI with {params}
e.g. users/{id}/profile
fill
input
ParametersLLM or user
fills in values
becomes
6
link
Concrete URIResolved to a
specific resource
7
arrow_downward Subscriptions: real-time resource updates
ESubscriptionsGetting notified when a resource changes
notifications_active
SubscribeClient watches
a resource URI
notify
sync
UpdatedServer notifies
when content changes
re-read
refresh
Re-fetchClient reads
fresh content
8
arrow_downward Control boundary: application-controlled, not model-controlled
FControl BoundaryWho decides which resources get attached?
person
User / AppDecides which
resources to attach
attaches
smart_toy
LLM ContextResources become
part of the prompt
reads
psychology
ModelReads context
but doesn't choose it
1
Detail