← Back to Discover

SymbolicAI

Open-source Python framework that mixes ordinary code with LLM-powered operations, using Symbol primitives and design-by-contract checks on model output.

Agent frameworks

What it does

SymbolicAI is a Python framework for calling language models through a small set of composable operations. Its core object, the Symbol, behaves like a normal Python value by default and can be switched into a semantic mode, where comparisons and other operations work on meaning rather than literal values. Contracts are its answer to unreliable model output. A decorator wraps a class with data models and validation rules, can try to repair bad inputs and outputs automatically, retries with the history of earlier errors, and returns a graceful fallback if the contract cannot be met. Data models are compatible with Pydantic. Engines are configurable. The README shows settings for language models, symbolic and formal solvers, embeddings, search, text-to-speech, image drawing, OCR and speech-to-text, with provider-prefixed model names for OpenAI, Anthropic and Gemini. You supply your own API keys, and you can host an engine locally. Optional extras add clustering, Qdrant indexing, scraping, video and Whisper support.

Capabilities

  • Symbol primitives that switch between syntactic and semantic behavior
  • Design-by-contract decorator with validation and automatic remedies
  • Pluggable engines for LLMs, embeddings, search, OCR, speech and image generation
  • Provider-prefixed model names across OpenAI, Anthropic and Gemini
  • Pydantic-compatible data models
  • Installs with pip, with optional extras

When to use it

  • Building Python applications where LLM calls must return validated, typed output
  • Experimenting with neuro-symbolic approaches that combine LLMs and solvers
  • Switching model providers without rewriting application code