# Synalinks

Use for anything involving the Synalinks neuro-symbolic LM framework (Keras-inspired)...

- Repository: https://github.com/SynaLinks/synalinks-skills (908 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-09-28
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add SynaLinks/synalinks-skills --skill synalinks -g -a claude-code -y`
Codex: `npx skills add SynaLinks/synalinks-skills --skill synalinks -g -a codex -y`
Cursor: `npx skills add SynaLinks/synalinks-skills --skill synalinks -g -a cursor -y`
Gemini CLI: `npx skills add SynaLinks/synalinks-skills --skill synalinks -g -a gemini-cli -y`

## Description

Use for anything involving the Synalinks neuro-symbolic LM framework (Keras-inspired): DataModel/Field/Input, JSON operators (+ & | ^ ~), synalinks.ops; LanguageModel/EmbeddingModel and provider prefixes; DecisionModel (TypeSafe jev decision models, decision_model=, min_confidence/threshold); the Program class and its four APIs, save/load; modules (Generator, ChainOfThought, SelfCritique, PythonSynthesis, custom Module); control flow (Decision, MultiDecision, Branch, And/Or/Xor, guards); agents (FunctionCallingAgent, RLM, DeepAgent, Tool, MCP); KnowledgeBase/RAG; training (compile/fit/evaluate/predict, callbacks, KerasTuner tuners); rewards (ExactMatch, CosineSimilarity, LMAsJudge, ProgramAsJudge, RubricsAsJudge and presets like Faithfulness/Toxicity, AgentAsJudge, DeepAgentAsJudge, RLMAsJudge, ComposableReward, BatchReward) and metrics; optimizers (RandomFewShot, OMEGA); datasets, visualization. Synalinks is Keras-shaped: without guidance LMs mix Keras/LangChain/DSPy syntax.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Synalinks

Synalinks is an open-source, Keras-inspired framework for building neuro-symbolic
LM applications (RAGs, agents, self-evolving reasoning) with in-context
reinforcement learning. This skill is the single entry point: each section below
is a scannable overview that points to a **runnable script + its captured run log**
and a **deep-dive reference doc** under `references/`.

## Core abstractions

- **DataModel**, Pydantic-style schema for structured I/O (replaces tensors).
- **Module**, async computational unit processing JSON data (replaces layers).
- **Program**, DAG of modules with conditional logic (replaces models).
- **Reward / Optimizer**, guide training by *maximizing reward* (no gradients;
  prompts/examples/plans are the trainable variables).
- **DecisionModel**, answers typed questions (yes/no, choice, score) with
  calibrated probabilities instead of generating text; used for decisions.

## Universal gotchas (apply everywhere)

1. **All module constructors are keyword-only** (`*` after `self`). Call
   `Generator(data_model=Answer, language_model=lm)`, never positionally. The
   one exception is `Tool(func, *, ...)`, `func` stays positional.
2. **`instructions` MUST be a string**, never a list, passing a list raises
   `ValidationError`.
3. **All `call()` methods are async**, `await` every module/program call.
4. **`language_model`/`embedding_model` may be omitted** if a process-wide
   default is set (`set_default_language_model(...)`); resolved at call time.
5. **Always check for `None` results**, a failed LM call or a non-activated
   branch yields `None`.
6. **A `DecisionModel` is never a `language_model`**, passing one as
   `language_model` raises. Modules that can decide take `decision_model=`.

## Quick Start

```python
import synalinks, asyncio

class Query(synalinks.DataModel):
    query: str = synalinks.Field(description="The user query")

The rest: https://github.com/SynaLinks/synalinks-skills/blob/HEAD/skills/synalinks/SKILL.md
