qwerty-agent 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qwerty_agent-2.0.0/LICENSE +21 -0
- qwerty_agent-2.0.0/PKG-INFO +178 -0
- qwerty_agent-2.0.0/README.md +153 -0
- qwerty_agent-2.0.0/pyproject.toml +40 -0
- qwerty_agent-2.0.0/qwerty_agent.egg-info/PKG-INFO +178 -0
- qwerty_agent-2.0.0/qwerty_agent.egg-info/SOURCES.txt +8 -0
- qwerty_agent-2.0.0/qwerty_agent.egg-info/dependency_links.txt +1 -0
- qwerty_agent-2.0.0/qwerty_agent.egg-info/entry_points.txt +4 -0
- qwerty_agent-2.0.0/qwerty_agent.egg-info/top_level.txt +4 -0
- qwerty_agent-2.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KasishStar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qwerty-agent
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Zero-dependency symbolic AI agent. Pure Python stdlib. Runs anywhere.
|
|
5
|
+
Author: KasishStar
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/KasishStar/qwerty-agent
|
|
8
|
+
Project-URL: Source, https://github.com/KasishStar/qwerty-agent
|
|
9
|
+
Project-URL: Tracker, https://github.com/KasishStar/qwerty-agent/issues
|
|
10
|
+
Keywords: ai,agent,symbolic,automation,cli
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Qwerty v2 — Zero-Dependency Symbolic AI Agent
|
|
27
|
+
|
|
28
|
+
**Pure Python stdlib. No numpy. No torch. No sklearn. 10MB total. Runs on a Raspberry Pi.**
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Why Qwerty?
|
|
33
|
+
|
|
34
|
+
| Qwerty | Other AI Agents |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `pip install` → runs | Requires Python ML stack (numpy, torch, transformers, 800MB+) |
|
|
37
|
+
| Offline by default | Cloud API or local LLM (8GB+ RAM) |
|
|
38
|
+
| 10MB on disk | 2-20GB for local models |
|
|
39
|
+
| Constitution hardcoded at engine level | Safety is a prompt (jailbreakable) |
|
|
40
|
+
| Deterministic — same input, same output | Non-deterministic (sampling) |
|
|
41
|
+
| Runs on ARM (Raspberry Pi Zero) | Needs x86 GPU or cloud |
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **14 tools**: read, write, edit, search, find, run, web search, wikipedia, learn, analyze errors, and more
|
|
46
|
+
- **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
|
|
47
|
+
- **Knowledge base**: 8 curated domains + 127 Wikipedia articles covering programming, OS dev, networking, math, physics, chemistry, biology, technology, and general knowledge
|
|
48
|
+
- **Genius composition engine**: retrieves, scores, and assembles multi-sentence responses from 2500+ sentences across all knowledge files
|
|
49
|
+
- **On-demand learning**: `lookup <topic>` → Wikipedia API (free, caches for next time); web fallback → DuckDuckGo
|
|
50
|
+
- **Constitution safety**: 9 hardcoded rules block `rm -rf /`, credential leaks, file overwrites without confirmation, and other dangerous operations
|
|
51
|
+
- **Persistent memory**: every answer, every lookup, every fix is stored in `memory/learned.json` — learning compounds across sessions
|
|
52
|
+
- **Recursive solve loop**: react → think → explore → internet → report — 3 layers of fallback before giving up
|
|
53
|
+
- **Protocol**: JSON-RPC, MCP server, and CLI modes — plugs into any editor or toolchain
|
|
54
|
+
- **76 passing tests**, zero external dependencies
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/KasishStar/qwerty-agent
|
|
60
|
+
cd qwerty-agent
|
|
61
|
+
python agent.py
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or ask a question directly:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python agent.py "what is a kernel"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Interactive Mode
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
python agent.py
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
qwerty> what is UEFI boot
|
|
78
|
+
qwerty> lookup quantum computing
|
|
79
|
+
qwerty> list files
|
|
80
|
+
qwerty> read file agent.py
|
|
81
|
+
qwerty> learn that the answer is 42
|
|
82
|
+
qwerty> exit
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Interface (with history and slash commands)
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python interface.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## JSON-RPC Protocol
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python protocol.py --process "what is a kernel"
|
|
95
|
+
python protocol.py --json "what is a kernel"
|
|
96
|
+
python protocol.py --schema
|
|
97
|
+
python protocol.py --mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Architecture
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
User Input → Normalize → Classify Intent → Constitution Check → Execute → Result
|
|
104
|
+
↓
|
|
105
|
+
Genius Composition Engine
|
|
106
|
+
(2500+ sentences, 8+ domains)
|
|
107
|
+
↓
|
|
108
|
+
Recursive Fallback Loop
|
|
109
|
+
react → routine → explore → internet → report
|
|
110
|
+
↓
|
|
111
|
+
Persistent Memory (learned.json)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
All layers are checked against the constitution before execution. No layer can run `rm -rf /`, overwrite user files without confirmation, or leak credentials.
|
|
115
|
+
|
|
116
|
+
## How It Works
|
|
117
|
+
|
|
118
|
+
Qwerty is not an LLM. It's a **symbolic AI** — every decision is deterministic if/then logic. Its "intelligence" comes from:
|
|
119
|
+
|
|
120
|
+
1. **Broad knowledge** (Wikipedia articles + curated domains)
|
|
121
|
+
2. **Fuzzy pattern matching** (Levenshtein, n-gram Jaccard, keyword overlap)
|
|
122
|
+
3. **Multi-source composition** (Genius scores and assembles sentences)
|
|
123
|
+
4. **On-demand learning** (fetches and stores new knowledge at runtime)
|
|
124
|
+
5. **Compounding memory** (every success is saved for next session)
|
|
125
|
+
|
|
126
|
+
## What Qwerty Can Do
|
|
127
|
+
|
|
128
|
+
| Task | Example |
|
|
129
|
+
|---|---|
|
|
130
|
+
| Answer knowledge questions | `"what is a microkernel"` |
|
|
131
|
+
| Read/write files | `"read file agent.py"` |
|
|
132
|
+
| Edit code | `"edit line 10 of test.py to say hello"` |
|
|
133
|
+
| Run commands | `"run cargo build"` |
|
|
134
|
+
| Search code | `"search for TODO in src/"` |
|
|
135
|
+
| Learn new facts | `"learn that X that Y"` |
|
|
136
|
+
| Wikipedia lookup | `"lookup TCP protocol"` |
|
|
137
|
+
| Web search | `"search web for rust uefi tutorial"` |
|
|
138
|
+
| Analyze errors | Automatic on command failure |
|
|
139
|
+
| Remember across sessions | All in `memory/learned.json` |
|
|
140
|
+
|
|
141
|
+
## Requirements
|
|
142
|
+
|
|
143
|
+
- Python 3.10+
|
|
144
|
+
- No pip packages needed
|
|
145
|
+
- Linux, macOS, or Windows
|
|
146
|
+
- ARM (Raspberry Pi) supported
|
|
147
|
+
- Internet optional (for web search and Wikipedia)
|
|
148
|
+
|
|
149
|
+
## Project Structure
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
qwerty-agent/
|
|
153
|
+
├── agent.py # Main engine: constitution, tools, NLP, solve loop
|
|
154
|
+
├── genius.py # Response composition engine
|
|
155
|
+
├── interface.py # Interactive REPL with history
|
|
156
|
+
├── protocol.py # JSON-RPC / MCP / CLI modes
|
|
157
|
+
├── constitution.json # 9 safety rules
|
|
158
|
+
├── knowledge/ # 9 JSON knowledge files (8 curated + Wikipedia)
|
|
159
|
+
├── memory/ # Persistent learning (auto-generated)
|
|
160
|
+
├── workflows/ # Pre-defined multi-step workflows
|
|
161
|
+
├── knowledge_importer.py # Wikipedia article downloader
|
|
162
|
+
├── test_all.py # 76 comprehensive tests
|
|
163
|
+
└── pyproject.toml # Build configuration
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Tests
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
python test_all.py
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
MIT — see [LICENSE](LICENSE).
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
**Created by KasishStar.** Pure symbolic AI. No ML dependencies. Runs anywhere.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Qwerty v2 — Zero-Dependency Symbolic AI Agent
|
|
2
|
+
|
|
3
|
+
**Pure Python stdlib. No numpy. No torch. No sklearn. 10MB total. Runs on a Raspberry Pi.**
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## Why Qwerty?
|
|
8
|
+
|
|
9
|
+
| Qwerty | Other AI Agents |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `pip install` → runs | Requires Python ML stack (numpy, torch, transformers, 800MB+) |
|
|
12
|
+
| Offline by default | Cloud API or local LLM (8GB+ RAM) |
|
|
13
|
+
| 10MB on disk | 2-20GB for local models |
|
|
14
|
+
| Constitution hardcoded at engine level | Safety is a prompt (jailbreakable) |
|
|
15
|
+
| Deterministic — same input, same output | Non-deterministic (sampling) |
|
|
16
|
+
| Runs on ARM (Raspberry Pi Zero) | Needs x86 GPU or cloud |
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **14 tools**: read, write, edit, search, find, run, web search, wikipedia, learn, analyze errors, and more
|
|
21
|
+
- **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
|
|
22
|
+
- **Knowledge base**: 8 curated domains + 127 Wikipedia articles covering programming, OS dev, networking, math, physics, chemistry, biology, technology, and general knowledge
|
|
23
|
+
- **Genius composition engine**: retrieves, scores, and assembles multi-sentence responses from 2500+ sentences across all knowledge files
|
|
24
|
+
- **On-demand learning**: `lookup <topic>` → Wikipedia API (free, caches for next time); web fallback → DuckDuckGo
|
|
25
|
+
- **Constitution safety**: 9 hardcoded rules block `rm -rf /`, credential leaks, file overwrites without confirmation, and other dangerous operations
|
|
26
|
+
- **Persistent memory**: every answer, every lookup, every fix is stored in `memory/learned.json` — learning compounds across sessions
|
|
27
|
+
- **Recursive solve loop**: react → think → explore → internet → report — 3 layers of fallback before giving up
|
|
28
|
+
- **Protocol**: JSON-RPC, MCP server, and CLI modes — plugs into any editor or toolchain
|
|
29
|
+
- **76 passing tests**, zero external dependencies
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/KasishStar/qwerty-agent
|
|
35
|
+
cd qwerty-agent
|
|
36
|
+
python agent.py
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or ask a question directly:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python agent.py "what is a kernel"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Interactive Mode
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python agent.py
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
qwerty> what is UEFI boot
|
|
53
|
+
qwerty> lookup quantum computing
|
|
54
|
+
qwerty> list files
|
|
55
|
+
qwerty> read file agent.py
|
|
56
|
+
qwerty> learn that the answer is 42
|
|
57
|
+
qwerty> exit
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Interface (with history and slash commands)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
python interface.py
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## JSON-RPC Protocol
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python protocol.py --process "what is a kernel"
|
|
70
|
+
python protocol.py --json "what is a kernel"
|
|
71
|
+
python protocol.py --schema
|
|
72
|
+
python protocol.py --mcp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Architecture
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
User Input → Normalize → Classify Intent → Constitution Check → Execute → Result
|
|
79
|
+
↓
|
|
80
|
+
Genius Composition Engine
|
|
81
|
+
(2500+ sentences, 8+ domains)
|
|
82
|
+
↓
|
|
83
|
+
Recursive Fallback Loop
|
|
84
|
+
react → routine → explore → internet → report
|
|
85
|
+
↓
|
|
86
|
+
Persistent Memory (learned.json)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
All layers are checked against the constitution before execution. No layer can run `rm -rf /`, overwrite user files without confirmation, or leak credentials.
|
|
90
|
+
|
|
91
|
+
## How It Works
|
|
92
|
+
|
|
93
|
+
Qwerty is not an LLM. It's a **symbolic AI** — every decision is deterministic if/then logic. Its "intelligence" comes from:
|
|
94
|
+
|
|
95
|
+
1. **Broad knowledge** (Wikipedia articles + curated domains)
|
|
96
|
+
2. **Fuzzy pattern matching** (Levenshtein, n-gram Jaccard, keyword overlap)
|
|
97
|
+
3. **Multi-source composition** (Genius scores and assembles sentences)
|
|
98
|
+
4. **On-demand learning** (fetches and stores new knowledge at runtime)
|
|
99
|
+
5. **Compounding memory** (every success is saved for next session)
|
|
100
|
+
|
|
101
|
+
## What Qwerty Can Do
|
|
102
|
+
|
|
103
|
+
| Task | Example |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Answer knowledge questions | `"what is a microkernel"` |
|
|
106
|
+
| Read/write files | `"read file agent.py"` |
|
|
107
|
+
| Edit code | `"edit line 10 of test.py to say hello"` |
|
|
108
|
+
| Run commands | `"run cargo build"` |
|
|
109
|
+
| Search code | `"search for TODO in src/"` |
|
|
110
|
+
| Learn new facts | `"learn that X that Y"` |
|
|
111
|
+
| Wikipedia lookup | `"lookup TCP protocol"` |
|
|
112
|
+
| Web search | `"search web for rust uefi tutorial"` |
|
|
113
|
+
| Analyze errors | Automatic on command failure |
|
|
114
|
+
| Remember across sessions | All in `memory/learned.json` |
|
|
115
|
+
|
|
116
|
+
## Requirements
|
|
117
|
+
|
|
118
|
+
- Python 3.10+
|
|
119
|
+
- No pip packages needed
|
|
120
|
+
- Linux, macOS, or Windows
|
|
121
|
+
- ARM (Raspberry Pi) supported
|
|
122
|
+
- Internet optional (for web search and Wikipedia)
|
|
123
|
+
|
|
124
|
+
## Project Structure
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
qwerty-agent/
|
|
128
|
+
├── agent.py # Main engine: constitution, tools, NLP, solve loop
|
|
129
|
+
├── genius.py # Response composition engine
|
|
130
|
+
├── interface.py # Interactive REPL with history
|
|
131
|
+
├── protocol.py # JSON-RPC / MCP / CLI modes
|
|
132
|
+
├── constitution.json # 9 safety rules
|
|
133
|
+
├── knowledge/ # 9 JSON knowledge files (8 curated + Wikipedia)
|
|
134
|
+
├── memory/ # Persistent learning (auto-generated)
|
|
135
|
+
├── workflows/ # Pre-defined multi-step workflows
|
|
136
|
+
├── knowledge_importer.py # Wikipedia article downloader
|
|
137
|
+
├── test_all.py # 76 comprehensive tests
|
|
138
|
+
└── pyproject.toml # Build configuration
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Tests
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
python test_all.py
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
MIT — see [LICENSE](LICENSE).
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
**Created by KasishStar.** Pure symbolic AI. No ML dependencies. Runs anywhere.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qwerty-agent"
|
|
7
|
+
version = "2.0.0"
|
|
8
|
+
description = "Zero-dependency symbolic AI agent. Pure Python stdlib. Runs anywhere."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "KasishStar"}
|
|
13
|
+
]
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
keywords = ["ai", "agent", "symbolic", "automation", "cli"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Topic :: Software Development :: Build Tools",
|
|
26
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/KasishStar/qwerty-agent"
|
|
31
|
+
Source = "https://github.com/KasishStar/qwerty-agent"
|
|
32
|
+
Tracker = "https://github.com/KasishStar/qwerty-agent/issues"
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
qwerty = "agent:main"
|
|
36
|
+
qwerty-json = "protocol:main"
|
|
37
|
+
qwerty-interface = "interface:main"
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.packages.find]
|
|
40
|
+
include = ["*"]
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qwerty-agent
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Zero-dependency symbolic AI agent. Pure Python stdlib. Runs anywhere.
|
|
5
|
+
Author: KasishStar
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/KasishStar/qwerty-agent
|
|
8
|
+
Project-URL: Source, https://github.com/KasishStar/qwerty-agent
|
|
9
|
+
Project-URL: Tracker, https://github.com/KasishStar/qwerty-agent/issues
|
|
10
|
+
Keywords: ai,agent,symbolic,automation,cli
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Qwerty v2 — Zero-Dependency Symbolic AI Agent
|
|
27
|
+
|
|
28
|
+
**Pure Python stdlib. No numpy. No torch. No sklearn. 10MB total. Runs on a Raspberry Pi.**
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Why Qwerty?
|
|
33
|
+
|
|
34
|
+
| Qwerty | Other AI Agents |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `pip install` → runs | Requires Python ML stack (numpy, torch, transformers, 800MB+) |
|
|
37
|
+
| Offline by default | Cloud API or local LLM (8GB+ RAM) |
|
|
38
|
+
| 10MB on disk | 2-20GB for local models |
|
|
39
|
+
| Constitution hardcoded at engine level | Safety is a prompt (jailbreakable) |
|
|
40
|
+
| Deterministic — same input, same output | Non-deterministic (sampling) |
|
|
41
|
+
| Runs on ARM (Raspberry Pi Zero) | Needs x86 GPU or cloud |
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **14 tools**: read, write, edit, search, find, run, web search, wikipedia, learn, analyze errors, and more
|
|
46
|
+
- **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
|
|
47
|
+
- **Knowledge base**: 8 curated domains + 127 Wikipedia articles covering programming, OS dev, networking, math, physics, chemistry, biology, technology, and general knowledge
|
|
48
|
+
- **Genius composition engine**: retrieves, scores, and assembles multi-sentence responses from 2500+ sentences across all knowledge files
|
|
49
|
+
- **On-demand learning**: `lookup <topic>` → Wikipedia API (free, caches for next time); web fallback → DuckDuckGo
|
|
50
|
+
- **Constitution safety**: 9 hardcoded rules block `rm -rf /`, credential leaks, file overwrites without confirmation, and other dangerous operations
|
|
51
|
+
- **Persistent memory**: every answer, every lookup, every fix is stored in `memory/learned.json` — learning compounds across sessions
|
|
52
|
+
- **Recursive solve loop**: react → think → explore → internet → report — 3 layers of fallback before giving up
|
|
53
|
+
- **Protocol**: JSON-RPC, MCP server, and CLI modes — plugs into any editor or toolchain
|
|
54
|
+
- **76 passing tests**, zero external dependencies
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/KasishStar/qwerty-agent
|
|
60
|
+
cd qwerty-agent
|
|
61
|
+
python agent.py
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or ask a question directly:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python agent.py "what is a kernel"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Interactive Mode
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
python agent.py
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
qwerty> what is UEFI boot
|
|
78
|
+
qwerty> lookup quantum computing
|
|
79
|
+
qwerty> list files
|
|
80
|
+
qwerty> read file agent.py
|
|
81
|
+
qwerty> learn that the answer is 42
|
|
82
|
+
qwerty> exit
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Interface (with history and slash commands)
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python interface.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## JSON-RPC Protocol
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python protocol.py --process "what is a kernel"
|
|
95
|
+
python protocol.py --json "what is a kernel"
|
|
96
|
+
python protocol.py --schema
|
|
97
|
+
python protocol.py --mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Architecture
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
User Input → Normalize → Classify Intent → Constitution Check → Execute → Result
|
|
104
|
+
↓
|
|
105
|
+
Genius Composition Engine
|
|
106
|
+
(2500+ sentences, 8+ domains)
|
|
107
|
+
↓
|
|
108
|
+
Recursive Fallback Loop
|
|
109
|
+
react → routine → explore → internet → report
|
|
110
|
+
↓
|
|
111
|
+
Persistent Memory (learned.json)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
All layers are checked against the constitution before execution. No layer can run `rm -rf /`, overwrite user files without confirmation, or leak credentials.
|
|
115
|
+
|
|
116
|
+
## How It Works
|
|
117
|
+
|
|
118
|
+
Qwerty is not an LLM. It's a **symbolic AI** — every decision is deterministic if/then logic. Its "intelligence" comes from:
|
|
119
|
+
|
|
120
|
+
1. **Broad knowledge** (Wikipedia articles + curated domains)
|
|
121
|
+
2. **Fuzzy pattern matching** (Levenshtein, n-gram Jaccard, keyword overlap)
|
|
122
|
+
3. **Multi-source composition** (Genius scores and assembles sentences)
|
|
123
|
+
4. **On-demand learning** (fetches and stores new knowledge at runtime)
|
|
124
|
+
5. **Compounding memory** (every success is saved for next session)
|
|
125
|
+
|
|
126
|
+
## What Qwerty Can Do
|
|
127
|
+
|
|
128
|
+
| Task | Example |
|
|
129
|
+
|---|---|
|
|
130
|
+
| Answer knowledge questions | `"what is a microkernel"` |
|
|
131
|
+
| Read/write files | `"read file agent.py"` |
|
|
132
|
+
| Edit code | `"edit line 10 of test.py to say hello"` |
|
|
133
|
+
| Run commands | `"run cargo build"` |
|
|
134
|
+
| Search code | `"search for TODO in src/"` |
|
|
135
|
+
| Learn new facts | `"learn that X that Y"` |
|
|
136
|
+
| Wikipedia lookup | `"lookup TCP protocol"` |
|
|
137
|
+
| Web search | `"search web for rust uefi tutorial"` |
|
|
138
|
+
| Analyze errors | Automatic on command failure |
|
|
139
|
+
| Remember across sessions | All in `memory/learned.json` |
|
|
140
|
+
|
|
141
|
+
## Requirements
|
|
142
|
+
|
|
143
|
+
- Python 3.10+
|
|
144
|
+
- No pip packages needed
|
|
145
|
+
- Linux, macOS, or Windows
|
|
146
|
+
- ARM (Raspberry Pi) supported
|
|
147
|
+
- Internet optional (for web search and Wikipedia)
|
|
148
|
+
|
|
149
|
+
## Project Structure
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
qwerty-agent/
|
|
153
|
+
├── agent.py # Main engine: constitution, tools, NLP, solve loop
|
|
154
|
+
├── genius.py # Response composition engine
|
|
155
|
+
├── interface.py # Interactive REPL with history
|
|
156
|
+
├── protocol.py # JSON-RPC / MCP / CLI modes
|
|
157
|
+
├── constitution.json # 9 safety rules
|
|
158
|
+
├── knowledge/ # 9 JSON knowledge files (8 curated + Wikipedia)
|
|
159
|
+
├── memory/ # Persistent learning (auto-generated)
|
|
160
|
+
├── workflows/ # Pre-defined multi-step workflows
|
|
161
|
+
├── knowledge_importer.py # Wikipedia article downloader
|
|
162
|
+
├── test_all.py # 76 comprehensive tests
|
|
163
|
+
└── pyproject.toml # Build configuration
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Tests
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
python test_all.py
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
MIT — see [LICENSE](LICENSE).
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
**Created by KasishStar.** Pure symbolic AI. No ML dependencies. Runs anywhere.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|