A computational experiment that connects a dynamic neuroendocrine simulation to a large language model.
The idea is simple:
The project models hormones and neurotransmitters as interacting dynamic systems, converts their combined state into higher-level behavioral variables, and uses those variables to influence a Gemini-powered language model.
USER INPUT
│
▼
┌────────┐
│ Parser │
└────┬───┘
│
▼
Physiological stimuli
│
▼
┌────────────────────┐
│ Endocrine System │
│ │
│ Hormone models │
│ Feedback loops │
│ Interactions │
│ Homeostasis │
└─────────┬──────────┘
│
▼
Neuroendocrine state
│
▼
┌───────────────────┐
│ Behavioral state │
│ │
│ Arousal │
│ Threat sensitivity│
│ Reward sensitivity│
│ Attention │
│ Social affiliation│
│ Impulse control │
│ Flexibility │
│ Persistence │
└─────────┬─────────┘
│
▼
Gemini controller
│
▼
RESPONSE
The important part is that the LLM does not directly receive a label such as mood = happy.
Instead, the simulated physiological state produces several interacting control signals that influence generation.
Contains the simulated biological system.
Contains the individual mathematical models.
Converts the simulated neuroendocrine state into computational behavioral dimensions.
The interface between the simulated system and Google Gemini.
It is responsible for:
- Building the system prompt from the current behavioral state.
- Translating behavioral state into generation parameters.
- Sending the request to Gemini.
- Returning Gemini's response.
Tests the individual models and the system as a whole.
Every implemented hormone/neurotransmitter model has its own test module.
The project uses Google's Gemini API.
Create a .env file containing:
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.5-flashRun
python main.pyThis project is licensed under the MIT License.