This command adds an element to working memory and returns the timetag of the wme. In effect, Soar's working memory is surgically altered by this command. add-wme adds a new wme with the given id, attribute, value, and optional preference. The given id must be an existing identifier. The attribute and value fields can be any Soar symbol. If * is given in the attribute or value field, Soar creates a new identifier (symbol) for that field. If the preference is given, it can only have the value + to indicate that an acceptable preference should be created for this wme.
add-wme is often used by an input function to update Soar's information about the state of the external world.
add-wme S1 ^message-status received
This example adds an attribute/value pair with an acceptable preference to the identifier (symbol) Z2. The attribute is "message" and the value is a unique identifier generated by Soar. Note that since the ^ is optional, it has been left off in this case.
add-wme Z2 message * +