My Journey into Digital Biology: Building an Agentic Worm with OpenWorm and LangGraph

Hello everyone! Today, I’m genuinely excited (and a little nervous!) to share a project that’s been fueled by my deep curiosity about digital biology and the incredible potential of AI: Agentic Worm. You can find the repository now on GitHub at https://github.com/chrisshayan/agentic-worm.
For a while now, I’ve been fascinated by the idea of bridging the gap between biological simulation and artificial intelligence. How does something as seemingly simple as a worm move, react, and even “decide”? The OpenWorm project, with its ambitious goal of a complete cellular-level simulation of C. elegans, quickly became a cornerstone of my exploration. I’ve spent considerable time delving into their work, trying to absorb as much as I could about their approach to modeling neurons, muscles, and physics.
My aim with Agentic Worm is to build upon this amazing foundation. Instead of just observing a simulated worm react to pre-programmed stimuli, I wanted to see if we could imbue it with a sense of “agency” — to make it actively pursue goals, learn, and adapt, much like a living organism. It’s a challenging endeavor, but one I believe offers profound insights into how intelligence might arise from underlying biological (or even artificial) systems.
The Tools of My Curiosity: OpenWorm, LangGraph, and AI/ML
To bring this “agentic” vision to life, I’ve brought together what I see as three powerful pillars:
- OpenWorm: This remarkable open-science project provides the detailed, biophysically plausible simulation of the C. elegans nervous system, musculature, and its watery environment. It’s the “body” and the “world” for our digital agent, offering a level of biological realism that’s truly inspiring. My journey began by trying to understand its intricate components and interfaces.
- LangGraph: As I explored frameworks for creating intelligent agents, LangGraph truly stood out. While often associated with Large Language Models, its core strength in defining stateful, long-running, and cyclic workflows felt like a natural fit for modeling the continuous perception-decision-action loop of a living creature. It allows me to logically orchestrate how the worm “thinks” and “acts” in a modular way.
- AI/ML Models (with TensorFlow/PyTorch/etc.): These are the components I’m integrating into the LangGraph framework to give the worm its “brainpower.” Whether it’s a small neural network to interpret sensory data or a reinforcement learning policy to guide movement, the goal is to leverage AI to enable adaptive and goal-directed behaviors.

My First Steps: The Agentic Worm MVP
This initial release of Agentic Worm is very much an MVP (Minimum Viable Product). It’s my attempt to validate the core architectural integration and demonstrate the simplest form of autonomous behavior. What you’ll find in this first version is:
- A Bridged Connection to OpenWorm: I’ve focused on establishing a robust link, allowing the LangGraph-orchestrated agent to send commands and receive sensory data from the OpenWorm simulation.
- Simple Environmental Awareness: The worm can perceive a basic stimulus in its environment (e.g., the presence of a “food” signal).
- LangGraph-Driven Reactivity: Through a simple LangGraph workflow, the worm makes a fundamental decision: if “food” is detected, it attempts to crawl forward towards it; otherwise, it maintains a basic exploratory wiggle or idles.
- Observable Action: The true test is seeing the worm move! The project includes basic logging and, where possible, leverages OpenWorm’s visualization to show these very first agentic responses.
It’s a small step, but for me, it represents a successful proof of concept — a digital worm that can autonomously react to its world based on a defined “mind” rather than just a script.
Where My Curiosity Leads Next
This project is a personal learning expedition, and I’m incredibly excited about where it could go. My curiosity is pushing me towards:
- More Complex Behaviors: Exploring how to enable sophisticated movements like chemotaxis (following chemical trails), navigation around obstacles, and perhaps even simulated mating behaviors.
- Adaptive Learning: Integrating more advanced machine learning techniques to allow the worm to genuinely learn from its experiences and refine its strategies over time.
- Neuro-Mimicry: Diving deeper into how AI can help us infer and validate biologically plausible neural parameters within the OpenWorm model that produce observed C. elegans behaviors.
- The Influence of Genetics: Eventually, I’m very keen to explore how we might simulate the impact of genetic variations on the worm’s digital nervous system and its resulting emergent behaviors.
Agentic Worm is an open-source project, born out of a profound curiosity for digital biology and AI. I’m putting it out there in the hopes that others who share this fascination might find it interesting, perhaps even inspiring. I would be thrilled if anyone would like to explore the code, offer suggestions, or even contribute.
Let’s learn and build together, pushing the boundaries of what’s possible in digital biology!
GitHub Repository: https://github.com/chrisshayan/agentic-worm