Skip to content

Document system-prompt template variables#104

Merged
JakeSCahill merged 1 commit into
redpanda-data:mainfrom
birdayz:jb/system-prompt-template-vars
Jun 18, 2026
Merged

Document system-prompt template variables#104
JakeSCahill merged 1 commit into
redpanda-data:mainfrom
birdayz:jb/system-prompt-template-vars

Conversation

@birdayz

@birdayz birdayz commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Add a Template variables section to the agent system prompts page (modules/connect/pages/system-prompts.adoc) documenting the variables an agent injects into its system prompt at render time: the .Now date fields (.Date, .Weekday, .Month, .Year), the raw .Now.Time, and .User.Email.

Why

The agent system prompt supports Go-template interpolation, but the feature was undocumented. Agents commonly need the current date for temporal grounding and the caller's email for per-user scoping. Without docs, builders can't discover the variables or the behavior that bites: times are UTC, sub-day formatting hurts prompt caching, and a malformed template fails the agent at startup.

Implementation details

One new == Template variables section: a variable reference table with example output, a worked example prompt, a cache-stability note, and a validation note. It states that all times are UTC, that the day-granular date fields keep the upstream model prompt cache warm while sub-day formatting of .Now.Time defeats it, and that a broken template stops the agent from starting rather than failing per request. The same variables apply to agent and subagent prompts.

Grounded in the ai-agent system prompt provider and verified against the shipped behavior.

References

Implements docs for redpanda-data/cloudv2#27240.

Add a Template variables section to the system prompts page covering the
.Now date fields (.Date/.Weekday/.Month/.Year), the raw .Now.Time, and
.User.Email. Notes that times are UTC, that day-granular fields keep the
upstream prompt cache warm while sub-day .Now.Time formatting does not,
and that a malformed template fails at agent startup.

Documents the feature added in the ai-agent system prompt provider.
@birdayz birdayz requested a review from a team as a code owner June 18, 2026 11:51
@netlify

netlify Bot commented Jun 18, 2026

Copy link
Copy Markdown

👷 Deploy request for redpanda-agentic-data-plane pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 37b7017

@birdayz

birdayz commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Opened from a fork, so I couldn't request reviewers directly. @JakeSCahill @kbatuigas - could one of you take this, or assign the docs team? Documents the system-prompt template variables shipped in redpanda-data/cloudv2#27240.

@JakeSCahill

Copy link
Copy Markdown
Contributor

Lovely. Thank you.

@JakeSCahill JakeSCahill merged commit bf960bc into redpanda-data:main Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants