Documentation index for AI agents: see /llms.txt. Markdown versions of every page are available at <path>.md or via Accept: text/markdown.
Reference

References

Typed memory pointer declarations. Customer code may supply a glimpse callback that produces a small JSON summary stored alongside the reference.

Typed memory pointer declarations. Customer code may supply a glimpse callback that produces a small JSON summary stored alongside the reference.

define_reference

define_reference(name: 'str', schema: 'Any', ttl_ms: 'int | None' = None, glimpse: 'Callable[[Any], Any] | None' = None) -> 'ReferenceSpec'

ParameterTypeDefault
namestrrequired
schemaAnyrequired
ttl_msint | NoneNone
glimpseCallable[[Any], Any] | NoneNone

Returns: ReferenceSpec

Create a validated Flow AI reference spec with optional customer glimpse code.

Args: name: Reference kind name used when creating and resolving references. schema: Schema of the referenced value: a JSON Schema mapping, a Pydantic model class, a simple type map, or any type hint Pydantic can export. ttl_ms: Optional time-to-live in milliseconds for stored values; must be non-negative when set. glimpse: Optional Python callback that derives the stored glimpse from the full value. It runs once before storing and is excluded from the Rust wire spec.

Returns: A frozen, validated ReferenceSpec.

Raises: TypeError: If the schema input cannot be normalized to JSON Schema. pydantic.ValidationError: If ttl_ms is negative.

ReferenceSpec

ReferenceSpec(*, name: str, schema: dict[str, typing.Any], ttlMs: Annotated[int | None, Ge(ge=0)] = None, glimpse: collections.abc.Callable[[typing.Any], typing.Any] | None = None) -> None

ParameterTypeDefault
namestrrequired
schemadictrequired
ttlMstyping.AnnotatedNone
glimpsecollections.abc.Callable[[Any], Any] | NoneNone

Returns: None

Named typed memory pointer declaration.

glimpse is a Python-only customer callback. It is excluded from the Rust wire spec; hosts call it before storing a reference and pass the resulting JSON glimpse to the runtime.