Skip to main content

Crate selfware

Crate selfware 

Source
Expand description

§Selfware — Your Personal AI Workshop

An agentic coding harness for local LLMs. 70+ tools, multi-agent swarm, evolution engine, hooks, MCP, LSP, and a fox mascot — all local-first, no cloud required.

§Core Features

  • 70+ Tools: File, git, cargo, search, shell, PTY, browser automation, computer control, LSP, MCP, knowledge graph, vision, FIM editing
  • Multi-Agent Swarm: Up to 16 concurrent agents with consensus voting
  • Safety: Multi-layer validation, path protection, command filtering, JSONL audit logging, permission grants with expiry
  • Hooks: Event-driven automation (PreToolUse, PostToolUse, Stop)
  • MCP: Both client (connect to external tools) and server (expose selfware tools to other AI systems)
  • LSP: Semantic code intelligence via rust-analyzer, pyright, tsserver, gopls
  • Doctor: System dependency checker (30+ tools) and LLM backend diagnostics
  • Templates: Project scaffolding for Rust, Python, Node.js with QA profiles
  • Cognition: PDVR cycle (Plan-Do-Verify-Reflect), working memory
  • Persistence: Checkpoint system for long-running tasks with session resume
  • Self-Healing: Error classification, recovery strategies, exponential backoff
  • Evolution Engine: Recursive self-improvement with SAB-based fitness
  • Local-First: Runs entirely on your hardware, zero data egress

§Quick Start

use selfware::{Agent, Config};

let config = Config::load(None)?;
let mut agent = Agent::new(config).await?;
agent.run_task("Add unit tests for the auth module").await?;

§CLI

selfware chat                    # Interactive mode
selfware run "add unit tests"    # One-shot task
selfware doctor                  # Check system dependencies
selfware init                    # Project scaffold wizard
selfware multi-chat -n 4         # Multi-agent swarm
selfware mcp-server              # Run as MCP server

See selfware.design for full documentation.

Re-exports§

pub use testing::verification;
pub use testing::visual_verification;

Modules§

agent
Core agent module: LLM-driven task execution with tool orchestration.
analysis
Code analysis module
api
LLM API client layer.
checkpoint
Task Checkpointing & Persistence
cli
Selfware Workshop - Your Personal AI Companion
cognitive
Cognitive and AI capabilities module
computer
Computer control module for desktop automation.
concurrency
Concurrency governor for limiting concurrent streaming and tool execution.
config
Configuration Management
consolidation
Memory Consolidation (“Sleep”) System
doctor
Selfware Doctor — system diagnostics and dependency checker.
errors
evolution
Selfware Evolution Engine
evolve
Self-evolution context selector.
hooks
Hook system for extensible event-driven automation.
input
Modern Input System for Selfware
interview
Interview / Clarification Mode
llm_doctor
LLM Doctor — diagnostic module for local LLM backend configuration.
lsp
Language Server Protocol (LSP) client for semantic code intelligence.
mcp
Model Context Protocol (MCP) client implementation.
memory
Agent Memory Management
multiagent
Multi-Agent Chat System
output
Output Control Module
process_manager
Process Manager - Background Process Lifecycle Management
profiles
Configuration Profiles
resource
Resource management for CPU, GPU, memory, and disk
safety
Security and safety module
self_healing
Self-Healing System
skills
User-extensible skill system for Selfware.
supervision
Process supervision and recovery mechanisms
swarm
Multi-Agent Swarm System
swl
Selfware Workflow Language (SWL) — EXPERIMENTAL.
telemetry
Telemetry & Observability
templates
Template engine for scaffolding new projects from embedded templates.
testing
Testing module
token_count
Shared token counting utilities.
tool_parser
Robust tool call parser with XML and JSON fallback
tools
Tool subsystem: trait definition, registry, and built-in tool implementations.
ui
Selfware UI System
util
Small shared helpers with no narrower home.
visual_loop
Autonomous Visual Feedback Loop
workflows
Agent Workflows

Macros§

tool_span
Create a span for tracking tool execution with automatic duration and outcome logging

Functions§

is_shutdown_requested
Check whether a graceful shutdown has been requested.
request_shutdown
Signal that a graceful shutdown has been requested.
shutdown_requested
Await until a graceful shutdown has been requested.
shutdown_tracing
Flush and shut down the tracing background writer. Call this during graceful shutdown to ensure all logs are flushed.