Skip to main content

Zero-dependency symbolic AI agent. Pure Python stdlib. Runs anywhere.

Project description

Qwerty v2 — Zero-Dependency Symbolic AI Agent

Pure Python stdlib. No numpy. No torch. No sklearn. 10MB total. Runs on a Raspberry Pi.

Qwerty is an autonomous software agent that reads files, edits code, runs commands, searches the web, learns from every interaction, and composes multi-source answers — all with zero external dependencies. It's a symbolic AI: deterministic, constitution-bound, auditable, and completely offline-capable.

Why Qwerty?

Qwerty Other AI Agents
pip install → runs Requires Python ML stack (numpy, torch, transformers, 800MB+)
Offline by default Cloud API or local LLM (8GB+ RAM)
10MB on disk 2-20GB for local models
Constitution hardcoded at engine level Safety is a prompt (jailbreakable)
Deterministic — same input, same output Non-deterministic (sampling)
Runs on ARM (Raspberry Pi Zero) Needs x86 GPU or cloud

Features

  • 14 tools: read, write, edit, search, find, run, web search, wikipedia, learn, analyze errors, and more
  • Fuzzy NLP: handles "runn ls -la", "plz tel me bout the kernul", "idk wat uefi is" — 50+ shorthand maps, Levenshtein, n-gram Jaccard, contraction expansion, character dedup
  • Knowledge base: 8 curated domains + 127 Wikipedia articles covering programming, OS dev, networking, math, physics, chemistry, biology, technology, and general knowledge
  • Genius composition engine: retrieves, scores, and assembles multi-sentence responses from 2500+ sentences across all knowledge files
  • On-demand learning: lookup <topic> → Wikipedia API (free, caches for next time); web fallback → DuckDuckGo
  • Constitution safety: 9 hardcoded rules block rm -rf /, credential leaks, file overwrites without confirmation, and other dangerous operations
  • Persistent memory: every answer, every lookup, every fix is stored in memory/learned.json — learning compounds across sessions
  • Recursive solve loop: react → think → explore → internet → report — 3 layers of fallback before giving up
  • Protocol: JSON-RPC, MCP server, and CLI modes — plugs into any editor or toolchain
  • 76 passing tests, zero external dependencies

Install

pip install qwerty-agent

Then run:

qwerty "what is a kernel"

Or clone from source:

git clone https://github.com/KasishStar/qwerty-agent
cd qwerty-agent
python agent.py "what is a kernel"

Interactive Mode

python agent.py
qwerty> what is UEFI boot
qwerty> lookup quantum computing
qwerty> list files
qwerty> read file agent.py
qwerty> learn that the answer is 42
qwerty> exit

Interface (with history and slash commands)

python interface.py

JSON-RPC Protocol

python protocol.py --process "what is a kernel"
python protocol.py --json "what is a kernel"
python protocol.py --schema
python protocol.py --mcp

Architecture

User Input → Normalize → Classify Intent → Constitution Check → Execute → Result
                              ↓
                    Genius Composition Engine
                    (2500+ sentences, 8+ domains)
                              ↓
                    Recursive Fallback Loop
                    react → routine → explore → internet → report
                              ↓
                    Persistent Memory (learned.json)

All layers are checked against the constitution before execution. No layer can run rm -rf /, overwrite user files without confirmation, or leak credentials.

How It Works

Qwerty is not an LLM. It's a symbolic AI — every decision is deterministic if/then logic. Its "intelligence" comes from:

  1. Broad knowledge (Wikipedia articles + curated domains)
  2. Fuzzy pattern matching (Levenshtein, n-gram Jaccard, keyword overlap)
  3. Multi-source composition (Genius scores and assembles sentences)
  4. On-demand learning (fetches and stores new knowledge at runtime)
  5. Compounding memory (every success is saved for next session)

What Qwerty Can Do

Task Example
Answer knowledge questions "what is a microkernel"
Read/write files "read file agent.py"
Edit code "edit line 10 of test.py to say hello"
Run commands "run cargo build"
Search code "search for TODO in src/"
Learn new facts "learn that X that Y"
Wikipedia lookup "lookup TCP protocol"
Web search "search web for rust uefi tutorial"
Analyze errors Automatic on command failure
Remember across sessions All in memory/learned.json

Requirements

  • Python 3.10+
  • No pip packages needed
  • Linux, macOS, or Windows
  • ARM (Raspberry Pi) supported
  • Internet optional (for web search and Wikipedia)

Project Structure

qwerty-agent/
├── agent.py              # Main engine: constitution, tools, NLP, solve loop
├── genius.py             # Response composition engine
├── interface.py          # Interactive REPL with history
├── protocol.py           # JSON-RPC / MCP / CLI modes
├── constitution.json     # 9 safety rules
├── knowledge/            # 9 JSON knowledge files (8 curated + Wikipedia)
├── memory/               # Persistent learning (auto-generated)
├── workflows/            # Pre-defined multi-step workflows
├── knowledge_importer.py # Wikipedia article downloader
├── test_all.py           # 76 comprehensive tests
└── pyproject.toml        # Build configuration

Tests

python test_all.py

License

MIT — see LICENSE.


Created by KasishStar. Pure symbolic AI. No ML dependencies. Runs anywhere.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qwerty_agent-2.0.1.tar.gz (135.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qwerty_agent-2.0.1-py3-none-any.whl (140.3 kB view details)

Uploaded Python 3

File details

Details for the file qwerty_agent-2.0.1.tar.gz.

File metadata

  • Download URL: qwerty_agent-2.0.1.tar.gz
  • Upload date:
  • Size: 135.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for qwerty_agent-2.0.1.tar.gz
Algorithm Hash digest
SHA256 013a43b1d56bf21279d72ec660b89f9e4ca7693dd853970c2bd913a7a1b5d956
MD5 e4890c2858d38007dd9fe87675a5a940
BLAKE2b-256 ee02575aae76f45924f017a5004aad00284362ec671ee5bdf8ae20b4f89b6760

See more details on using hashes here.

File details

Details for the file qwerty_agent-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: qwerty_agent-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 140.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for qwerty_agent-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17118414be85067088af95033b57471c6f19100afc10288c37349fcbda1f4b23
MD5 5127edb4767f914e175063924fc6b829
BLAKE2b-256 3c1d981fcd100da5975b9ddac7e246d593e816929d00ca848937a04f72053046

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page