Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Binsai

Binsai.PY

Binsai MVP1 demo — 3 agents regulated by metabolic drive
MVP1: 3 agents (Alpha, Beta, Gamma) regulated by δ_metabolic. Green = active, Red = suspended.

English · Español

Python Version License


English

Bio-Inspired Neuro-Symbolic AI — give agents motivations, not just capabilities

Binsai is an interoperable Python substrate for building situated, event-driven and self-regulating AI agents.

Binsai is a regulatory harness for existing agent frameworks (LangGraph, AutoGen, CrewAI, OpenClaw). It adds motivations and internal self-state without forcing you to abandon your current stack.

Instead of only asking what an agent can do, Binsai helps decide why, when, and whether it should act.

Current version: 0.0.1.dev0 · Status: MVP 1 "Hungry Agents" ✅ — See demo


Why Binsai exists

The problem: motivation is usually external

Modern agent frameworks make LLMs more capable by adding tools, memory, workflows, and communication protocols.

But motivation is usually external: a graph, supervisor, or queue decides when the agent acts.

Binsai adds an internal regulatory layer: drives, needs, set-points, deficits, social/computational budgets, and adaptive intervention policies.

The proposal: a bio-inspired regulatory substrate

Binsai is a Python library for adding bio-inspired drives and regulatory self-state to LLM agents.

It provides FIPA-inspired communication, async perception, explicit time/space context, regulatory drives, and adaptive intervention policies.

We draw from cognitive neuroscience, cybernetics (Stafford Beer), and systemic materialism (Bunge-Romero) to build agents that:

  • Have stratified needs (from computational resources to purpose)
  • Regulate behavior through homeostasis and allostasis
  • Decide when, how, and if to act (regulated proactivity)
  • Are auditable (we know why they did what they did)

Binsai does not replace frameworks like LangGraph, AutoGen, or OpenClaw. It gives them internal motivational dynamics.


Installation

pip install binsai

Or with Poetry:

poetry add binsai

Quick Start

from binsai import World, WorldConfig

# Deterministic simulation from seed alone
config = WorldConfig(seed=42, dry_run_llm=True)
world = World(config)

# Run 10 ticks
for _ in range(10):
    frame = world.step()
    for a in frame.agents:
        print(f"tick={frame.tick}  {a.name}: δ={a.delta}, zone={a.zone}, action={a.action}")

This creates 3 agents (Alpha, Beta, Gamma) with heterogeneous λ rates. Gamma starts unregulated for ablation comparison. Each tick: demands arrive, agents appraise and act, drives evolve.

Full demo: examples/mvp1_hungry/

MVP1: What works now

This release is MVP1 — Hungry Agent. It implements the metabolic drive layer (Bunge S1) with:

  • One active drive: metabolic — regulates when the agent sleeps, acts fast, acts slow, defers, or goes idle.
  • FIPA lifecycle: INITIATED → ACTIVE → SUSPENDED → ACTIVE with causal transitions.
  • Sleep/consolidation: When metabolic deficit exceeds threshold, agent suspends; wakes when recovered AND queue is empty.
  • State injection: Regulatory state (δ, zone) is embedded in LLM prompts so the model reads its own "physiology".
  • Symbolic pre-check: A minimal rule-checker gates proactive actions based on drive zone and queue size.

What is NOT in MVP1: The other 9 canonical drives do not yet affect behavior. Memory is native bounded working memory only (no LangGraph/LlamaIndex/Mem0 adapters yet). Neuro-symbolic layer is a rule-checker, not yet DeLP/AHP/TOPSIS.


What makes Binsai different

Stratified drives

Since 2019, the AopifyJS roadmap included:

"Homeostatic Motives system"

Binsai now implements this with philosophical grounding: 10 canonical drives across 6 ontological levels (Bunge-Romero):

  • S1 Material: δ_metabolic (tokens, energy, latency) — MVP 1
  • S3 Biological: δ_safety, δ_epistemic, δ_coherence, δ_competenceMVP 2
  • S4 Technical: δ_artifact_integrity (Safe AI), δ_niche_construction (Engels/Lewontin)
  • S5 Social: δ_relatedness, δ_autonomy
  • S6 Technological: δ_meaning (purpose)

Each drive has set-points, decay rates, and fuzzy sigmoid activation (no hard thresholds). Per Driveplexity A2: D(δ) = (δ · σ(k·δ))².

Tri-process arbitration

Inspired by Stanovich (Type 1/2/3) and our Γ paper: the agent decides between fast/slow/abstain/sleep routes based on its internal regulatory state, not just the input.

State-regulated prompting

