SymbolicAI: A neuro-symbolic perspective on LLMs What is SymbolicAI? SymbolicAI is a neuro-symbolic framework, combining classical Python programming with the differentiable, programmable nature of LLMs in a way that actually feels natural in Python. It's built to not stand in the way of your ambitions. It's easily extensible and customizable to your needs by virtue of its modular design. It's quite easy to write your own engine, host locally an engine of your choice, or interface with tools like web search or image generation. To keep things concise in this README, we'll introduce two key concepts that define SymbolicAI: primitives and contracts. Primitives At the core of SymbolicAI are Symbol objects—each one comes with a set of tiny, composable operations that feel like native Python. from symai import Symbol Symbol comes in two flavours: Syntactic – behaves like a normal Python value (string, list, int ‐ whatever you passed in). Semantic – is wired to the neuro-symbolic engine and therefore understands meaning and context. Why is syntactic the default? Because Python operators ( == , ~ , & , …) are overloaded in symai . If we would immediately fire the engine for every bitshift or comparison, code would be slow and could produce surprising side-effects. Starting syntactic keeps things safe and fast; you opt-in to semantics only where you need them. How to switch to the semantic view At creation time S = Symbol ( "Cats are adorable" , semantic = True ) # already semantic print ( "feline" in S ) # => True On demand with the .sem projection – the twin .syn flips you back: S = Symbol ( "Cats are adorable" ) # default = syntactic print ( "feline" in S . sem ) # => True print ( "feline" in S ) # => False Invoking dot-notation operations—such as .map() or any other semantic function—automatically switches the symbol to semantic mode: S = Symbol ([ 'apple' , 'banana' , 'cherry' , 'cat' , 'dog' ]) print ( S . map ( 'convert all fruits to vegetables' )) # => ['carrot', 'b...
First seen: 2025-06-27 21:28
Last seen: 2025-06-28 08:30