This paper introduces declarative reflection schemata and describes im
plementation tools for it. The keywords are planning and inference, i.
e. a declarative (non-procedural) description of self must exist and b
e used for making inferences about the future activities of the reflec
tive system and about consequences of these activities. The NUT system
is used as a platform for intelligent agents with reflection. NUT pro
cesses running in a network are agent shells filled with knowledge in
the form of NUT packages. A knowledge-based technique supported by aut
omatic synthesis of programs is used for declarative reflection: a ref
lection schema with a model of self managed by daemons is implemented
using run-time compilation/decompilation of classes and metaprogrammin
g with productions.