A fully local, cross-platform AI assistant that automates computer tasks, codes, browses, and interacts with the OS using the Anarchy-Inference language.
Anarchy Agent is an autonomous agent system that uses the minimalist, token-efficient Anarchy-Inference language as its "action language" for executing tasks. The agent operates entirely offline, using a quantized open-source LLM to generate and execute Anarchy-Inference code.
- Fully Local Operation: Runs completely offline using quantized open-source LLMs
- Symbolic Action Language: Uses Anarchy-Inference's single-character function syntax for all operations
- Modular Architecture: Composed of planner, executor, memory, browser automation, and system tools
- Secure Execution: Sandboxed execution of generated Anarchy-Inference code
- Cross-Platform: Built with Rust backend and Tauri/web frontend
- Interactive Input: File-based input/output mechanism with emoji operators (📥, 📤, 📩)
- Enhanced Memory: Vector-based semantic search with tags, importance scoring, and access tracking
- Pattern Matching: Regex-based pattern matching with template-based code generation
Unlike other autonomous agent frameworks like Auto-GPT or Manus, Anarchy Agent:
- Operates Entirely Offline: No cloud APIs or internet connection required for core functionality
- Uses a Symbolic Language: Anarchy-Inference's token-minimal syntax makes it ideal for LLM-generated code
- Minimalist Design: Focused on efficiency and simplicity rather than feature bloat
- Unified Action Language: All agent actions are expressed in a single, consistent symbolic language
The system consists of several core modules:
- Planner: Generates high-level plans using the LLM with pattern matching
- Executor: Safely runs Anarchy-Inference code in a sandboxed environment
- Memory: Stores and retrieves information with semantic search capabilities
- Browser: Automates web browsing and interaction
- System: Interfaces with the operating system for file and process operations
The input function workaround provides a file-based solution for interactive capabilities:
- 📥 (get_input_from_file): Reads content from an input file
- 📤 (write_output_to_file): Writes content to an output file
- 📩 (wait_for_input_file): Waits for an input file to appear
Example:
// Write a prompt to an output file
📤("prompt.txt", "What is your name?");
// Wait for user to create input file (with 30 second timeout)
ιinput_ready = 📩("response.txt", "30000");
// Read the input file
ιuser_input = 📥("response.txt");
The memory system now includes:
- Vector-based semantic search for finding relevant information
- Tag-based searching for categorized memory entries
- Importance scoring to prioritize critical information
- Access tracking to maintain frequently used information longer
- Structured data support for complex information storage
The reasoning system now features:
- Pattern matching using regex with named capture groups
- Template-based code generation with variable substitution
- Reasoning history for tracking and explaining decisions
- Default patterns for common operations (file, HTTP, input, memory)
We provide pre-built binaries for major platforms with the Anarchy-Inference interpreter bundled in:
# Download the latest release for your platform
# Windows
curl -LO https://github.com/APiTJLillo/anarchy-agent/releases/latest/download/anarchy-agent-windows.zip
unzip anarchy-agent-windows.zip
# macOS
curl -LO https://github.com/APiTJLillo/anarchy-agent/releases/latest/download/anarchy-agent-macos.tar.gz
tar -xzf anarchy-agent-macos.tar.gz
# Linux
curl -LO https://github.com/APiTJLillo/anarchy-agent/releases/latest/download/anarchy-agent-linux.tar.gz
tar -xzf anarchy-agent-linux.tar.gzIf you prefer to build from source:
# Prerequisites:
# - Rust toolchain
# - Node.js and npm (for UI development)
# Clone the repository
git clone https://github.com/APiTJLillo/anarchy-agent.git
cd anarchy-agent
# Build the project
cargo build --releaseThe agent requires a local LLM model to function:
# Create the models directory
mkdir -p models
# Download a compatible model (example using Mistral 7B)
curl -L https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_0.gguf -o models/mistral-7b-instruct-v0.2.Q4_0.gguf# Using pre-built binary
./anarchy-agent
# Or if built from source
./target/release/anarchy-agentHere's a simple example of using Anarchy Agent to list files and download a webpage:
Task: List all files in the current directory, download the Wikipedia homepage, and extract the first paragraph.
Agent will:
1. Use ! (shell) to list files
2. Use ↗ (HTTP GET) to download the webpage
3. Use regex or parsing functions to extract text
The repository includes several example Anarchy-Inference scripts (.a.i files) in the examples_ai directory:
example_task.a.i: Basic file operations and web requestsbrowser_automation.a.i: Web browser automationfile_system_operations.a.i: File system operationsmemory_operations.a.i: Memory and state persistencecomplete_workflow.a.i: End-to-end workflow exampleinput_workaround_example.a.i: Demonstrates the input function workaroundcorrected_syntax_example.a.i: Shows proper Anarchy Inference syntax conventions
To run these examples:
# Using pre-built binary
./anarchy-agent --example example_task
# Or specify a custom script
./anarchy-agent --script path/to/your_script.a.iThe repository includes test files for all features in the tests directory:
input_workaround_test.a.i: Tests the input function workaroundmemory_system_test.a.i: Tests the enhanced memory systemreasoning_system_test.a.i: Tests the improved reasoning systemintegration_test.a.i: Tests how all components work together
Run the tests using:
./run_tests.shFor detailed information about the implemented features, see:
IMPLEMENTATION_REPORT.md: Technical details about all implementationsUSAGE_GUIDE.md: Practical guide for using the new featuresdocs/input_workaround.md: Documentation for the input function workaround
Contributions are welcome! Here's how you can help:
- Extend Core Functionality: Add new capabilities to the agent modules
- Improve LLM Integration: Enhance the interaction with local LLMs
- Create Examples: Develop example tasks and workflows
- Documentation: Improve guides and references
Please see our Contributing Guide for more details.
MIT