phago-runtime
Colony management, scheduling, and runtime for Phago biological computing.
Overview
This crate provides the execution environment for Phago agents:
- Colony: Main entry point managing agents, documents, and knowledge graph
- Substrate: Shared environment with signals, traces, and documents
- Topology: Graph implementation with Hebbian wiring and synaptic pruning
- Session: Save/restore colony state across sessions
- Metrics: Quantitative measurement of colony behavior
- ColonyBuilder: Builder pattern for colonies with optional SQLite persistence
- AsyncColony: Async runtime for concurrent and timed simulation
Feature Flags
| Feature | Description |
|---|---|
sqlite |
SQLite-backed persistence via ColonyBuilder |
async |
Async runtime with AsyncColony, TickTimer, run_in_local |
Enable features:
= { = "0.1", = ["sqlite", "async"] }
Usage
use *;
use Digester;
use Position;
// Create a colony
let mut colony = new;
// Ingest documents
colony.ingest_document;
// Spawn agents
colony.spawn;
// Run simulation
colony.run;
// Check stats
let stats = colony.stats;
println!;
With SQLite Persistence
use *;
use Digester;
// Create colony with SQLite persistence
let mut colony = new
.with_persistence
.auto_save // Save on drop
.build?;
// Use as normal
colony.ingest_document;
colony.spawn;
colony.run;
colony.save?; // Explicit save
// Later: reload from database
let colony2 = new
.with_persistence
.build?;
With Async Runtime
use *;
use ;
async
Colony Lifecycle (per tick)
- Sense — Agents observe substrate (signals, documents, traces)
- Act — Colony processes agent actions (move, digest, present, wire)
- Transfer — Agents export/integrate vocabulary, attempt symbiosis
- Dissolve — Mature agents modulate boundaries, reinforce graph nodes
- Death — Remove agents that self-assessed for termination
- Decay — Signals, traces, and edge weights decay; weak edges pruned
Part of Phago
This is a subcrate of phago. For most use cases, depend on the main phago crate instead.
License
MIT