Neuro-Symbolic Workflows
LLLM’s prompts and agent loop were designed so that researchers can combine symbolic constraints (XML tags, Markdown sections, structured parsers) with probabilistic reasoning. The recommended pattern is:
- Define schemas – create
Promptobjects that declare XML/Markdown tags or attach a Pydanticresponse_formatmodel. - Enable handlers – customize
exception_prompt/interrupt_promptso the agent can repair malformed output or summarize tool results before continuing. - Link tools – register
Functionobjects that wrap symbolic routines (e.g., theorem checkers, graph search) and attach them to prompts viafunctions_list. - Parse deterministically – leverage the
parsercallback on prompts to convert returned text into strongly typed Python objects.
Because the agent loop keeps retrying until the parser succeeds (or the retry budget is exhausted), you can layer multiple symbolic constraints without losing the rapid iteration benefits of free-form LLM prompting.