Expand description
Phago Runtime Prelude — convenient imports for common usage.
use phago_runtime::prelude::*;Re-exports§
pub use crate::colony::Colony;pub use crate::colony::ColonyConfig;pub use crate::colony::ColonyEvent;pub use crate::colony::ColonyStats;pub use crate::colony::ColonySnapshot;pub use crate::colony_builder::ColonyBuilder;pub use crate::colony_builder::PersistentColony;pub use crate::colony_builder::BuilderError;pub use crate::session::GraphState;pub use crate::session::SerializedNode;pub use crate::session::SerializedEdge;pub use crate::session::SessionMetadata;pub use crate::session::save_session;pub use crate::session::load_session;pub use crate::session::restore_into_colony;pub use crate::session::verify_fidelity;pub use crate::metrics::ColonyMetrics;pub use crate::metrics::TransferMetrics;pub use crate::metrics::DissolutionMetrics;pub use crate::metrics::GraphRichnessMetrics;pub use crate::backend::BackendConfig;pub use crate::backend::BackendError;pub use crate::backend::DynTopologyGraph;pub use crate::backend::create_backend;
Structs§
- Agent
Fitness - Per-agent fitness data.
- Agent
Genome - Evolvable parameters for an agent.
- AgentId
- Unique identifier for an agent in the colony.
- Boundary
Context - Context for boundary modulation (Dissolve primitive).
- Code
Element - A code element extracted from source files.
- Death
Signal - Signal emitted when an agent dies (apoptotic body).
- Digester
- A text-digesting agent — the computational macrophage.
- Document
- A document placed in the substrate for agents to digest.
- Document
Id - Unique identifier for a document in the substrate.
- Edge
Data - Data stored on a knowledge graph edge.
- Fitness
Spawn Policy - Fitness-based spawn: create mutated offspring of the fittest agent.
- Fitness
Tracker - Tracks fitness across all agents in a colony.
- Fragment
Presentation - A fragment to present to the knowledge graph.
- Gradient
- A directional gradient sensed by an agent.
- Louvain
Result - Result of Louvain community detection.
- Node
Data - Data stored in a knowledge graph node.
- NodeId
- Unique identifier for a node in the knowledge graph.
- Position
- A position in the substrate’s spatial field.
- Semantic
Wiring Config - Configuration for semantic wiring.
- Sentinel
- The Sentinel agent — the immune system’s anomaly detector.
- Signal
- A signal emitted into or read from the substrate.
- Symbiont
Info - Information about an integrated symbiont.
- Synthesizer
- The Synthesizer agent — emergent collective intelligence.
- Trace
- A trace deposited by an agent on the substrate (stigmergy).
Enums§
- Agent
Action - An action returned by an agent’s tick.
- Agent
Type - Enumeration of all agent types for deserialization dispatch.
- Cell
Health - Health assessment of an agent (used by Apoptose).
- Classification
- Classification result from negative selection.
- Code
Element Kind - Types of code elements we extract.
- Death
Cause - Why an agent died.
- Digestion
Result - Result of a digestion attempt.
- Node
Type - Types of nodes in the knowledge graph.
- Orientation
- Orientation decision from sensing.
- Phago
Error - Errors that can occur during Phago operations.
- Serialized
Agent - Union of all serializable agent states.
- Signal
Type - The type of a signal in the substrate.
- Symbiosis
Eval - Result of evaluating another agent for symbiosis.
- Symbiosis
Failure - Why symbiosis failed.
- Trace
Type - The type of trace deposited.
Traits§
- Agent
- The fundamental unit of computation in Phago — a biological cell.
- Serializable
Agent - Trait for agents that can be serialized.
- Spawn
Policy - Trait for spawn policies.
- Substrate
- The shared environment that all agents sense and modify.
- Topology
Graph - A handle to the topology graph, used by the Wire primitive.
Functions§
- compute_
modularity - Compute modularity of a given partition.
- compute_
semantic_ weight - Compute the edge weight based on base weight and semantic similarity.
- cosine_
similarity - Compute cosine similarity between two vectors.
- dot_
product - Compute dot product between two vectors.
- elements_
to_ document - Generate a document string from code elements for colony ingestion.
- extract_
code_ elements - Extract code elements from Rust source code.
- l2_
distance - Compute L2 distance between two vectors.
- l2_
normalize - L2 normalize a vector in place.
- l2_
normalized - L2 normalize a vector, returning a new vector.
- louvain_
communities - Run Louvain community detection on a graph.
- normalized_
similarity - Compute similarity between two embeddings, normalized to [0, 1].