Interface Prompt

All Known Implementing Classes:
TextPrompt

public interface Prompt
A named, identified, guardrailed unit of instructional content destined for an LLM.

Every Prompt is produced through the Prompts facade, which is the only public entry point for obtaining Prompt instances. Direct construction is not supported.

A Prompt has three invariants:

  • key() - semantic identifier; first-class. Two Prompts with identical content under different keys are distinct Prompts.
  • content() - canonical content as a JsonNode. Text prompts produce TextNode; structured prompts (e.g., skills) produce ObjectNode.
  • context() - lineage metadata (content hash, produced-at, optional version/variant). Not serialized over the wire; marked @JsonIgnore. Represents identity, not content.

Polymorphism of content shape lives inside JsonNode, not in the Prompt type. The single shipped implementation is TextPrompt.

Since:
0.1 (2026-04-20)
Author:
Andrey Santrosyan
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.JsonNode
    Canonical content: TextNode for text, ObjectNode for structured prompts.
    Lineage metadata.
    key()
    Semantic identifier.
  • Method Details

    • key

      String key()
      Semantic identifier. Shape: <domain>.<feature>.<role>, e.g. pharma.drugbank.system-msg.
    • content

      com.fasterxml.jackson.databind.JsonNode content()
      Canonical content: TextNode for text, ObjectNode for structured prompts.
    • context

      PromptContext context()
      Lineage metadata. Never serialized into the wire or persisted within the Prompt itself.