hubzoid 0.2.2__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.
- hubzoid-0.2.2/LICENSE +21 -0
- hubzoid-0.2.2/PKG-INFO +352 -0
- hubzoid-0.2.2/README.md +308 -0
- hubzoid-0.2.2/hubzoid/__init__.py +10 -0
- hubzoid-0.2.2/hubzoid/__main__.py +12 -0
- hubzoid-0.2.2/hubzoid/_fs.py +56 -0
- hubzoid-0.2.2/hubzoid/cli.py +482 -0
- hubzoid-0.2.2/hubzoid/factory.py +135 -0
- hubzoid-0.2.2/hubzoid/factory_claude.py +292 -0
- hubzoid-0.2.2/hubzoid/frontmatter.py +63 -0
- hubzoid-0.2.2/hubzoid/loaders/__init__.py +0 -0
- hubzoid-0.2.2/hubzoid/loaders/agents.py +129 -0
- hubzoid-0.2.2/hubzoid/loaders/knowledge.py +50 -0
- hubzoid-0.2.2/hubzoid/loaders/mcp.py +107 -0
- hubzoid-0.2.2/hubzoid/loaders/skills.py +77 -0
- hubzoid-0.2.2/hubzoid/loaders/tools_local.py +57 -0
- hubzoid-0.2.2/hubzoid/memory.py +21 -0
- hubzoid-0.2.2/hubzoid/model.py +60 -0
- hubzoid-0.2.2/hubzoid/runtime.py +104 -0
- hubzoid-0.2.2/hubzoid/server.py +182 -0
- hubzoid-0.2.2/hubzoid/settings.py +69 -0
- hubzoid-0.2.2/hubzoid/templates/starter/.gitignore +6 -0
- hubzoid-0.2.2/hubzoid/templates/starter/AGENTS.md +95 -0
- hubzoid-0.2.2/hubzoid/templates/starter/agents/builder/AGENTS.md +97 -0
- hubzoid-0.2.2/hubzoid/templates/starter/connectors/.mcp.json +3 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/agents-md-format.md +59 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/hub-folder-layout.md +65 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/mcp-and-connectors.md +71 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/three-agent-types.md +63 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/welcome.md +42 -0
- hubzoid-0.2.2/hubzoid/templates/starter/knowledge/what-is-hubzoid.md +66 -0
- hubzoid-0.2.2/hubzoid/templates/starter/skills/build-first-agent/SKILL.md +74 -0
- hubzoid-0.2.2/hubzoid/templates/starter/skills/explain-skills/SKILL.md +73 -0
- hubzoid-0.2.2/hubzoid/templates/starter/skills/find-the-docs/SKILL.md +59 -0
- hubzoid-0.2.2/hubzoid/templates/starter/skills/inspect-this-hub/SKILL.md +70 -0
- hubzoid-0.2.2/hubzoid/templates/starter/tools_local/current_time.py +35 -0
- hubzoid-0.2.2/hubzoid/tools/__init__.py +21 -0
- hubzoid-0.2.2/hubzoid/tools/files.py +74 -0
- hubzoid-0.2.2/hubzoid/tools/knowledge.py +47 -0
- hubzoid-0.2.2/hubzoid/tools/memory.py +125 -0
- hubzoid-0.2.2/hubzoid/tools/render.py +38 -0
- hubzoid-0.2.2/hubzoid/tools/skills_tool.py +48 -0
- hubzoid-0.2.2/hubzoid/tools/web_http.py +91 -0
- hubzoid-0.2.2/hubzoid/webui.py +69 -0
- hubzoid-0.2.2/hubzoid.egg-info/PKG-INFO +352 -0
- hubzoid-0.2.2/hubzoid.egg-info/SOURCES.txt +56 -0
- hubzoid-0.2.2/hubzoid.egg-info/dependency_links.txt +1 -0
- hubzoid-0.2.2/hubzoid.egg-info/entry_points.txt +2 -0
- hubzoid-0.2.2/hubzoid.egg-info/requires.txt +18 -0
- hubzoid-0.2.2/hubzoid.egg-info/top_level.txt +1 -0
- hubzoid-0.2.2/pyproject.toml +86 -0
- hubzoid-0.2.2/setup.cfg +4 -0
- hubzoid-0.2.2/tests/test_factory.py +71 -0
- hubzoid-0.2.2/tests/test_frontmatter.py +36 -0
- hubzoid-0.2.2/tests/test_fs.py +44 -0
- hubzoid-0.2.2/tests/test_init.py +180 -0
- hubzoid-0.2.2/tests/test_loaders.py +87 -0
- hubzoid-0.2.2/tests/test_server.py +74 -0
hubzoid-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HubZoid contributors
|
|
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.
|
hubzoid-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hubzoid
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Drop a folder of markdown files, get a chat agent with a polished web UI.
|
|
5
|
+
Author-email: HubZoid <hello@hubzoid.com>
|
|
6
|
+
Maintainer-email: HubZoid <hello@hubzoid.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/hubzoid/hubzoid
|
|
9
|
+
Project-URL: Repository, https://github.com/hubzoid/hubzoid
|
|
10
|
+
Project-URL: Issues, https://github.com/hubzoid/hubzoid/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/hubzoid/hubzoid/releases
|
|
12
|
+
Keywords: agents,ai,llm,openai,anthropic,claude,openrouter,open-webui,markdown,agents.md,mcp
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: openai-agents[litellm]>=0.14.7
|
|
27
|
+
Requires-Dist: claude-agent-sdk>=0.1.0
|
|
28
|
+
Requires-Dist: open-webui>=0.6
|
|
29
|
+
Requires-Dist: fastapi>=0.115
|
|
30
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
31
|
+
Requires-Dist: httpx>=0.27
|
|
32
|
+
Requires-Dist: pydantic>=2.0
|
|
33
|
+
Requires-Dist: PyYAML>=6.0
|
|
34
|
+
Requires-Dist: python-dotenv>=1.0
|
|
35
|
+
Requires-Dist: typer>=0.12
|
|
36
|
+
Requires-Dist: rich>=13
|
|
37
|
+
Requires-Dist: jinja2>=3.1
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
41
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
42
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<picture>
|
|
47
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/mark-dark.svg">
|
|
48
|
+
<img alt="/hubzoid" src="assets/mark-light.svg" width="220">
|
|
49
|
+
</picture>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<p align="center">
|
|
53
|
+
<strong>Drop a folder of markdown files. Get a chat agent with a polished web UI.</strong>
|
|
54
|
+
</p>
|
|
55
|
+
|
|
56
|
+
<p align="center">
|
|
57
|
+
<a href="https://pypi.org/project/hubzoid/"><img src="https://img.shields.io/pypi/v/hubzoid.svg?color=E5572A&label=pypi" alt="PyPI"></a>
|
|
58
|
+
<a href="https://pypi.org/project/hubzoid/"><img src="https://img.shields.io/pypi/pyversions/hubzoid.svg?color=0B0B0C" alt="Python"></a>
|
|
59
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0B0B0C.svg" alt="MIT License"></a>
|
|
60
|
+
<a href="https://hubzoid.com"><img src="https://img.shields.io/badge/website-hubzoid.com-E5572A.svg" alt="hubzoid.com"></a>
|
|
61
|
+
</p>
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
hubzoid reads `AGENTS.md`, `agents/`, `skills/`, and `knowledge/` from a folder
|
|
66
|
+
and turns it into a running AI agent. Backed by the [OpenAI Agents
|
|
67
|
+
SDK](https://openai.github.io/openai-agents-python/) or the [Claude Agent
|
|
68
|
+
SDK](https://code.claude.com/docs/en/agent-sdk/overview), served over an
|
|
69
|
+
OpenAI-compatible HTTP API, and chattable through a bundled
|
|
70
|
+
[Open WebUI](https://openwebui.com) front end.
|
|
71
|
+
|
|
72
|
+
You write the markdown. hubzoid handles the runtime, the API, the UI, the
|
|
73
|
+
streaming, and the sub-agent routing. Provider-agnostic via
|
|
74
|
+
[LiteLLM](https://docs.litellm.ai): OpenRouter, OpenAI, Anthropic, and local
|
|
75
|
+
Claude work out of the box.
|
|
76
|
+
|
|
77
|
+
## Quickstart
|
|
78
|
+
|
|
79
|
+
**3 steps if you have `claude` CLI installed and logged in, 4 otherwise.**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install hubzoid
|
|
83
|
+
hubzoid init demo-hub # scaffolds a starter hub + agents-repo wrapper
|
|
84
|
+
* edit demo-hub/.env # ← optional. skip if using claude-local.
|
|
85
|
+
hubzoid run demo-hub
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Open <http://localhost:3080>. The scaffolded `demo-hub` is a working **Hubzoid
|
|
89
|
+
Guide** agent.
|
|
90
|
+
|
|
91
|
+
**\* Step 3 (the optional one).** Default `MODEL=claude-local` uses your
|
|
92
|
+
installed `claude` CLI subscription. If you already ran `claude login`,
|
|
93
|
+
skip this step and go straight to `hubzoid run`. Otherwise, open
|
|
94
|
+
`demo-hub/.env`, comment out the `MODEL=claude-local` line, and uncomment
|
|
95
|
+
one of the provider stanzas (OpenRouter, OpenAI, Anthropic) with your key
|
|
96
|
+
pasted in.
|
|
97
|
+
|
|
98
|
+
The two files you edit later as you customize:
|
|
99
|
+
|
|
100
|
+
1. `demo-hub/.env`: keys, model selection, UI knobs.
|
|
101
|
+
2. `demo-hub/AGENTS.md`: the system prompt body. YAML frontmatter sets
|
|
102
|
+
`name`, `description`, and optional `model`.
|
|
103
|
+
|
|
104
|
+
## How it works
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
┌─────────────────────────────┐
|
|
108
|
+
│ Open WebUI │ http://localhost:3080
|
|
109
|
+
│ (web chat, white-label) │
|
|
110
|
+
└──────────────┬──────────────┘
|
|
111
|
+
│ OpenAI-compatible HTTP
|
|
112
|
+
┌──────────────┴──────────────┐
|
|
113
|
+
│ FastAPI bridge │ /v1/chat/completions /v1/models
|
|
114
|
+
└──────────────┬──────────────┘
|
|
115
|
+
│ in-process
|
|
116
|
+
┌──────────────┴──────────────┐
|
|
117
|
+
│ Agent runtime │ OpenAI Agents SDK | Claude Agent SDK
|
|
118
|
+
└──────────────┬──────────────┘
|
|
119
|
+
│ LiteLLM (or claude CLI subprocess)
|
|
120
|
+
┌──────────────┴──────────────┐
|
|
121
|
+
│ Your model │ OpenRouter · OpenAI · Anthropic · claude-local
|
|
122
|
+
└─────────────────────────────┘
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
One install command. Open WebUI, the Claude Agent SDK, the OpenAI Agents
|
|
126
|
+
SDK, LiteLLM, and FastAPI are all bundled as required dependencies. No
|
|
127
|
+
optional extras for the runtime.
|
|
128
|
+
|
|
129
|
+
## A minimal AGENTS.md
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
---
|
|
133
|
+
name: code-reviewer
|
|
134
|
+
description: Reviews a code diff. Ranks the top three issues by severity.
|
|
135
|
+
model: openrouter/anthropic/claude-haiku-4.5
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
You review code. When the user pastes a diff or a file, identify the top
|
|
139
|
+
three issues ranked by severity: correctness first, then security, then
|
|
140
|
+
readability.
|
|
141
|
+
|
|
142
|
+
For each issue, cite the line number and explain the fix in one sentence.
|
|
143
|
+
Skip style nits unless the user asks for them. If the code looks clean,
|
|
144
|
+
say so in one line and stop.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
That is the whole hub. One file. No sub-agents, no skills, no knowledge
|
|
148
|
+
needed. Drop it in a folder, run `hubzoid run .`, and you have a code
|
|
149
|
+
reviewer at <http://localhost:3080>.
|
|
150
|
+
|
|
151
|
+
## Editing your hub
|
|
152
|
+
|
|
153
|
+
Your hub is one folder. Six things to know.
|
|
154
|
+
|
|
155
|
+
1. **Pick your model.** Default `.env` uses `MODEL=claude-local` (no key
|
|
156
|
+
needed if `claude login` is done). To switch to OpenRouter / OpenAI /
|
|
157
|
+
Anthropic, uncomment a stanza in `.env` and paste a key.
|
|
158
|
+
2. **Write the main agent.** Open `AGENTS.md`. The body is the system
|
|
159
|
+
prompt. YAML frontmatter sets `name`, `description`, and optional
|
|
160
|
+
`model`.
|
|
161
|
+
3. **Sub-agents.** One folder per sub-agent under `agents/`. Each has its
|
|
162
|
+
own `AGENTS.md`. Frontmatter `tools: [...]` whitelists which tools the
|
|
163
|
+
sub-agent may call.
|
|
164
|
+
4. **Skills.** One folder per playbook under `skills/`, each with a
|
|
165
|
+
`SKILL.md`. The main agent loads them on demand via `load_skill(name)`.
|
|
166
|
+
5. **Knowledge.** One markdown file per topic under `knowledge/`. Reached
|
|
167
|
+
via `read_knowledge(name)`.
|
|
168
|
+
6. **Tools and connectors.** Drop Python files with `@function_tool` in
|
|
169
|
+
`tools_local/`. Edit `connectors/.mcp.json` to plug in
|
|
170
|
+
[MCP](https://modelcontextprotocol.io) servers.
|
|
171
|
+
|
|
172
|
+
Folder names are case- and plural-flexible. `skills/`, `Skills/`, and
|
|
173
|
+
`skill/` all work. Same for `agents/`, `knowledge/`, `tools_local/`,
|
|
174
|
+
`connectors/`. Restart with the same command. Changes are picked up on
|
|
175
|
+
the next start.
|
|
176
|
+
|
|
177
|
+
## Multi-hub agents repo
|
|
178
|
+
|
|
179
|
+
Run `hubzoid init` more than once in the same directory and you get a
|
|
180
|
+
Samarth-style multi-hub layout with one parent `requirements.txt`:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
mkdir my-agents && cd my-agents
|
|
184
|
+
hubzoid init devops-agent # creates ./devops-agent + ./requirements.txt + ./.gitignore + ./README.md
|
|
185
|
+
hubzoid init support-agent # creates ./support-agent only; parent files left alone
|
|
186
|
+
hubzoid init research-agent # creates ./research-agent only
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Each hub is independent: its own `.env`, its own port, its own user
|
|
190
|
+
database. The parent files are written **only** on the first init in a
|
|
191
|
+
fresh directory (empty or containing only dotfiles / README /
|
|
192
|
+
requirements.txt / LICENSE). Idempotent and non-destructive afterward.
|
|
193
|
+
|
|
194
|
+
## Providers
|
|
195
|
+
|
|
196
|
+
Pick one stanza in `.env`. See [docs/providers.md](docs/providers.md) for
|
|
197
|
+
more detail.
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# OpenRouter (one key, many models)
|
|
201
|
+
OPENROUTER_API_KEY=sk-or-v1-...
|
|
202
|
+
MODEL=openrouter/anthropic/claude-haiku-4.5
|
|
203
|
+
|
|
204
|
+
# OR OpenAI
|
|
205
|
+
OPENAI_API_KEY=sk-...
|
|
206
|
+
MODEL=openai/gpt-4o-mini
|
|
207
|
+
|
|
208
|
+
# OR Anthropic
|
|
209
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
210
|
+
MODEL=anthropic/claude-haiku-4-5
|
|
211
|
+
|
|
212
|
+
# OR Claude local (uses your installed `claude` CLI + Pro/Max subscription)
|
|
213
|
+
# Requires `claude login` first. No API key needed.
|
|
214
|
+
MODEL=claude-local
|
|
215
|
+
# MODEL=claude-local/sonnet # pin Sonnet
|
|
216
|
+
# MODEL=claude-local/opus # pin Opus
|
|
217
|
+
# MODEL=claude-local/haiku # pin Haiku
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The `MODEL` string tells LiteLLM which provider to call, and the matching
|
|
221
|
+
key must be set. The exception is `MODEL=claude-local`: instead of
|
|
222
|
+
LiteLLM, hubzoid drives the Claude Agent SDK against your locally
|
|
223
|
+
installed `claude` CLI, so auth and billing flow through your existing
|
|
224
|
+
Pro/Max subscription. Same hub folder, same tools, same skills. Only the
|
|
225
|
+
LLM and auth path differ.
|
|
226
|
+
|
|
227
|
+
## Pre-shipped tools
|
|
228
|
+
|
|
229
|
+
Every hub gets these tools for free.
|
|
230
|
+
|
|
231
|
+
| Tool | What it does |
|
|
232
|
+
|---|---|
|
|
233
|
+
| `read_file(path)` | Read a file under the hub directory. |
|
|
234
|
+
| `list_files(glob)` | List files matching a glob. |
|
|
235
|
+
| `write_artifact(filename, content)` | Write a file under `output/<session>/`. |
|
|
236
|
+
| `list_skills()` | Menu of skills in the hub. |
|
|
237
|
+
| `load_skill(name)` | Read a skill's full body on demand. |
|
|
238
|
+
| `list_knowledge()` | Menu of knowledge documents. |
|
|
239
|
+
| `read_knowledge(name)` | Read a knowledge document's full body. |
|
|
240
|
+
| `remember(fact, scope)` | Save a fact to durable memory. |
|
|
241
|
+
| `recall(query, scope)` | Look up saved facts. |
|
|
242
|
+
| `forget(id, scope)` | Delete a saved fact. |
|
|
243
|
+
| `render_jinja(template, context_json)` | Render a Jinja2 template. |
|
|
244
|
+
| `http_get(url)` | Fetch a URL (honors `HTTP_ALLOWLIST`). |
|
|
245
|
+
| `web_search(query)` | DuckDuckGo search. No API key. |
|
|
246
|
+
|
|
247
|
+
Custom tools dropped into `tools_local/*.py` are auto-discovered.
|
|
248
|
+
|
|
249
|
+
## MCP connectors
|
|
250
|
+
|
|
251
|
+
MCP connectors are **per-hub**. Each hub has its own
|
|
252
|
+
`<hub>/connectors/.mcp.json` alongside its `AGENTS.md`. Two hubs in the
|
|
253
|
+
same agents-repo connect to completely different MCP servers because each
|
|
254
|
+
loads its own config independently. There is no parent-level shared MCP
|
|
255
|
+
file by design: agents are independent products with their own scope.
|
|
256
|
+
|
|
257
|
+
Edit `demo-hub/connectors/.mcp.json` (or whatever your hub is named):
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"mcpServers": {
|
|
262
|
+
"filesystem": {
|
|
263
|
+
"command": "npx",
|
|
264
|
+
"args": ["@modelcontextprotocol/server-filesystem", "./workspace"]
|
|
265
|
+
},
|
|
266
|
+
"github": {
|
|
267
|
+
"command": "npx",
|
|
268
|
+
"args": ["@modelcontextprotocol/server-github"],
|
|
269
|
+
"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "${GH_TOKEN}"}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
`${VAR}` references in any string field resolve against the environment at
|
|
276
|
+
boot. The same `.mcp.json` is honored by both the OpenAI Agents and
|
|
277
|
+
Claude Agent runtimes.
|
|
278
|
+
|
|
279
|
+
## CLI
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
hubzoid init [NAME] Scaffold a new hub folder under the current directory.
|
|
283
|
+
NAME defaults to "demo-hub".
|
|
284
|
+
Also drops requirements.txt / .gitignore / README.md
|
|
285
|
+
at the parent on first run if the directory looks fresh.
|
|
286
|
+
hubzoid run [PATH] Start the FastAPI bridge plus Open WebUI for a hub.
|
|
287
|
+
--port INT Open WebUI port (default 3080).
|
|
288
|
+
--bridge-port INT FastAPI bridge port (default 8000).
|
|
289
|
+
--no-ui Bridge only, no Open WebUI.
|
|
290
|
+
hubzoid doctor [PATH] Validate hub config and report issues.
|
|
291
|
+
hubzoid test [PATH] Send one prompt to the agent and print the response.
|
|
292
|
+
hubzoid version
|
|
293
|
+
hubzoid --help
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
PATH defaults to `.` for run / doctor / test. `python -m hubzoid ...` also
|
|
297
|
+
works as an alternative invocation.
|
|
298
|
+
|
|
299
|
+
## Run from source
|
|
300
|
+
|
|
301
|
+
For contributors or anyone who wants to read or extend the framework code.
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
git clone https://github.com/hubzoid/hubzoid.git
|
|
305
|
+
cd hubzoid
|
|
306
|
+
python -m venv .venv && source .venv/bin/activate
|
|
307
|
+
pip install -e '.[dev]'
|
|
308
|
+
hubzoid run demo-hub
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The repo ships with `demo-hub/` at the root as a working starter. Its
|
|
312
|
+
`.env` is git-ignored but the template includes sensible defaults
|
|
313
|
+
(`MODEL=claude-local`).
|
|
314
|
+
|
|
315
|
+
## Open standards
|
|
316
|
+
|
|
317
|
+
| Spec | Used at |
|
|
318
|
+
|---|---|
|
|
319
|
+
| [AGENTS.md](https://agents.md) | `<hub>/AGENTS.md`, `<hub>/agents/<n>/AGENTS.md` |
|
|
320
|
+
| SKILL.md | `<hub>/skills/<n>/SKILL.md` |
|
|
321
|
+
| [MCP](https://modelcontextprotocol.io) | `<hub>/connectors/.mcp.json` |
|
|
322
|
+
|
|
323
|
+
Hubs are portable across any tool that adopts these specs (Claude Code,
|
|
324
|
+
Cursor, Codex, Copilot, Gemini CLI, VS Code).
|
|
325
|
+
|
|
326
|
+
## Roadmap
|
|
327
|
+
|
|
328
|
+
* **v0.2** Current. PyPI release with bundled Open WebUI + Claude Agent
|
|
329
|
+
SDK; OpenAI Agents and Claude Agent runtimes; AGENTS.md, SKILL.md, MCP
|
|
330
|
+
loaders; OpenRouter, OpenAI, Anthropic, claude-local providers.
|
|
331
|
+
* **v0.3** Per-hub branding, auth-on path, native-venv production
|
|
332
|
+
deployment docs, Playwright UI test tier.
|
|
333
|
+
* **v0.4** Background and scheduled workflows via WaveAssist Cloud
|
|
334
|
+
(separate product, opt-in).
|
|
335
|
+
* **Later** Slack and Telegram chat surfaces. Mem0 / Zep memory backends.
|
|
336
|
+
|
|
337
|
+
Non-goals: voice and realtime, visual agent builder.
|
|
338
|
+
|
|
339
|
+
## Hubzoid as a service
|
|
340
|
+
|
|
341
|
+
This is the open-source framework. [hubzoid.com](https://hubzoid.com) is
|
|
342
|
+
the consulting practice that deploys role-scoped hubs for mid-enterprise
|
|
343
|
+
organizations in six weeks, fixed scope, fixed price. The framework is
|
|
344
|
+
the substrate; the practice ships the deployment.
|
|
345
|
+
|
|
346
|
+
## Contributing
|
|
347
|
+
|
|
348
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Issues and PRs welcome.
|
|
349
|
+
|
|
350
|
+
## License
|
|
351
|
+
|
|
352
|
+
MIT.
|
hubzoid-0.2.2/README.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/mark-dark.svg">
|
|
4
|
+
<img alt="/hubzoid" src="assets/mark-light.svg" width="220">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<strong>Drop a folder of markdown files. Get a chat agent with a polished web UI.</strong>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://pypi.org/project/hubzoid/"><img src="https://img.shields.io/pypi/v/hubzoid.svg?color=E5572A&label=pypi" alt="PyPI"></a>
|
|
14
|
+
<a href="https://pypi.org/project/hubzoid/"><img src="https://img.shields.io/pypi/pyversions/hubzoid.svg?color=0B0B0C" alt="Python"></a>
|
|
15
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0B0B0C.svg" alt="MIT License"></a>
|
|
16
|
+
<a href="https://hubzoid.com"><img src="https://img.shields.io/badge/website-hubzoid.com-E5572A.svg" alt="hubzoid.com"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
hubzoid reads `AGENTS.md`, `agents/`, `skills/`, and `knowledge/` from a folder
|
|
22
|
+
and turns it into a running AI agent. Backed by the [OpenAI Agents
|
|
23
|
+
SDK](https://openai.github.io/openai-agents-python/) or the [Claude Agent
|
|
24
|
+
SDK](https://code.claude.com/docs/en/agent-sdk/overview), served over an
|
|
25
|
+
OpenAI-compatible HTTP API, and chattable through a bundled
|
|
26
|
+
[Open WebUI](https://openwebui.com) front end.
|
|
27
|
+
|
|
28
|
+
You write the markdown. hubzoid handles the runtime, the API, the UI, the
|
|
29
|
+
streaming, and the sub-agent routing. Provider-agnostic via
|
|
30
|
+
[LiteLLM](https://docs.litellm.ai): OpenRouter, OpenAI, Anthropic, and local
|
|
31
|
+
Claude work out of the box.
|
|
32
|
+
|
|
33
|
+
## Quickstart
|
|
34
|
+
|
|
35
|
+
**3 steps if you have `claude` CLI installed and logged in, 4 otherwise.**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install hubzoid
|
|
39
|
+
hubzoid init demo-hub # scaffolds a starter hub + agents-repo wrapper
|
|
40
|
+
* edit demo-hub/.env # ← optional. skip if using claude-local.
|
|
41
|
+
hubzoid run demo-hub
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Open <http://localhost:3080>. The scaffolded `demo-hub` is a working **Hubzoid
|
|
45
|
+
Guide** agent.
|
|
46
|
+
|
|
47
|
+
**\* Step 3 (the optional one).** Default `MODEL=claude-local` uses your
|
|
48
|
+
installed `claude` CLI subscription. If you already ran `claude login`,
|
|
49
|
+
skip this step and go straight to `hubzoid run`. Otherwise, open
|
|
50
|
+
`demo-hub/.env`, comment out the `MODEL=claude-local` line, and uncomment
|
|
51
|
+
one of the provider stanzas (OpenRouter, OpenAI, Anthropic) with your key
|
|
52
|
+
pasted in.
|
|
53
|
+
|
|
54
|
+
The two files you edit later as you customize:
|
|
55
|
+
|
|
56
|
+
1. `demo-hub/.env`: keys, model selection, UI knobs.
|
|
57
|
+
2. `demo-hub/AGENTS.md`: the system prompt body. YAML frontmatter sets
|
|
58
|
+
`name`, `description`, and optional `model`.
|
|
59
|
+
|
|
60
|
+
## How it works
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
┌─────────────────────────────┐
|
|
64
|
+
│ Open WebUI │ http://localhost:3080
|
|
65
|
+
│ (web chat, white-label) │
|
|
66
|
+
└──────────────┬──────────────┘
|
|
67
|
+
│ OpenAI-compatible HTTP
|
|
68
|
+
┌──────────────┴──────────────┐
|
|
69
|
+
│ FastAPI bridge │ /v1/chat/completions /v1/models
|
|
70
|
+
└──────────────┬──────────────┘
|
|
71
|
+
│ in-process
|
|
72
|
+
┌──────────────┴──────────────┐
|
|
73
|
+
│ Agent runtime │ OpenAI Agents SDK | Claude Agent SDK
|
|
74
|
+
└──────────────┬──────────────┘
|
|
75
|
+
│ LiteLLM (or claude CLI subprocess)
|
|
76
|
+
┌──────────────┴──────────────┐
|
|
77
|
+
│ Your model │ OpenRouter · OpenAI · Anthropic · claude-local
|
|
78
|
+
└─────────────────────────────┘
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
One install command. Open WebUI, the Claude Agent SDK, the OpenAI Agents
|
|
82
|
+
SDK, LiteLLM, and FastAPI are all bundled as required dependencies. No
|
|
83
|
+
optional extras for the runtime.
|
|
84
|
+
|
|
85
|
+
## A minimal AGENTS.md
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
---
|
|
89
|
+
name: code-reviewer
|
|
90
|
+
description: Reviews a code diff. Ranks the top three issues by severity.
|
|
91
|
+
model: openrouter/anthropic/claude-haiku-4.5
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
You review code. When the user pastes a diff or a file, identify the top
|
|
95
|
+
three issues ranked by severity: correctness first, then security, then
|
|
96
|
+
readability.
|
|
97
|
+
|
|
98
|
+
For each issue, cite the line number and explain the fix in one sentence.
|
|
99
|
+
Skip style nits unless the user asks for them. If the code looks clean,
|
|
100
|
+
say so in one line and stop.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
That is the whole hub. One file. No sub-agents, no skills, no knowledge
|
|
104
|
+
needed. Drop it in a folder, run `hubzoid run .`, and you have a code
|
|
105
|
+
reviewer at <http://localhost:3080>.
|
|
106
|
+
|
|
107
|
+
## Editing your hub
|
|
108
|
+
|
|
109
|
+
Your hub is one folder. Six things to know.
|
|
110
|
+
|
|
111
|
+
1. **Pick your model.** Default `.env` uses `MODEL=claude-local` (no key
|
|
112
|
+
needed if `claude login` is done). To switch to OpenRouter / OpenAI /
|
|
113
|
+
Anthropic, uncomment a stanza in `.env` and paste a key.
|
|
114
|
+
2. **Write the main agent.** Open `AGENTS.md`. The body is the system
|
|
115
|
+
prompt. YAML frontmatter sets `name`, `description`, and optional
|
|
116
|
+
`model`.
|
|
117
|
+
3. **Sub-agents.** One folder per sub-agent under `agents/`. Each has its
|
|
118
|
+
own `AGENTS.md`. Frontmatter `tools: [...]` whitelists which tools the
|
|
119
|
+
sub-agent may call.
|
|
120
|
+
4. **Skills.** One folder per playbook under `skills/`, each with a
|
|
121
|
+
`SKILL.md`. The main agent loads them on demand via `load_skill(name)`.
|
|
122
|
+
5. **Knowledge.** One markdown file per topic under `knowledge/`. Reached
|
|
123
|
+
via `read_knowledge(name)`.
|
|
124
|
+
6. **Tools and connectors.** Drop Python files with `@function_tool` in
|
|
125
|
+
`tools_local/`. Edit `connectors/.mcp.json` to plug in
|
|
126
|
+
[MCP](https://modelcontextprotocol.io) servers.
|
|
127
|
+
|
|
128
|
+
Folder names are case- and plural-flexible. `skills/`, `Skills/`, and
|
|
129
|
+
`skill/` all work. Same for `agents/`, `knowledge/`, `tools_local/`,
|
|
130
|
+
`connectors/`. Restart with the same command. Changes are picked up on
|
|
131
|
+
the next start.
|
|
132
|
+
|
|
133
|
+
## Multi-hub agents repo
|
|
134
|
+
|
|
135
|
+
Run `hubzoid init` more than once in the same directory and you get a
|
|
136
|
+
Samarth-style multi-hub layout with one parent `requirements.txt`:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
mkdir my-agents && cd my-agents
|
|
140
|
+
hubzoid init devops-agent # creates ./devops-agent + ./requirements.txt + ./.gitignore + ./README.md
|
|
141
|
+
hubzoid init support-agent # creates ./support-agent only; parent files left alone
|
|
142
|
+
hubzoid init research-agent # creates ./research-agent only
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Each hub is independent: its own `.env`, its own port, its own user
|
|
146
|
+
database. The parent files are written **only** on the first init in a
|
|
147
|
+
fresh directory (empty or containing only dotfiles / README /
|
|
148
|
+
requirements.txt / LICENSE). Idempotent and non-destructive afterward.
|
|
149
|
+
|
|
150
|
+
## Providers
|
|
151
|
+
|
|
152
|
+
Pick one stanza in `.env`. See [docs/providers.md](docs/providers.md) for
|
|
153
|
+
more detail.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# OpenRouter (one key, many models)
|
|
157
|
+
OPENROUTER_API_KEY=sk-or-v1-...
|
|
158
|
+
MODEL=openrouter/anthropic/claude-haiku-4.5
|
|
159
|
+
|
|
160
|
+
# OR OpenAI
|
|
161
|
+
OPENAI_API_KEY=sk-...
|
|
162
|
+
MODEL=openai/gpt-4o-mini
|
|
163
|
+
|
|
164
|
+
# OR Anthropic
|
|
165
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
166
|
+
MODEL=anthropic/claude-haiku-4-5
|
|
167
|
+
|
|
168
|
+
# OR Claude local (uses your installed `claude` CLI + Pro/Max subscription)
|
|
169
|
+
# Requires `claude login` first. No API key needed.
|
|
170
|
+
MODEL=claude-local
|
|
171
|
+
# MODEL=claude-local/sonnet # pin Sonnet
|
|
172
|
+
# MODEL=claude-local/opus # pin Opus
|
|
173
|
+
# MODEL=claude-local/haiku # pin Haiku
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The `MODEL` string tells LiteLLM which provider to call, and the matching
|
|
177
|
+
key must be set. The exception is `MODEL=claude-local`: instead of
|
|
178
|
+
LiteLLM, hubzoid drives the Claude Agent SDK against your locally
|
|
179
|
+
installed `claude` CLI, so auth and billing flow through your existing
|
|
180
|
+
Pro/Max subscription. Same hub folder, same tools, same skills. Only the
|
|
181
|
+
LLM and auth path differ.
|
|
182
|
+
|
|
183
|
+
## Pre-shipped tools
|
|
184
|
+
|
|
185
|
+
Every hub gets these tools for free.
|
|
186
|
+
|
|
187
|
+
| Tool | What it does |
|
|
188
|
+
|---|---|
|
|
189
|
+
| `read_file(path)` | Read a file under the hub directory. |
|
|
190
|
+
| `list_files(glob)` | List files matching a glob. |
|
|
191
|
+
| `write_artifact(filename, content)` | Write a file under `output/<session>/`. |
|
|
192
|
+
| `list_skills()` | Menu of skills in the hub. |
|
|
193
|
+
| `load_skill(name)` | Read a skill's full body on demand. |
|
|
194
|
+
| `list_knowledge()` | Menu of knowledge documents. |
|
|
195
|
+
| `read_knowledge(name)` | Read a knowledge document's full body. |
|
|
196
|
+
| `remember(fact, scope)` | Save a fact to durable memory. |
|
|
197
|
+
| `recall(query, scope)` | Look up saved facts. |
|
|
198
|
+
| `forget(id, scope)` | Delete a saved fact. |
|
|
199
|
+
| `render_jinja(template, context_json)` | Render a Jinja2 template. |
|
|
200
|
+
| `http_get(url)` | Fetch a URL (honors `HTTP_ALLOWLIST`). |
|
|
201
|
+
| `web_search(query)` | DuckDuckGo search. No API key. |
|
|
202
|
+
|
|
203
|
+
Custom tools dropped into `tools_local/*.py` are auto-discovered.
|
|
204
|
+
|
|
205
|
+
## MCP connectors
|
|
206
|
+
|
|
207
|
+
MCP connectors are **per-hub**. Each hub has its own
|
|
208
|
+
`<hub>/connectors/.mcp.json` alongside its `AGENTS.md`. Two hubs in the
|
|
209
|
+
same agents-repo connect to completely different MCP servers because each
|
|
210
|
+
loads its own config independently. There is no parent-level shared MCP
|
|
211
|
+
file by design: agents are independent products with their own scope.
|
|
212
|
+
|
|
213
|
+
Edit `demo-hub/connectors/.mcp.json` (or whatever your hub is named):
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"mcpServers": {
|
|
218
|
+
"filesystem": {
|
|
219
|
+
"command": "npx",
|
|
220
|
+
"args": ["@modelcontextprotocol/server-filesystem", "./workspace"]
|
|
221
|
+
},
|
|
222
|
+
"github": {
|
|
223
|
+
"command": "npx",
|
|
224
|
+
"args": ["@modelcontextprotocol/server-github"],
|
|
225
|
+
"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "${GH_TOKEN}"}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
`${VAR}` references in any string field resolve against the environment at
|
|
232
|
+
boot. The same `.mcp.json` is honored by both the OpenAI Agents and
|
|
233
|
+
Claude Agent runtimes.
|
|
234
|
+
|
|
235
|
+
## CLI
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
hubzoid init [NAME] Scaffold a new hub folder under the current directory.
|
|
239
|
+
NAME defaults to "demo-hub".
|
|
240
|
+
Also drops requirements.txt / .gitignore / README.md
|
|
241
|
+
at the parent on first run if the directory looks fresh.
|
|
242
|
+
hubzoid run [PATH] Start the FastAPI bridge plus Open WebUI for a hub.
|
|
243
|
+
--port INT Open WebUI port (default 3080).
|
|
244
|
+
--bridge-port INT FastAPI bridge port (default 8000).
|
|
245
|
+
--no-ui Bridge only, no Open WebUI.
|
|
246
|
+
hubzoid doctor [PATH] Validate hub config and report issues.
|
|
247
|
+
hubzoid test [PATH] Send one prompt to the agent and print the response.
|
|
248
|
+
hubzoid version
|
|
249
|
+
hubzoid --help
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
PATH defaults to `.` for run / doctor / test. `python -m hubzoid ...` also
|
|
253
|
+
works as an alternative invocation.
|
|
254
|
+
|
|
255
|
+
## Run from source
|
|
256
|
+
|
|
257
|
+
For contributors or anyone who wants to read or extend the framework code.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
git clone https://github.com/hubzoid/hubzoid.git
|
|
261
|
+
cd hubzoid
|
|
262
|
+
python -m venv .venv && source .venv/bin/activate
|
|
263
|
+
pip install -e '.[dev]'
|
|
264
|
+
hubzoid run demo-hub
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
The repo ships with `demo-hub/` at the root as a working starter. Its
|
|
268
|
+
`.env` is git-ignored but the template includes sensible defaults
|
|
269
|
+
(`MODEL=claude-local`).
|
|
270
|
+
|
|
271
|
+
## Open standards
|
|
272
|
+
|
|
273
|
+
| Spec | Used at |
|
|
274
|
+
|---|---|
|
|
275
|
+
| [AGENTS.md](https://agents.md) | `<hub>/AGENTS.md`, `<hub>/agents/<n>/AGENTS.md` |
|
|
276
|
+
| SKILL.md | `<hub>/skills/<n>/SKILL.md` |
|
|
277
|
+
| [MCP](https://modelcontextprotocol.io) | `<hub>/connectors/.mcp.json` |
|
|
278
|
+
|
|
279
|
+
Hubs are portable across any tool that adopts these specs (Claude Code,
|
|
280
|
+
Cursor, Codex, Copilot, Gemini CLI, VS Code).
|
|
281
|
+
|
|
282
|
+
## Roadmap
|
|
283
|
+
|
|
284
|
+
* **v0.2** Current. PyPI release with bundled Open WebUI + Claude Agent
|
|
285
|
+
SDK; OpenAI Agents and Claude Agent runtimes; AGENTS.md, SKILL.md, MCP
|
|
286
|
+
loaders; OpenRouter, OpenAI, Anthropic, claude-local providers.
|
|
287
|
+
* **v0.3** Per-hub branding, auth-on path, native-venv production
|
|
288
|
+
deployment docs, Playwright UI test tier.
|
|
289
|
+
* **v0.4** Background and scheduled workflows via WaveAssist Cloud
|
|
290
|
+
(separate product, opt-in).
|
|
291
|
+
* **Later** Slack and Telegram chat surfaces. Mem0 / Zep memory backends.
|
|
292
|
+
|
|
293
|
+
Non-goals: voice and realtime, visual agent builder.
|
|
294
|
+
|
|
295
|
+
## Hubzoid as a service
|
|
296
|
+
|
|
297
|
+
This is the open-source framework. [hubzoid.com](https://hubzoid.com) is
|
|
298
|
+
the consulting practice that deploys role-scoped hubs for mid-enterprise
|
|
299
|
+
organizations in six weeks, fixed scope, fixed price. The framework is
|
|
300
|
+
the substrate; the practice ships the deployment.
|
|
301
|
+
|
|
302
|
+
## Contributing
|
|
303
|
+
|
|
304
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Issues and PRs welcome.
|
|
305
|
+
|
|
306
|
+
## License
|
|
307
|
+
|
|
308
|
+
MIT.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""HubZoid — markdown-driven AI agent platform.
|
|
2
|
+
|
|
3
|
+
Drop AGENTS.md + skills/ + knowledge/ into a folder, get a working chat agent
|
|
4
|
+
with a polished web UI. See README.md.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
__version__ = "0.2.2"
|
|
9
|
+
|
|
10
|
+
from .factory import build_agent # noqa: E402,F401 (public re-export)
|