Skip to content

Commit e02f84b

Browse files
committed
docs(tutorial): facts append after the system prompt at minute granularity, matching the cache-prefix fix
1 parent 8535292 commit e02f84b

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

docs/src/content/docs/tutorial/28-fact-resolver.mdx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@ it'll guess. The fix is not a better prompt — it's a companion
1313
deterministic layer that supplies the ground truth on every turn.
1414

1515
`FactResolver` is that companion. You implement it, you declare which
16-
keys you supply, and Atmosphere prepends the resolved bundle to the
17-
system prompt before every dispatch.
16+
keys you supply, and Atmosphere appends the resolved bundle to the
17+
end of the system prompt before every dispatch — after the stable
18+
persona/schema text, so provider prompt-prefix caches keep hitting.
1819

1920
## The default behavior
2021

2122
Atmosphere ships `DefaultFactResolver` out of the box. It supplies
22-
`time.now` (UTC ISO-8601) and `time.timezone` only. With no extra
23-
wiring, every turn's system prompt starts with:
23+
`time.now` (UTC ISO-8601, minute granularity — so same-minute turns
24+
produce byte-identical blocks and stay cache-friendly) and
25+
`time.timezone` only. With no extra wiring, every turn's system prompt
26+
ends with:
2427

2528
```
2629
Grounded facts (deterministic, as of this turn):
27-
- time.now: 2026-04-19T18:32:14Z
30+
- time.now: 2026-04-19T18:32Z
2831
- time.timezone: UTC
2932
```
3033

@@ -127,12 +130,14 @@ in `@AfterEach`.
127130
## What the model sees
128131

129132
The resolver's bundle is rendered as a newline-delimited block and
130-
prepended to the system prompt. A request from `alice@example.com` on
131-
a paid tier sees, at the top of the system prompt:
133+
appended after the system prompt (volatile facts stay the suffix so
134+
the stable prefix remains cacheable). A request from
135+
`alice@example.com` on a paid tier sees, at the end of the system
136+
prompt:
132137

133138
```
134139
Grounded facts (deterministic, as of this turn):
135-
- time.now: 2026-04-19T18:32:14Z
140+
- time.now: 2026-04-19T18:32Z
136141
- time.timezone: UTC
137142
- user.id: alice@example.com
138143
- user.name: Alice Martin

0 commit comments

Comments
 (0)