FYI, I just noticed that
TclCLIPS
provides a Tcl interface to the public domain
CLIPS
expert system software, originally developed at NASA back in 1985.
Among other things, CLIPS implements a "forward chaining rule language
based on the Rete algorithm", and is supposed to be easily embeddable
into other applications. It is also available as a
Debian package.
Various commercial systems like
CLIPS/R2
seem to have been forked from this codebase at some point.
CLIPS was intended was as a toolkit for building expert systems, and
unfortunately, nothing I saw in the docs or FAQ mentioned integration
with RDBMSs like Postgres. (There has definitely been research work
into that sort of thing elsewhere, though.)
It is also unclear how applicable CLIPS would be to non expert system
production systems, like Jerry's large scale automated online exchange
that started off this thread. Question 24 in the
CLIPS FAQ,
"Can CLIPS be used for real time applications?", implies that it may
not scale to such demanding service loads, but mentions only
the underlying Rete algorithm itself as a possibly bottleneck, so
perhaps updating CLIPS to use newer algorithms like LEAPS would
address any such problems.