Goal-directed coordination for concurrent and distributed systems, inspired by biological intelligence.
Drawing from Dr. Michael Levin's research on how biological systems reliably achieve goals through multiple pathways, bio-adapt brings these principles to software systems—from single-process concurrency to distributed architectures.
What: Goal-directedness, adaptive pathfinding, collective intelligence
How: Decentralized algorithms that pursue goals through multiple strategies
Why: Instead of programming HOW (procedures), you program WHAT (goals). Go goroutines figure out the HOW through:
- Emerge: Finding when to coordinate (temporal synchronization)
- Navigate: Finding what resources to use (resource allocation)
- Glue: Finding how things work (collective understanding)
go get github.com/carlisia/bio-adapt
import (
"github.com/carlisia/bio-adapt/client/emerge"
"github.com/carlisia/bio-adapt/emerge/scale"
)
// One-liner for API batching optimization
client := emerge.MinimizeAPICalls(scale.Medium)
err := client.Start(ctx)
// Check synchronization
if client.IsConverged() {
// System is synchronized - safe to batch operations
}
📖 See more examples | 🎮 Try the interactive demo
🎯 Goal-directed - Systems maintain target states as invariants, finding alternative paths when defaults fail
🔄 Multiple pathways - Inspired by how biological systems reach goals despite perturbations
⚡ Emergent coordination - Collective intelligence without central control
🧬 Bio-inspired principles - Computational primitives derived from Levin's research on adaptive biological systems
Bio-adapt provides three complementary primitives for system coordination:
🧲 Emerge - Goal-directed synchronization
Status: ✅ Production-ready
Systems (concurrent or distributed) that converge on target coordination states through multiple pathways, inspired by how biological systems reliably achieve morphological goals.
- Temporal coordination (when agents act)
- Self-organizing synchronization
- Adaptive strategy switching
- Optimized for 20-2000+ agents
⚡ Navigate - Goal-directed resource allocation
Status: 🚧 Coming soon
Systems that navigate resource configuration spaces to reach target allocations via multiple paths, adapting when direct routes are blocked.
- Dynamic resource allocation (what resources to use)
- Alternative path discovery
- Constraint-aware navigation
🔗 Glue - Goal-directed collective intelligence
Status: 📋 Planned
Collective goal-seeking enables independent agents to converge on shared understanding through local interactions, achieving insights no individual could reach alone.
- Schema discovery (how APIs work)
- Distributed hypothesis testing
- Emergent consensus
See primitives overview for detailed comparison.
- API batching - Reduce API costs by 80% through synchronized batching
- Load distribution - Balance work across servers without central control
- Distributed cron - Prevent thundering herd in scheduled tasks
- Connection pooling - Optimize database connections adaptively
- Rate limiting - Coordinate request rates across services
- Dynamic resource allocation - Navigate to optimal resource distributions
- Failure recovery - Find alternative resource paths when failures occur
- Schema discovery - Collectively understand API contracts
- Distributed consensus - Achieve agreement without voting
Perfect for systems with 20-2000+ concurrent agents requiring coordination.
📚 Full documentation index - Complete documentation guide
- Primitives overview - Choose the right primitive
- Client libraries - Simple APIs for common use cases
- Interactive simulation - Try it yourself
- Architecture - System design and principles
- Development guide - Build, test, contribute
- Deployment guide - Production guidelines
- Testing guide - End-to-end testing
- API reference - Complete API docs
# Clone and run the interactive demo
git clone https://github.com/carlisia/bio-adapt
cd bio-adapt
go run ./simulations/emerge
# Try different scales
go run ./simulations/emerge -scale=large # 1000 agents
# See all options
go run ./simulations/emerge -list
🎮 Learn more about the simulation - 8 optimization goals to explore interactively!
We welcome contributions! See our development guide for:
- Setting up your environment
- Running tests and benchmarks
- Submitting pull requests
- Code style guidelines
The emerge primitive is production-optimized:
Scale | Agents | Convergence Time | Memory/Agent |
---|---|---|---|
Tiny | 20 | ~800ms | ~5KB |
Small | 50 | ~1s | ~4KB |
Medium | 200 | ~2s | ~3KB |
Large | 1000 | ~5s | ~3KB |
Huge | 2000 | ~10s | ~2KB |
Key optimizations:
- Automatic storage strategy selection based on swarm size
- Grouped atomic fields for 62% faster access
- Fixed-size arrays for 45% faster neighbor iteration
See optimization guide for benchmarks and details.
Inspired by Dr. Michael Levin's research on goal-directedness in biological systems, where cells and tissues achieve target morphologies through multiple pathways despite perturbations.
Key concepts adapted:
- Goal-directedness - Systems that maintain target states as invariants
- Multiple pathways - Alternative routes to achieve the same outcome
- Collective intelligence - Problem-solving that emerges from local interactions
- Adaptive navigation - Finding new solutions when defaults are blocked
Implementation foundations:
- Kuramoto model for synchronization dynamics (emerge)
- Pathfinding algorithms for resource navigation (navigate)
- Distributed consensus protocols for collective intelligence (glue)
MIT - See LICENSE