symbolicai  by ExtensityAI

Compositional differentiable programming library for neuro-symbolic AI with LLMs

created 2 years ago
1,561 stars

Top 27.3% on sourcepulse

GitHubView on GitHub
Project Summary

SymbolicAI is a Python library for building applications with Large Language Models (LLMs) by composing operations using a neuro-symbolic approach. It enables seamless integration of classical and differentiable programming, allowing users to break down complex problems into smaller, manageable tasks solvable by LLMs and classical code. The library is designed for developers and researchers working with LLMs who need a flexible framework for complex task decomposition and execution.

How It Works

SymbolicAI leverages a "divide and conquer" strategy, decomposing problems into sub-tasks that can be handled by individual operations. These operations can be classical Python code or LLM-based prompts. The core Symbol class acts as a base for all operations, allowing for composition and evaluation in the natural language domain, similar to word2vec but operating on text rather than vector embeddings. This approach facilitates human-readable verification of results and enables novel operations like sentence manipulation and fuzzy comparisons.

Quick Start & Requirements

  • Install via pip: pip install symbolicai
  • Requires API keys for supported neuro-symbolic engines (OpenAI, Anthropic, local engines like llama.cpp, Huggingface).
  • Optional dependencies for enhanced functionality: pip install "symbolicai[wolframalpha]", pip install "symbolicai[whisper]", pip install "symbolicai[selenium]", pip install "symbolicai[serpapi]", pip install "symbolicai[pinecone]", or pip install "symbolicai[all]".
  • Speech-to-text requires ffmpeg.
  • Web crawler (Selenium) requires Chrome and chromedriver-autoinstaller.
  • Configuration can be managed via environment variables or JSON files (symai.config.json, symsh.config.json, symserver.config.json).
  • View configuration with symconfig.
  • Official documentation: https://symbolicai.readthedocs.io/en/latest/

Highlighted Details

  • Enables neuro-symbolic reasoning by defining causal relationships and logical implications using overloaded operators (& for implication).
  • Supports dynamic casting for seamless operations between Symbol objects and various data types (strings, numbers, lists).
  • Offers probabilistic programming capabilities with fuzzy comparisons.
  • Provides tools for text, speech, image processing, and web search integration.

Maintenance & Community

  • Project initiated by Marius-Constantin Dinu.
  • Community support available via Discord.
  • Seeking contributors and investors.

Licensing & Compatibility

  • Licensed under BSD-3-Clause License.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

  • The only_nesy=True flag is required for logical operators to prevent default string concatenation, which can be a syntactic limitation.
  • The framework relies heavily on external API keys for its core functionality, requiring users to manage these credentials.
Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
544 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.