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:
- Broad knowledge (Wikipedia articles + curated domains)
- Fuzzy pattern matching (Levenshtein, n-gram Jaccard, keyword overlap)
- Multi-source composition (Genius scores and assembles sentences)
- On-demand learning (fetches and stores new knowledge at runtime)
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qwerty_agent-2.1.0.tar.gz.
File metadata
- Download URL: qwerty_agent-2.1.0.tar.gz
- Upload date:
- Size: 141.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f024a5da1e1e501835c2c9d55f1b2da5d73d02ccfa1e7a15257559a9e2af53
|
|
| MD5 |
cc0d9bfb85fefc838f2f818c4f20e859
|
|
| BLAKE2b-256 |
5a255a773ac3083aa6478d0e985435e886729b30e71643dafead1daa6ef556d8
|
File details
Details for the file qwerty_agent-2.1.0-py3-none-any.whl.
File metadata
- Download URL: qwerty_agent-2.1.0-py3-none-any.whl
- Upload date:
- Size: 147.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8596b5809299d7bd33b7c65ab843fb3f9b694eefc958c24872526411797da651
|
|
| MD5 |
df264840b317f876004d95e2e59cd9c1
|
|
| BLAKE2b-256 |
c12ae855b86bfddca9b0e275c21fe1a9ab36fb380a1bf4fcb5ac20f7eb8df270
|