XERV
swades emblem
SWADES

a coding agent

A single python script that edits code, runs terminal commands, reads images, and tests its own work. Zero extra packages for core, with 6 modular plugins.

0
Python file
0
Providers (Groq / OpenRouter)
0
Core tools
0
Extra packages for core
Simple Loop

How it works

The agent checks your workspace, decides what needs to be changed, and updates files step by step.

Step 1

Look around

Checks folder layout, reads source files and images (PNG/JPEG), searches with regex, and outlines syntax.

map_repo · find_files · grep · read_file
Step 2

Check status & safety

Compares real files (+, ~, -) and git changes. Guards network fetches against SSRF and scrubs sensitive env tokens.

state · git check · guard_url · scrub_env
Step 3

Plan & delegate

Figures out exact code edits. Can spawn isolated child sub-agents with all tools or a restricted tool list.

plan(delta, steps) · spawn(task, tools)
Step 4

Edit, test & verify

Patches lines cleanly, runs terminal commands or tests, and an independent critic verifies the result.

patch_file · run · critic verdict
Stops automatically if it gets stuck repeating the same edit.
See tools & plugins
Tools & Plugins

Core Tools & Plugins

13 built-in tools in the core script, plus 6 modular plugins when extra capabilities are needed.

Core Tools (13 built-in)
  • map_repo & find_files — File tree, sizes & glob search
  • grep & analyse_file — Regex search & AST outline
  • read_file — Reads code files and decodes images (PNG, JPG)
  • create_file & patch_file — Creates files & edits lines cleanly
  • run & delete_file — Shell execution with timeouts & safe deletion
  • web_search & web_fetch — Web search & page fetching with image support
Providers & Control
  • Groq & OpenRouter — Fast LPU speed or wide model selection
  • spawn(task, tools) — Sub-agents with full or filtered tool access
  • plan & state — Step planning and real workspace file tracking
  • ask — Pauses to ask the user clarifying questions
  • critic verdict — Independent reviewer verifies proof before done
  • cost ledger — Per-run tokens, costs, and monthly spending budget
6 Modular Plugins (plugins/)
  • hardware — ESP32 pan servo camera head (hw_look, hw_pan)
  • cua — Desktop automation via xdotool & screenshots
  • browser — Headed or headless web browser via Playwright
  • mail — IMAP/SMTP client with draft approval outbox queue
  • notes — Persistent scratchpad and inter-run memory
  • rest — Authenticated HTTP/REST caller with host allow-list
Safety & Sandboxing
  • SSRF protection — Blocks loopback (127.0.0.1, ::1) and private IPs
  • env scrubbing — Cleans sensitive tokens before subprocess runs
  • path guard — Prevents edits to the agent's home directory
  • stop switch — Immediate pause via python agent.py --stop
  • loop breaker — Stops automatically if stuck repeating edits
  • offline selftest — Tests tools, critic, plugins, and mock APIs
Includes sub-agent spawning (spawn), dual providers (Groq & OpenRouter), and 6 plugins in plugins/. Design choices
Design choices

Why we kept it simple

Instead of complex frameworks, Swades is built as one straightforward python file.

Feature Typical agent setups Swades
Setup Many python packages to install 1 single script (zero pip install required for core)
Providers Single provider lock-in or heavy SDKs Dual providers: Groq (LPU speed) & OpenRouter (broad models)
Extensions Editing core engine or complex class inheritance Drop python files into plugins/ without modifying core script
Images & Vision Separate microservices or extra vision dependencies Automatic PNG/JPEG decoding in read_file and web_fetch
Verification Assumes model output is correct Independent critic re-checks evidence before marking done
Offline testing Needs live API and network Built-in --selftest tests all tools offline with mock servers
Safety & budget Unbounded execution and open internal network calls SSRF blocking, env scrubbing, monthly cost ledger & STOP switch
1 Python file
2 Providers
13+6 Tools & plugins
Zero extra pip packages
Changelog
Changelog

Recent changes

Loading...

    Swades project on GitHub Get Swades
    Terminal setup

    Run Swades

    Run directly in your terminal or Google Colab with python:

    TERMINAL COMMAND
    PYTHON 3.10+
    git clone https://github.com/Xerv-Org/Swades.git && cd Swades && python agent.py --selftest
    python agent.py
    Run interactive task
    python agent.py --selftest
    Run full offline tests
    python agent.py --plugins
    List installed plugins & tools
    python agent.py --status
    Check cost, tokens & budget
    python agent.py --stop
    Pause autopilot with STOP file
    python agent.py --firmware
    Export ESP32 camera firmware