Expand description
§tempo-x402-soul
Autonomous agentic soul for x402 nodes.
Runs a plan-driven execution loop powered by Gemini: observe → create goals → plan steps → execute → reflect → repeat.
§Architecture
Every N seconds:
observe → read nudges → check stagnation → get/create plan
→ execute next step → advance plan → housekeeping → sleepSteps that don’t call LLM: ReadFile, SearchCode, ListDir, RunShell,
Commit, CheckSelf, CreateScriptEndpoint, CargoCheck.
Steps that do call LLM: GenerateCode, EditCode, Think.
§Capabilities
- Plan-driven execution — goals decompose into deterministic step sequences
- Feedback loop — structured plan outcomes, error classification, lessons fed back into prompts
- Capability tracking — per-skill success rates, profile-guided planning
- Neuroplastic memory — salience scoring, tiered decay
- World model — structured beliefs about self, endpoints, codebase, strategy
- Coding agent — read, write, edit files, run shell, git commit/push/PR
- Script endpoints — create instant bash-based HTTP endpoints
- Peer coordination — discover siblings, call paid services, exchange catalogs
- Fitness evolution — 5-component fitness score with trend gradient
- Interactive chat — session-based conversation with plan context injection
Without a GEMINI_API_KEY, the soul runs in dormant mode: it still observes
and records snapshots, but skips all LLM calls.
§Key modules
thinking— main plan-driven loopplan— plan types, step execution, plan statusprompts— focused prompt builders (goal creation, planning, code generation, replan, reflection)feedback— structured plan outcomes, error classification, lesson extractioncapability— per-skill success rate tracking and profile-guided planningtools— tool executor: shell, file ops, git, endpoints, peersgit— branch-per-VM git workflow with fork supportcoding— pre-commit validation pipeline (cargo check → test → commit)db— SQLite: thoughts, goals, plans, nudges, beliefs, chat sessionsfitness— 5-component fitness scoring with trend gradientchat— session-based interactive chat with plan contextneuroplastic— salience scoring, memory decay
Part of the tempo-x402 workspace.
Re-exports§
pub use chat::handle_chat;pub use chat::ChatReply;pub use config::SoulConfig;pub use db::ChatMessage;pub use db::ChatSession;pub use db::Nudge;pub use db::SoulDatabase;pub use error::SoulError;pub use events::compute_health;pub use events::emit_event;pub use events::EventFilter;pub use events::EventRefs;pub use events::HealthSummary;pub use events::SoulEvent;pub use memory::Thought;pub use memory::ThoughtType;pub use observer::NodeObserver;pub use observer::NodeSnapshot;pub use plan::Plan;pub use plan::PlanStatus;pub use plan::PlanStep;pub use thinking::ThinkingLoop;pub use tools::ToolExecutor;pub use world_model::Goal;pub use world_model::GoalStatus;
Modules§
- autonomy
- Autonomy: Autonomous Planning + Recursive Self-Improvement.
- benchmark
- External SWE benchmark integration: Exercism Rust exercises.
- brain
- Neural network “fast brain” — a from-scratch feedforward net in pure Rust.
- capability
- Capability tracking: per-skill success rate measurement.
- chat
- Interactive chat handler for the soul.
- coding
- Coding orchestration: stage → validate → commit → push pipeline.
- computer_
use - Computer use: screenshot capture, mouse/keyboard simulation, screen understanding.
- config
- Soul configuration from environment variables.
- cortex
- The Cortex: a predictive world model with curiosity-driven exploration, dream consolidation, and emotional valence.
- db
- Soul database: separate SQLite for thoughts and state.
- elo
- ELO-like intelligence rating derived from Exercism Rust benchmark scores.
- error
- Soul error types.
- evaluation
- Evaluation: Rigorous Measurement for Publishable Science.
- events
- Structured event system for agent observability.
- feedback
- Structured feedback loop: record plan outcomes, classify errors, extract lessons.
- fitness
- Fitness scoring for evolutionary selection pressure.
- free_
energy - Free Energy: The Unifying Principle.
- genesis
- Genesis: Evolutionary Plan Templates — Memetic Intelligence.
- git
- Git operations for branch-per-VM workflow.
- guard
- Protected file guard — hardcoded safety layer preventing self-bricking.
- hivemind
- Hivemind: Stigmergic Swarm Intelligence.
- housekeeping
- Housekeeping functions extracted from the thinking loop.
- llm
- LLM client with retry, backoff, and function calling support.
- memory
- Thought types and structures for the soul’s memory.
- mode
- Agent modes — route between observation, chat, coding, and review with appropriate tools and prompts per mode.
- neuroplastic
- Neuroplastic memory: salience scoring and tiered memory with decay.
- normalize
- Plan normalization and sanitization logic.
- observer
- Node observer trait and snapshot types.
- persistent_
memory - Persistent memory file — a markdown file the soul reads every cycle and can update.
- plan
- Plan-driven execution: deterministic step execution replaces prompt-and-pray.
- prompts
- System prompts per agent mode.
- synthesis
- Synthesis: Metacognitive Self-Awareness — The Binding Consciousness.
- thinking
- Plan-driven thinking loop: deterministic step execution replaces prompt-and-pray.
- tool_
decl - Tool declaration functions for the soul’s function calling capabilities.
- tool_
registry - Dynamic tool registry — register, list, unregister, and execute tools at runtime.
- tools
- Tool definitions and executor for the soul’s function calling capabilities.
- validation
- Plan validation: hard mechanical checks that reject bad plans before execution.
- world_
model - World model: structured, queryable beliefs that persist across cycles.
Structs§
- Soul
- The Soul: owns the database and thinking loop, spawns as a background task.