The Γ paper introduces RSVI (Regulatory State Verbalized Interoception): numerical regulatory state is verbalized into the LLM prompt as decision context, without directly prescribing actions. MVP1 embeds drive state (δ, zone memberships) into the system prompt before every LLM call. The LLM reads its own "physiology" and self-regulates reasoning depth. Future MVPs will generalize this to the full Γ operator.

Lego memory

The brain distinguishes working, episodic, semantic, and procedural memory. Binsai MVP1 provides a native bounded working memory (7 items) with LLM-based consolidation during sleep. Future MVPs will add episodic/semantic backends and optional adapters.

Neuro-symbolic layer

A minimal symbolic pre-commit check gates proactive actions based on drive zone and queue size (MVP1). Future MVPs will integrate defeasible argumentation (DeLP), multi-criteria aggregation (AHP), and ranking (TOPSIS).


Demos (pixel-art)

Each MVP ships with a visual demo using Phaser 3:

MVP Demo What it shows
1 Hungry Agents δ_metabolic (S1 Bunge) + dummy human + FIPA lifecycle + fuzzy sigmoid
2 Curious Agent (upcoming) All S3 drives: δ_safety, δ_epistemic, δ_coherence, δ_competence
3 Social Agent (upcoming) S5 drives: δ_relatedness, δ_autonomy
4 Reflective Agent (upcoming) Tri-process arbitrator (Γ operator)
5 Operator Demos (upcoming) Driveplexity + Γ running inside Binsai
6 World Model + VSM (upcoming) OntologicalGraph + recursion

Documentation

📚 Full documentation (coming soon)


Related Papers

  • Driveplexity (JAIIO 2025, under review): Endogenous activation in multi-agent LLM debate
  • Pro-Action Γ (in preparation): Multi-subsystem regulatory operator for affective agents
  • AAH (in preparation): Affective allostatic homeostasis for prosocial AI

Use Cases

For agent developers

Integrate Binsai as a regulatory layer over your favorite framework. Granular control over behavior, systematic ablation, motivation debugging.

from binsai import BinsaiAgent, Drives, World, WorldConfig

# Create an agent with stratified drives
agent = BinsaiAgent(name="Assistant", drives=Drives.stratified())

# The agent's metabolic drive regulates when it acts, sleeps, or defers

For academic research

Reproducible science with papers that include Binsai code. Every prompting technique is versioned and logged.

For industry (regulated, health, customer support)

Auditability: every decision leaves a trace of which drives conditioned it. Symbolic pre-checks provide lightweight justification for critical domains.


Comparison with other frameworks

Framework Focus Does Binsai complement it?
LangGraph Control flow graphs Yes, as a regulatory layer on top
AutoGen Multi-agent conversation Yes, as internal state for each agent
CrewAI Task delegation Yes, as motivation for each crew member
OpenClaw Symbolic reasoning Yes, we integrate its symbolic layer

We don't compete: Binsai is the substrate, they are the framework.


Lineage

This project evolves from:

  • AopifyJS (2019, FIPA/declarative agents in Node.js)
  • Langpify (Python SDK for neuro-symbolic agents)
  • LangClaw (multi-agent orchestration)
  • Driveplexity and Pro-Action Γ (research papers)

Contributing

See CONTRIBUTING.md

Discord: discord.gg/binsai (coming soon)


Package roadmap

Binsai ships incrementally through six MVPs, each adding a Bunge ontological level:

  • MVP 1 — Hungry Agents: δ_metabolic (S1), FIPA lifecycle, fuzzy sigmoid activation, sleep/consolidation, ablation mode
  • MVP 2 — Curious Agent: δ_safety, δ_epistemic, δ_coherence, δ_competence (S3), episodic + semantic memory
  • MVP 3 — Social Agent: δ_relatedness, δ_autonomy (S5), FIPA communicative acts, multi-agent EventBus
  • MVP 4 — Reflective Agent: Tri-process arbitrator (Γ), SAM/HPA hormonal delays, metacognition, ask/wait/act/back-off
  • MVP 5 — Operator Demos: Driveplexity + Γ operators ported into Binsai, δ_niche_construction, δ_artifact_integrity (S4), δ_meaning (S6)
  • MVP 6 — World Model + VSM: OntologicalGraph (E, R, M, V, C), recursive VSM agents, neuro-symbolic wrappers (DeLP/AAF/AHP/TOPSIS)
  • v0.1.0: PyPI release, Zenodo DOI, full documentation

License

GNU General Public License v3.0 — see LICENSE

Copyright (C) 2026 Patricio Gerpe


"Next-generation intelligent agents will not emerge solely from scaling predictive models, but from coupling generative models with regulatory substrates capable of managing needs, resources, memory, coherence, and social relationships under thermodynamic constraints."


