eljay-ai 1.1.0
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.
- package/AGENTS.md +57 -0
- package/README.md +479 -0
- package/agent/__init__.py +10 -0
- package/agent/agent.py +269 -0
- package/agent/agents/__init__.py +34 -0
- package/agent/agents/registry.py +212 -0
- package/agent/builtin_tools.py +591 -0
- package/agent/chat.py +354 -0
- package/agent/config.py +67 -0
- package/agent/context.py +63 -0
- package/agent/edits.py +167 -0
- package/agent/gitaware.py +126 -0
- package/agent/hardware.py +331 -0
- package/agent/knowledge.py +133 -0
- package/agent/memory.py +98 -0
- package/agent/ollama_client.py +133 -0
- package/agent/permissions.py +93 -0
- package/agent/providers/__init__.py +51 -0
- package/agent/providers/base.py +78 -0
- package/agent/providers/image.py +110 -0
- package/agent/providers/ollama.py +111 -0
- package/agent/providers/video.py +96 -0
- package/agent/providers/web.py +155 -0
- package/agent/router.py +200 -0
- package/agent/rules.py +52 -0
- package/agent/runner.py +168 -0
- package/agent/skills.py +161 -0
- package/agent/tools.py +102 -0
- package/agent/verification.py +80 -0
- package/agent/workspace.py +487 -0
- package/bin/eljay +5 -0
- package/bin/eljay.cmd +4 -0
- package/bin/myagent +4 -0
- package/bin/myagent.cmd +4 -0
- package/eljay-ai-1.1.0.tgz +0 -0
- package/eljay.js +56 -0
- package/eljay.py +150 -0
- package/install.ps1 +28 -0
- package/knowledge/reference/diffusers.md +32 -0
- package/knowledge/reference/video-providers.md +21 -0
- package/knowledge/setup/comfyui.md +35 -0
- package/knowledge/setup/image-providers.md +16 -0
- package/knowledge/test-category/test-entry.md +5 -0
- package/myagent.py +30 -0
- package/package.json +40 -0
- package/skills/coding/code-review.md +3 -0
- package/skills/coding/fix-attempt-protocol.md +9 -0
- package/skills/debugging/root-cause-analysis.md +9 -0
- package/skills/general/communication.md +7 -0
- package/skills/laravel/authentication.md +15 -0
- package/skills/mysql/performance.md +9 -0
- package/skills/php/standards.md +8 -0
- package/skills/react/component-best-practices.md +8 -0
- package/skills/research/source-tracking.md +7 -0
- package/skills/security/input-validation.md +9 -0
- package/skills/testing/pytest-best-practices.md +7 -0
- package/tests/run_all.py +34 -0
- package/tests/test_agent_core.py +385 -0
- package/tests/test_capabilities.py +169 -0
- package/tests/test_edits.py +117 -0
- package/tests/test_eljay.py +209 -0
- package/tests/test_runner.py +114 -0
- package/tests/test_universal.py +458 -0
- package/tests/test_workspace.py +221 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Project Rules
|
|
2
|
+
|
|
3
|
+
This project is a **local, free Universal AI Assistant** built in Python.
|
|
4
|
+
ElJay AI supports coding, web research, image generation, video generation,
|
|
5
|
+
general knowledge, and general assistance through a single terminal interface.
|
|
6
|
+
|
|
7
|
+
## Stack
|
|
8
|
+
|
|
9
|
+
- Language: Python 3.14 (standard library only)
|
|
10
|
+
- Runtime: Ollama at `http://127.0.0.1:11434`
|
|
11
|
+
- Model: `qwen2.5-coder:3b` (configurable via `AGENT_MODEL`)
|
|
12
|
+
- Interface: command line (`eljay` via npm global install, or `python eljay.py`)
|
|
13
|
+
- Web search: DuckDuckGo Lite (free, no API key)
|
|
14
|
+
|
|
15
|
+
## Hardware-awareness
|
|
16
|
+
|
|
17
|
+
ElJay detects the local machine's hardware (OS, CPU, RAM, GPU, VRAM total & available,
|
|
18
|
+
disk) and recommends appropriate model modes. It reports capabilities honestly
|
|
19
|
+
and does not fake image/video generation when the hardware cannot support it.
|
|
20
|
+
|
|
21
|
+
## Agent architecture
|
|
22
|
+
|
|
23
|
+
The Main Agent routes natural-language requests to specialized agents:
|
|
24
|
+
Coding, Research, Image, Video, Knowledge. Routing uses keyword matching
|
|
25
|
+
(no LLM call) for speed and determinism. Image/Video agents are selected by
|
|
26
|
+
keyword even when local providers are unavailable — they then report the
|
|
27
|
+
setup steps or suggest free external providers.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- Preserve the existing architecture: `agent/` modules, entry point `eljay.py`. `myagent.py` is a backwards-compatible alias.
|
|
32
|
+
- **Do NOT add third-party dependencies.** The standard library is enough. If a
|
|
33
|
+
dependency truly seems necessary, explain why and ask first.
|
|
34
|
+
- Do not rewrite working code. Prefer small, targeted changes.
|
|
35
|
+
- Modify only what is necessary for the task.
|
|
36
|
+
- Ask before any destructive operation (delete, git reset, git push).
|
|
37
|
+
- Keep documentation (`README.md`) in sync with the implementation.
|
|
38
|
+
- Verify changes before reporting completion — run the tests and say what ran.
|
|
39
|
+
|
|
40
|
+
## Verification
|
|
41
|
+
|
|
42
|
+
Run all tests:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
python tests/run_all.py
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Individual test modules live in `tests/`.
|
|
49
|
+
|
|
50
|
+
## Safety invariants (must not be weakened)
|
|
51
|
+
|
|
52
|
+
- Tools are **read-only and `safe`** unless they write or execute.
|
|
53
|
+
- All filesystem paths are confined to the project root.
|
|
54
|
+
- There is **no delete/rename/move capability**.
|
|
55
|
+
- Non-safe actions require explicit user confirmation; high-risk actions require
|
|
56
|
+
typing `yes`; a session `always` never bypasses `high`.
|
|
57
|
+
- Command execution never uses a shell, and pipes/redirection are rejected.
|
package/README.md
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# ElJay AI
|
|
2
|
+
|
|
3
|
+
A **free, local, terminal-based Universal AI Assistant** for Windows. It talks to
|
|
4
|
+
a local LLM through [Ollama](https://ollama.com) — **no paid API keys for core
|
|
5
|
+
features, no cloud, and zero third-party Python packages** (standard library only).
|
|
6
|
+
|
|
7
|
+
ElJay AI can:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
CODING → Local Ollama model
|
|
11
|
+
RESEARCH → DuckDuckGo web search (free)
|
|
12
|
+
IMAGE GENERATION → Local (if GPU + ComfyUI/torch) or free providers
|
|
13
|
+
VIDEO GENERATION → Local (if 6 GB+ VRAM) or free providers
|
|
14
|
+
GENERAL KNOWLEDGE → Local Ollama model
|
|
15
|
+
GENERAL HELP → Local Ollama model
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The Main Agent routes natural-language requests to the appropriate specialized
|
|
19
|
+
agent automatically. You do not need to specify which capability to use.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Windows Terminal / PowerShell
|
|
23
|
+
|
|
|
24
|
+
eljay (a.k.a. myagent)
|
|
25
|
+
|
|
|
26
|
+
Main Agent (coordinator)
|
|
27
|
+
|
|
|
28
|
+
┌────────┼────────┬────────┐
|
|
29
|
+
│ │ │ │
|
|
30
|
+
Coding Research Image Video
|
|
31
|
+
│ │ │ │
|
|
32
|
+
└─────── Ollama ← Web └── (local GPU or free provider)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- **Windows** (PowerShell or Windows Terminal)
|
|
38
|
+
- **Python 3.14** — verified (`python --version`)
|
|
39
|
+
- **Ollama** — verified (`ollama --version`)
|
|
40
|
+
- **Node.js 20+** — for the `npm i -g` install path (`node --version`)
|
|
41
|
+
- A local model, e.g. `qwen2.5-coder:3b`
|
|
42
|
+
|
|
43
|
+
> On this machine `python3` is a broken Microsoft Store stub — use `python`.
|
|
44
|
+
|
|
45
|
+
## Quick start
|
|
46
|
+
|
|
47
|
+
### Option A — Install via npm (global command from any folder)
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
npm install -g eljay-ai
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This installs two commands on your PATH: `eljay` and `eljay-ai`. Restart your
|
|
54
|
+
terminal, then from **any** project folder:
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
C:\Projects\MyProject> eljay
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> If `npm` is not on your PATH yet, run the command from the **Node.js terminal**
|
|
61
|
+
> that ships with the [Node.js installer](https://nodejs.org).
|
|
62
|
+
|
|
63
|
+
### Option B — Install via install.ps1 (PowerShell)
|
|
64
|
+
|
|
65
|
+
From the project directory:
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
.\install.ps1 # adds the bin folder to your USER PATH
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Restart the terminal, then:
|
|
72
|
+
|
|
73
|
+
```powershell
|
|
74
|
+
C:\Projects\MyProject> eljay
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Option C — Run directly from source
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
python eljay.py
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`myagent.py` remains as a compatibility alias that behaves identically.
|
|
84
|
+
|
|
85
|
+
## Setup
|
|
86
|
+
|
|
87
|
+
```powershell
|
|
88
|
+
ollama serve
|
|
89
|
+
ollama pull qwen2.5-coder:3b
|
|
90
|
+
ollama list
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Running
|
|
94
|
+
|
|
95
|
+
Interactive session:
|
|
96
|
+
```powershell
|
|
97
|
+
eljay
|
|
98
|
+
python eljay.py
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
One-shot prompt:
|
|
102
|
+
```powershell
|
|
103
|
+
eljay "Explain how databases work"
|
|
104
|
+
python eljay.py "Explain how databases work"
|
|
105
|
+
eljay --version
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Commands (interactive)
|
|
109
|
+
|
|
110
|
+
| Command | Effect |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `/help` | Show help |
|
|
113
|
+
| `/tools` | List available tools |
|
|
114
|
+
| `/agents` | List specialized agents (Coding, Research, Image, Video, Knowledge, Main) |
|
|
115
|
+
| `/skills` | List loaded skills |
|
|
116
|
+
| `/knowledge [query]` | Search knowledge entries |
|
|
117
|
+
| `/providers` | Show provider availability |
|
|
118
|
+
| `/status` | Show hardware, model, agents, tools, skills, knowledge |
|
|
119
|
+
| `/verify` | Show the project's test/build commands |
|
|
120
|
+
| `/memory` | Show local memory (`/memory clear` erases it) |
|
|
121
|
+
| `/permissions` | Show risk levels + session allowances (`/permissions reset` clears) |
|
|
122
|
+
| `/clear` | Forget the conversation |
|
|
123
|
+
| `/model [name]` | Show or switch the active model |
|
|
124
|
+
| `/exit`, `/quit` | Leave the agent |
|
|
125
|
+
|
|
126
|
+
## Capabilities
|
|
127
|
+
|
|
128
|
+
### Coding Agent
|
|
129
|
+
|
|
130
|
+
Inspects projects, reads files, searches code, makes confirmed edits, runs
|
|
131
|
+
commands, tests, verifies changes, and reports git status.
|
|
132
|
+
|
|
133
|
+
**Workflow:** `Inspect → Understand → Propose → Permission → Modify → Verify`
|
|
134
|
+
|
|
135
|
+
Never claims success without actual tool evidence.
|
|
136
|
+
|
|
137
|
+
### Research Agent
|
|
138
|
+
|
|
139
|
+
Searches the web via DuckDuckGo Lite, fetches pages, extracts content,
|
|
140
|
+
compares sources, and summarizes with citation.
|
|
141
|
+
|
|
142
|
+
**Source hierarchy:** Official docs → Primary sources → Reliable technical
|
|
143
|
+
sources → Reputable secondary sources.
|
|
144
|
+
|
|
145
|
+
### Image Agent
|
|
146
|
+
|
|
147
|
+
Handles image generation requests. Reports which provider/model was used.
|
|
148
|
+
If no provider is available, gives exact setup steps.
|
|
149
|
+
|
|
150
|
+
### Video Agent
|
|
151
|
+
|
|
152
|
+
Handles video generation requests. Reports hardware requirements honestly.
|
|
153
|
+
If generation is unavailable, describes the concept and the setup needed.
|
|
154
|
+
|
|
155
|
+
### Knowledge Agent
|
|
156
|
+
|
|
157
|
+
General conversation, explanations, creative writing, idea generation.
|
|
158
|
+
Uses the local model — no web research unless the user asks for current info.
|
|
159
|
+
|
|
160
|
+
### General Assistant Behavior
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
> Hello
|
|
164
|
+
> Help me write a professional email.
|
|
165
|
+
> Explain quantum computing simply.
|
|
166
|
+
> Fix the authentication problem in this Laravel project.
|
|
167
|
+
> Research the latest Laravel documentation.
|
|
168
|
+
> Generate an image of a dark gothic cowboy.
|
|
169
|
+
> Create a cinematic video concept for this song.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
You do not need to manually select an agent. ElJay determines the appropriate
|
|
173
|
+
capability from your request.
|
|
174
|
+
|
|
175
|
+
## Hardware-Aware Detection
|
|
176
|
+
|
|
177
|
+
ElJay detects your hardware and recommends appropriate model modes:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
High-end GPU → large models
|
|
181
|
+
Mid-range GPU → medium / quantized models
|
|
182
|
+
~4 GB VRAM → small / quantized models or CPU offloading
|
|
183
|
+
Low VRAM → CPU / system RAM where practical
|
|
184
|
+
No GPU → CPU-only mode
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The `/status` command shows detailed hardware info including **total VRAM**
|
|
188
|
+
and **currently available (free) VRAM**.
|
|
189
|
+
|
|
190
|
+
### Capabilities by hardware tier
|
|
191
|
+
|
|
192
|
+
| Tier | VRAM | Image | Video |
|
|
193
|
+
|---|---|---|---|
|
|
194
|
+
| High-end GPU | 8 GB+ | Full-precision local models | Local video generation |
|
|
195
|
+
| Mid-range GPU | 4–8 GB | Medium/quantized models | Limited resolution video |
|
|
196
|
+
| Low VRAM | < 4 GB | CPU offload (slow) or external | Not available locally |
|
|
197
|
+
| No GPU | N/A | External provider or CPU (very slow) | External provider |
|
|
198
|
+
|
|
199
|
+
## Tools
|
|
200
|
+
|
|
201
|
+
| Tool | Risk | Purpose |
|
|
202
|
+
|---|---|---|
|
|
203
|
+
| `get_current_time` | safe | Local date/time |
|
|
204
|
+
| `project_info` | safe | Name, root, detected stack |
|
|
205
|
+
| `list_files` | safe | Project tree (`path`, `depth`, `max_entries`) |
|
|
206
|
+
| `read_file` | safe | Numbered lines (`path`, `start_line`, `end_line`) |
|
|
207
|
+
| `search_code` | safe | Find text (`query`, `path`, `regex`, `case_sensitive`, `max_results`) |
|
|
208
|
+
| `detect_checks` | safe | Project's lint/test/build commands |
|
|
209
|
+
| `git_status` | safe | Branch + changed files (read-only) |
|
|
210
|
+
| `remember` | safe | Save a note to local memory |
|
|
211
|
+
| `create_file` | **ask** | Create a NEW file (refuses to overwrite) |
|
|
212
|
+
| `edit_file` | **ask** | Replace exact text in an existing file |
|
|
213
|
+
| `run_command` | **ask/high** | Run ONE command (risk depends on the command) |
|
|
214
|
+
|
|
215
|
+
## Permissions
|
|
216
|
+
|
|
217
|
+
| Risk | Behavior |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `safe` | Runs automatically (all read-only tools) |
|
|
220
|
+
| `ask` | Shows a preview, then `[y]es / [n]o / [a]lways` |
|
|
221
|
+
| `high` | Shows a preview, then requires you to TYPE `yes` |
|
|
222
|
+
|
|
223
|
+
- `a` grants a **session allowance** — the agent stops asking for that tool.
|
|
224
|
+
- A session allowance **never** bypasses a `high` action.
|
|
225
|
+
- `run_command` is classified **per command**: allow-listed programs (`python`,
|
|
226
|
+
`npm`, `git status`, ...) are `ask`; anything else, or a dangerous pattern
|
|
227
|
+
(`rm`, `git push`, `git reset`, `npm uninstall`, `drop database`, `sudo`, ...),
|
|
228
|
+
is `high`.
|
|
229
|
+
- No way to ask (non-interactive) means **deny** — it fails closed.
|
|
230
|
+
|
|
231
|
+
## Safety boundaries
|
|
232
|
+
|
|
233
|
+
- **No delete, rename, or move capability exists in the codebase.**
|
|
234
|
+
- All filesystem paths are confined to the project root (`../` is rejected).
|
|
235
|
+
- `create_file` refuses to overwrite; `edit_file` only changes exact matched text.
|
|
236
|
+
- Writes are capped at 1 MB and refuse binary files; edits refuse ambiguous matches.
|
|
237
|
+
- `read_file` refuses whole-file reads > 1 MB and caps output at 2000 lines.
|
|
238
|
+
- Commands never use a shell: `|`, `&`, `;`, `<`, `>`, backticks and `$(...)` are
|
|
239
|
+
refused, so there is no shell-injection surface.
|
|
240
|
+
- Commands run with a timeout and captured output; cwd is confined to the root.
|
|
241
|
+
- The agent never commits or pushes; `git_status` runs only read-only git.
|
|
242
|
+
|
|
243
|
+
## Provider Architecture
|
|
244
|
+
|
|
245
|
+
ElJay uses a provider abstraction — not locked to one backend.
|
|
246
|
+
|
|
247
|
+
| Provider | Capability | Cost | Requirements |
|
|
248
|
+
|---|---|---|---|
|
|
249
|
+
| **Ollama** | text generation | Local | Ollama installed + model pulled |
|
|
250
|
+
| **DuckDuckGo** | web search | Free | Internet |
|
|
251
|
+
| **Image (local)** | image generation | Local | CPU or GPU + ComfyUI/torch |
|
|
252
|
+
| **Video (local)** | video generation | Local | 6 GB+ VRAM GPU |
|
|
253
|
+
|
|
254
|
+
### Free-first policy
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
LOCAL → FREE/OPEN SOURCE → FREE API → OPTIONAL PAID
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Paid services are never mandatory for core features. When an external provider
|
|
261
|
+
is used, ElJay clearly labels it as "API KEY REQUIRED" or "PAID".
|
|
262
|
+
|
|
263
|
+
## Models
|
|
264
|
+
|
|
265
|
+
ElJay does **not** automatically download models. If a requested model is
|
|
266
|
+
unavailable, it reports what's installed and suggests the exact pull command:
|
|
267
|
+
|
|
268
|
+
```text
|
|
269
|
+
Model 'qwen2.5-coder:7b' is not installed.
|
|
270
|
+
Available: qwen2.5-coder:3b
|
|
271
|
+
Using 'qwen2.5-coder:3b' for now.
|
|
272
|
+
Install with: ollama pull qwen2.5-coder:7b
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Skills
|
|
276
|
+
|
|
277
|
+
Skills are reusable instruction bundles stored in `skills/`. They are
|
|
278
|
+
dynamically loaded and only injected into the prompt when relevant to your
|
|
279
|
+
request — keeping context lean.
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
skills/
|
|
283
|
+
├── coding/ code review, fix attempts
|
|
284
|
+
├── debugging/ root cause analysis
|
|
285
|
+
├── testing/ pytest best practices
|
|
286
|
+
├── react/ component best practices
|
|
287
|
+
├── laravel/ authentication patterns
|
|
288
|
+
├── php/ standards
|
|
289
|
+
├── mysql/ performance
|
|
290
|
+
├── security/ input validation
|
|
291
|
+
├── research/ source tracking
|
|
292
|
+
├── image-generation/
|
|
293
|
+
├── video-generation/
|
|
294
|
+
└── general/ communication
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
List skills with `/skills`, search with `/skills [query]`.
|
|
298
|
+
|
|
299
|
+
## Knowledge Base
|
|
300
|
+
|
|
301
|
+
A two-level knowledge system:
|
|
302
|
+
|
|
303
|
+
- **Global knowledge** — `knowledge/` in the ElJay installation directory.
|
|
304
|
+
Reusable across all projects.
|
|
305
|
+
- **Project knowledge** — `.agent/knowledge/` in the project workspace.
|
|
306
|
+
Project-specific facts.
|
|
307
|
+
|
|
308
|
+
Search with `/knowledge [query]` or `search_knowledge` tool.
|
|
309
|
+
|
|
310
|
+
## Memory (`.agent/`)
|
|
311
|
+
|
|
312
|
+
A gitignored folder for lightweight memory:
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
.agent/config.json agent settings
|
|
316
|
+
.agent/history.json recent conversation turns
|
|
317
|
+
.agent/context.json notes saved with the `remember` tool
|
|
318
|
+
.agent/knowledge/ project-specific knowledge
|
|
319
|
+
.agent/outputs/ generated images and videos
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Notes are injected into the system prompt on startup. Inspect or erase with
|
|
323
|
+
`/memory` and `/memory clear`.
|
|
324
|
+
|
|
325
|
+
## Context management
|
|
326
|
+
|
|
327
|
+
The agent never sends the whole project. Tools fetch only what is needed, tool
|
|
328
|
+
output is capped, and the conversation is trimmed to a character budget
|
|
329
|
+
(oldest turns dropped first, with a note) before each model call.
|
|
330
|
+
|
|
331
|
+
## Configuration
|
|
332
|
+
|
|
333
|
+
| Variable | Default | Purpose |
|
|
334
|
+
|---|---|---|
|
|
335
|
+
| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama API address |
|
|
336
|
+
| `AGENT_MODEL` | `qwen2.5-coder:3b` | Model to use |
|
|
337
|
+
| `AGENT_TIMEOUT` | `300` | Seconds to wait for a reply |
|
|
338
|
+
| `AGENT_MAX_STEPS` | `6` | Max tool steps per turn |
|
|
339
|
+
| `AGENT_MAX_CONTEXT_CHARS` | `16000` | Conversation character budget |
|
|
340
|
+
| `AGENT_AUTO_APPROVE` | *(off)* | **Dangerous:** skip `ask` confirmations (never `high`) |
|
|
341
|
+
|
|
342
|
+
## Project rules (`AGENTS.md`)
|
|
343
|
+
|
|
344
|
+
If the project root contains `AGENTS.md`, it is loaded and injected into the system
|
|
345
|
+
prompt as **binding instructions**, and the banner shows `Rules : AGENTS.md loaded`.
|
|
346
|
+
|
|
347
|
+
## Testing
|
|
348
|
+
|
|
349
|
+
```powershell
|
|
350
|
+
python tests/run_all.py
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
| Module | Covers |
|
|
354
|
+
|---|---|
|
|
355
|
+
| `tests/test_agent_core.py` | tool loop, parsing, unknown-tool guard, permissions |
|
|
356
|
+
| `tests/test_workspace.py` | listing, reading, search, root confinement |
|
|
357
|
+
| `tests/test_edits.py` | create/edit safety, overwrite refusal, previews |
|
|
358
|
+
| `tests/test_runner.py` | command classification, execution, timeout |
|
|
359
|
+
| `tests/test_capabilities.py` | rules, context, memory, verification, git |
|
|
360
|
+
| `tests/test_eljay.py` | rename, banner, version, launchers, package.json, provider fix |
|
|
361
|
+
| `tests/test_universal.py` | hardware, router, skills, knowledge, agents, providers, tools, CLI |
|
|
362
|
+
|
|
363
|
+
## Project layout
|
|
364
|
+
|
|
365
|
+
```
|
|
366
|
+
eljay.py primary entry point (banner, model, dispatch)
|
|
367
|
+
myagent.py compatibility alias (imports from eljay)
|
|
368
|
+
AGENTS.md this project's rules (loaded at startup)
|
|
369
|
+
install.ps1 adds bin/ to your user PATH
|
|
370
|
+
package.json npm package manifest (bin: eljay, eljay-ai)
|
|
371
|
+
eljay.js Node wrapper for `npm i -g` global install
|
|
372
|
+
bin/eljay.cmd Windows launcher
|
|
373
|
+
bin/eljay Git Bash launcher
|
|
374
|
+
bin/myagent.cmd Windows launcher (compat alias)
|
|
375
|
+
bin/myagent Git Bash launcher (compat alias)
|
|
376
|
+
agent/config.py configuration + system prompt
|
|
377
|
+
agent/ollama_client.py stdlib Ollama HTTP client
|
|
378
|
+
agent/chat.py terminal UI, /commands, permission prompt
|
|
379
|
+
agent/agent.py AgentCore: reason -> act -> observe loop
|
|
380
|
+
agent/tools.py Tool + ToolRegistry (schema, risk, preview)
|
|
381
|
+
agent/permissions.py safe / ask / high gate + session allowances
|
|
382
|
+
agent/workspace.py root/stack detection, listing, reading, searching
|
|
383
|
+
agent/edits.py file creation + exact-match editing (only writer)
|
|
384
|
+
agent/runner.py command classification + execution
|
|
385
|
+
agent/verification.py detect the smallest useful check
|
|
386
|
+
agent/rules.py AGENTS.md loading
|
|
387
|
+
agent/context.py conversation trimming
|
|
388
|
+
agent/memory.py .agent/ history + notes
|
|
389
|
+
agent/gitaware.py read-only git inspection
|
|
390
|
+
agent/builtin_tools.py tool registration
|
|
391
|
+
agent/hardware.py hardware detection (GPU, VRAM, RAM, disk)
|
|
392
|
+
agent/router.py agent routing and orchestration
|
|
393
|
+
agent/providers/ provider architecture (ollama, web, image, video)
|
|
394
|
+
agent/agents/registry.py agent routing (Main, Coding, Research, ...)
|
|
395
|
+
agent/skills.py skills discovery framework
|
|
396
|
+
agent/knowledge.py project-local + global knowledge base
|
|
397
|
+
skills/ default skill bundles
|
|
398
|
+
knowledge/ global knowledge entries
|
|
399
|
+
tests/ deterministic tests (no model, no network)
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Architecture notes
|
|
403
|
+
|
|
404
|
+
### Agent types
|
|
405
|
+
|
|
406
|
+
| Agent | Purpose |
|
|
407
|
+
|---|---|
|
|
408
|
+
| `Main` | Coordinator — handles general conversation, routes to specialists |
|
|
409
|
+
| `Coding` | Code understanding and editing |
|
|
410
|
+
| `Research` | Web search and information gathering |
|
|
411
|
+
| `Image` | Image generation (reports availability, suggests setup) |
|
|
412
|
+
| `Video` | Video generation (reports hardware requirements honestly) |
|
|
413
|
+
| `Knowledge` | General knowledge, explanations, creative writing |
|
|
414
|
+
|
|
415
|
+
### Providers
|
|
416
|
+
|
|
417
|
+
- **Ollama** — text generation via local LLMs
|
|
418
|
+
- **Web** — DuckDuckGo Lite search (truly free, no API key)
|
|
419
|
+
- **Image** — detects local tooling; reports clearly when unavailable
|
|
420
|
+
- **Video** — detects local tooling; reports hardware requirements honestly
|
|
421
|
+
|
|
422
|
+
### Hardware-aware behavior
|
|
423
|
+
|
|
424
|
+
```text
|
|
425
|
+
High-end GPU → Use appropriate larger models
|
|
426
|
+
Mid-range GPU → Use medium/quantized models
|
|
427
|
+
4 GB VRAM → Use small/quantized models or CPU/offloading
|
|
428
|
+
Low VRAM → Use CPU / system RAM where practical
|
|
429
|
+
No GPU → CPU-only mode
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Data privacy
|
|
433
|
+
|
|
434
|
+
```text
|
|
435
|
+
Local Ollama → stays local
|
|
436
|
+
Web research → internet (DuckDuckGo)
|
|
437
|
+
Image provider → prompt may leave machine (if external provider used)
|
|
438
|
+
Video provider → prompt/media may leave machine (if external provider used)
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
ElJay never sends user data externally without the provider being explicitly
|
|
442
|
+
configured and used.
|
|
443
|
+
|
|
444
|
+
### Extensibility
|
|
445
|
+
|
|
446
|
+
ElJay is designed so you can add new capabilities later without rewriting:
|
|
447
|
+
|
|
448
|
+
- **New agent**: Add to `agent/agents/registry.py`
|
|
449
|
+
- **New provider**: Create in `agent/providers/` and register in `PROVIDERS`
|
|
450
|
+
- **New skill**: Add a `.md` file in `skills/<category>/`
|
|
451
|
+
- **New knowledge**: Add a `.md` file in `knowledge/<category>/` or `.agent/knowledge/`
|
|
452
|
+
|
|
453
|
+
## Compatibility
|
|
454
|
+
|
|
455
|
+
- `myagent` and `myagent.py` are kept as backward-compatible aliases.
|
|
456
|
+
- All launchers in `bin/` delegate to `eljay.py`.
|
|
457
|
+
|
|
458
|
+
## Troubleshooting
|
|
459
|
+
|
|
460
|
+
- **`Could not reach Ollama ...`** — start it: `ollama serve`.
|
|
461
|
+
- **`No Ollama models are installed`** — `ollama pull qwen2.5-coder:3b`.
|
|
462
|
+
- **`python3: Python was not found`** — use `python`.
|
|
463
|
+
- **The model picks the wrong tool or over-triggers** — this is a small-model
|
|
464
|
+
limitation. A larger model decides better and needs no code changes:
|
|
465
|
+
`ollama pull qwen2.5-coder:7b` and set `AGENT_MODEL=qwen2.5-coder:7b`.
|
|
466
|
+
- **`ERROR: shell operators ... are not allowed`** — run one command, no pipes.
|
|
467
|
+
- **Image/video generation not available** — ElJay detects your hardware and
|
|
468
|
+
reports honestly. On a GPU-less machine, local image/video generation requires
|
|
469
|
+
installing additional packages (torch, diffusers, ComfyUI) and is not bundled.
|
|
470
|
+
ElJay suggests the exact setup steps or external free providers.
|
|
471
|
+
|
|
472
|
+
## Limitations
|
|
473
|
+
|
|
474
|
+
- This machine has **no GPU** → local image and video generation require
|
|
475
|
+
additional packages not installed here. ElJay reports this clearly.
|
|
476
|
+
- `qwen2.5-coder:7b` is the preferred model but is **not installed** — ElJay
|
|
477
|
+
defaults to `:3b` and suggests `ollama pull qwen2.5-coder:7b` if needed.
|
|
478
|
+
- Web research uses DuckDuckGo Lite — may be rate-limited or blocked in some
|
|
479
|
+
environments.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ElJay AI — a free, local, universal AI assistant.
|
|
2
|
+
|
|
3
|
+
Version 1.1.0 transforms the coding agent into a universal assistant with
|
|
4
|
+
agent routing (Coding, Research, Image, Video, Knowledge), skills system,
|
|
5
|
+
knowledge base, and hardware detection.
|
|
6
|
+
|
|
7
|
+
This module provides the package version string.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__version__ = "1.1.0"
|