SynaLinks/synalinks

Keras based framework for neuro-symbolic LM systems

Synalinks – Neuro‑symbolic framework for language‑model applications

What it is

  • An open‑source Python library that lets you build, train, evaluate, and deploy advanced language‑model (LM)‑based systems – RAGs, autonomous agents, recursive agents, and other neuro‑symbolic pipelines – with a Keras‑style declarative API.

Core ideas

  • Modules as layers – You compose reusable Module objects just like Keras Layers.
  • In‑context RL – Optimize prompts, few‑shot examples, or any trainable variable without touching the underlying model weights, using the familiar .compile() / .fit() / .evaluate() / .predict() workflow.
  • Model‑agnostic – Switch between any LLM supported by LiteLLM (OpenAI, Anthropic, Ollama, Gemini, Mistral, Groq, etc.) with a single set_default_language_model call, even supporting multi‑objective selection for cost/quality trade‑offs.
  • Embedded sandbox – Agents run untrusted code in a pure‑Python sandbox that requires no Docker or external services, making it safe for serverless or notebook environments.
  • Built‑in knowledge bases – Graph‑based and SQL‑based embedded databases for vector/RAG storage, automatic semantic deduplication, and constrained knowledge‑graph extraction.
  • Production‑ready deployment – Export programs as FastAPI services or FastMCP servers with a single command.

Key features

  • Declarative composition of LM pipelines (Program, Branch, data‑model operators).
  • Structured data‑model definitions with automatic JSON schema validation.
  • Multimodal support (images, audio) as first‑class message parts.
  • Hyper‑parameter search via KerasTuner compatibility.
  • Observability hooks for MLflow (metrics, tracing, Monitor callback).
  • Automatic async‑parallel execution of modules.
  • Agent‑skills integration – install synalinks-skills so coding agents (Claude Code, Cursor, Copilot, etc.) can generate idiomatic Synalinks code.

Typical users

Role Why it helps
AI developers Build production‑grade LM apps without boilerplate.
Researchers Prototype neuro‑symbolic or RL‑in‑context systems quickly.
Data scientists Hook LLM workflows into existing APIs, databases, or pipelines.
Students / hobbyists Learn composable AI programming in a clean, Keras‑like style.

Quick start

# Install the CLI helper (uv is recommended)
uvx synalinks init          # scaffolds a new project in seconds
# Or add the library to an existing project
uv add synalinks

Set a default model once:

import synalinks
synalinks.set_default_language_model("gemini/gemini-3.1-flash-lite-preview")

Then define a simple agent program (see README for a full example). The library handles sandboxing, skill loading, and async execution automatically.

Installation requirements

  • Python 3.12+.
  • Linux: fuse3 and enable unprivileged user namespaces.
  • macOS (Apple silicon): install libkrun via Homebrew.
  • Windows: use WSL2 and follow the Linux steps.

License

  • Apache‑2.0 (per the badge in the README).

Community & support

  • Documentation site, FAQ, Discord server, and a dedicated synalinks-skills repo for agent integrations.

Bottom line Synalinks aims to be the "Keras for language‑model applications," offering a high‑level, production‑ready toolkit for anyone wanting to move from prototype to deployed neuro‑symbolic AI systems with minimal boilerplate.

Related

  • Project
  • Project
  • Project
  • Project
  • Project