Español

IA Neuro-Simbólica Bio-Inspirada — dale a los agentes motivaciones, no solo capacidades

Binsai es un sustrato Python interoperable para construir agentes de IA situados, orientados a eventos y autorregulados.

Binsai agrega motivaciones y estado regulatorio interno a frameworks existentes (LangGraph, AutoGen, CrewAI, OpenClaw), sin forzar a abandonar el stack actual.

En lugar de preguntar solo qué puede hacer un agente, Binsai ayuda a decidir por qué, cuándo y si debe actuar.

Instalación

pip install binsai

Inicio rápido

from binsai import World, WorldConfig

config = WorldConfig(seed=42, dry_run_llm=True)
world = World(config)

for _ in range(10):
    frame = world.step()
    for a in frame.agents:
        print(f"tick={frame.tick}  {a.name}: δ={a.delta}, zona={a.zone}, acción={a.action}")

Esto crea 3 agentes (Alpha, Beta, Gamma) con λ heterogéneas. Gamma arranca sin regulación para comparación por ablación.

MVP1: Qué funciona ahora

Este release es MVP1 — Agente Hambriento. Implementa la capa de drive metabólico (Bunge S1):

  • Un drive activo: metabolic — regula cuándo el agente duerme, actúa rápido, lento, difiere o está inactivo.
  • Ciclo FIPA: INITIATED → ACTIVE → SUSPENDED → ACTIVE con transiciones causales.
  • Sueño/consolidación: Cuando el déficit metabólico excede el umbral, el agente se suspende; despierta cuando se recupera Y la cola está vacía.
  • Inyección de estado: El estado regulatorio (δ, zona) se incrusta en los prompts del LLM.
  • Pre-check simbólico: Un verificador de reglas mínimo controla acciones proactivas según zona y tamaño de cola.

Qué NO está en MVP1: Los otros 9 drives canónicos no afectan el comportamiento. La memoria es nativa de trabajo limitada (sin adapters). La capa neuro-simbólica es un verificador de reglas, no DeLP/AHP/TOPSIS.

¿Por qué existe Binsai?

Los frameworks modernos hacen a los LLMs más capaces agregando herramientas, memoria, flujos de trabajo y protocolos. Pero la motivación suele ser externa: un grafo, supervisor o cola decide cuándo actúa el agente.

Binsai agrega una capa regulatoria interna: drives, necesidades, set-points, déficits, presupuestos sociales/computacionales y políticas de intervención adaptativas. Inspiración funcional en neurofisiología, cibernética (Stafford Beer) y materialismo sistémico (Bunge-Romero).

Roadmap

  • MVP 1 — Agentes Hambrientos: δ_metabolic (S1), ciclo FIPA, activación sigmoide difusa, sueño/consolidación, modo ablación
  • MVP 2 — Agente Curioso: drives S3, memoria episódica y semántica
  • MVP 3 — Agente Social: drives S5, actos comunicativos FIPA, multiagente
  • MVP 4 — Agente Reflexivo: árbitro tri-proceso (Γ), metacognición
  • MVP 5 — Demos de Operadores: Driveplexity + Γ corriendo dentro de Binsai
  • MVP 6 — Modelo de Mundo + VSM: grafo ontológico, agentes VSM recursivos, capa neuro-simbólica
  • v0.1.0: release PyPI, DOI Zenodo, documentación completa

Licencia

GPL-3.0 — ver LICENSE. Copyright (C) 2026 Patricio Gerpe.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binsai-0.0.1.dev0.tar.gz (580.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binsai-0.0.1.dev0-py3-none-any.whl (590.8 kB view details)

Uploaded Python 3

File details

Details for the file binsai-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: binsai-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 580.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.7 Windows/11

File hashes

Hashes for binsai-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 7105faadc8813cc4bad4513b60eefdb20219e4ae26a243bdae3fa0d4e790b2a7
MD5 a9fb236ed352bd621f5e7dd8bef45e8d
BLAKE2b-256 8e362071126ab1e370cfca8b9db0773f9d2ecb55b3b9641c5565a82d2cb9235e

See more details on using hashes here.

File details

Details for the file binsai-0.0.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: binsai-0.0.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 590.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.7 Windows/11

File hashes

Hashes for binsai-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2f6830f3e34b58f9848ad3fb04993f390688f2933e35fafe9348c4fb2fa0d88
MD5 b0fdb4d230d0d24b0f733e1cd457d589
BLAKE2b-256 08f85416df9c5b919facf5669df3c1d242cf74607fd3448c1fa942abed013b40

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

This release

0.0.1.dev0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page