pythonclaw 0.2.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.
Files changed (122) hide show
  1. pythonclaw-0.2.0/LICENSE +21 -0
  2. pythonclaw-0.2.0/PKG-INFO +410 -0
  3. pythonclaw-0.2.0/README.md +347 -0
  4. pythonclaw-0.2.0/pyproject.toml +88 -0
  5. pythonclaw-0.2.0/pythonclaw/__init__.py +17 -0
  6. pythonclaw-0.2.0/pythonclaw/__main__.py +6 -0
  7. pythonclaw-0.2.0/pythonclaw/channels/discord_bot.py +231 -0
  8. pythonclaw-0.2.0/pythonclaw/channels/telegram_bot.py +236 -0
  9. pythonclaw-0.2.0/pythonclaw/config.py +190 -0
  10. pythonclaw-0.2.0/pythonclaw/core/__init__.py +25 -0
  11. pythonclaw-0.2.0/pythonclaw/core/agent.py +773 -0
  12. pythonclaw-0.2.0/pythonclaw/core/compaction.py +220 -0
  13. pythonclaw-0.2.0/pythonclaw/core/knowledge/rag.py +93 -0
  14. pythonclaw-0.2.0/pythonclaw/core/llm/anthropic_client.py +107 -0
  15. pythonclaw-0.2.0/pythonclaw/core/llm/base.py +26 -0
  16. pythonclaw-0.2.0/pythonclaw/core/llm/gemini_client.py +139 -0
  17. pythonclaw-0.2.0/pythonclaw/core/llm/openai_compatible.py +39 -0
  18. pythonclaw-0.2.0/pythonclaw/core/llm/response.py +57 -0
  19. pythonclaw-0.2.0/pythonclaw/core/memory/manager.py +120 -0
  20. pythonclaw-0.2.0/pythonclaw/core/memory/storage.py +164 -0
  21. pythonclaw-0.2.0/pythonclaw/core/persistent_agent.py +103 -0
  22. pythonclaw-0.2.0/pythonclaw/core/retrieval/__init__.py +6 -0
  23. pythonclaw-0.2.0/pythonclaw/core/retrieval/chunker.py +78 -0
  24. pythonclaw-0.2.0/pythonclaw/core/retrieval/dense.py +152 -0
  25. pythonclaw-0.2.0/pythonclaw/core/retrieval/fusion.py +51 -0
  26. pythonclaw-0.2.0/pythonclaw/core/retrieval/reranker.py +112 -0
  27. pythonclaw-0.2.0/pythonclaw/core/retrieval/retriever.py +166 -0
  28. pythonclaw-0.2.0/pythonclaw/core/retrieval/sparse.py +69 -0
  29. pythonclaw-0.2.0/pythonclaw/core/session_store.py +269 -0
  30. pythonclaw-0.2.0/pythonclaw/core/skill_loader.py +322 -0
  31. pythonclaw-0.2.0/pythonclaw/core/skillhub.py +290 -0
  32. pythonclaw-0.2.0/pythonclaw/core/tools.py +622 -0
  33. pythonclaw-0.2.0/pythonclaw/core/utils.py +64 -0
  34. pythonclaw-0.2.0/pythonclaw/daemon.py +221 -0
  35. pythonclaw-0.2.0/pythonclaw/init.py +61 -0
  36. pythonclaw-0.2.0/pythonclaw/main.py +489 -0
  37. pythonclaw-0.2.0/pythonclaw/onboard.py +290 -0
  38. pythonclaw-0.2.0/pythonclaw/scheduler/cron.py +310 -0
  39. pythonclaw-0.2.0/pythonclaw/scheduler/heartbeat.py +178 -0
  40. pythonclaw-0.2.0/pythonclaw/server.py +145 -0
  41. pythonclaw-0.2.0/pythonclaw/session_manager.py +104 -0
  42. pythonclaw-0.2.0/pythonclaw/templates/persona/demo_persona.md +2 -0
  43. pythonclaw-0.2.0/pythonclaw/templates/skills/communication/CATEGORY.md +4 -0
  44. pythonclaw-0.2.0/pythonclaw/templates/skills/communication/email/SKILL.md +54 -0
  45. pythonclaw-0.2.0/pythonclaw/templates/skills/communication/email/__pycache__/send_email.cpython-311.pyc +0 -0
  46. pythonclaw-0.2.0/pythonclaw/templates/skills/communication/email/send_email.py +88 -0
  47. pythonclaw-0.2.0/pythonclaw/templates/skills/data/CATEGORY.md +4 -0
  48. pythonclaw-0.2.0/pythonclaw/templates/skills/data/csv_analyzer/SKILL.md +51 -0
  49. pythonclaw-0.2.0/pythonclaw/templates/skills/data/csv_analyzer/__pycache__/analyze.cpython-311.pyc +0 -0
  50. pythonclaw-0.2.0/pythonclaw/templates/skills/data/csv_analyzer/analyze.py +138 -0
  51. pythonclaw-0.2.0/pythonclaw/templates/skills/data/finance/SKILL.md +41 -0
  52. pythonclaw-0.2.0/pythonclaw/templates/skills/data/finance/__pycache__/fetch_quote.cpython-311.pyc +0 -0
  53. pythonclaw-0.2.0/pythonclaw/templates/skills/data/finance/fetch_quote.py +118 -0
  54. pythonclaw-0.2.0/pythonclaw/templates/skills/data/news/SKILL.md +39 -0
  55. pythonclaw-0.2.0/pythonclaw/templates/skills/data/news/__pycache__/search_news.cpython-311.pyc +0 -0
  56. pythonclaw-0.2.0/pythonclaw/templates/skills/data/news/search_news.py +57 -0
  57. pythonclaw-0.2.0/pythonclaw/templates/skills/data/pdf_reader/SKILL.md +40 -0
  58. pythonclaw-0.2.0/pythonclaw/templates/skills/data/pdf_reader/__pycache__/read_pdf.cpython-311.pyc +0 -0
  59. pythonclaw-0.2.0/pythonclaw/templates/skills/data/pdf_reader/read_pdf.py +113 -0
  60. pythonclaw-0.2.0/pythonclaw/templates/skills/data/scraper/SKILL.md +39 -0
  61. pythonclaw-0.2.0/pythonclaw/templates/skills/data/scraper/__pycache__/scrape.cpython-311.pyc +0 -0
  62. pythonclaw-0.2.0/pythonclaw/templates/skills/data/scraper/scrape.py +92 -0
  63. pythonclaw-0.2.0/pythonclaw/templates/skills/data/weather/SKILL.md +42 -0
  64. pythonclaw-0.2.0/pythonclaw/templates/skills/data/weather/__pycache__/weather.cpython-311.pyc +0 -0
  65. pythonclaw-0.2.0/pythonclaw/templates/skills/data/weather/weather.py +142 -0
  66. pythonclaw-0.2.0/pythonclaw/templates/skills/data/youtube/SKILL.md +43 -0
  67. pythonclaw-0.2.0/pythonclaw/templates/skills/data/youtube/__pycache__/youtube_info.cpython-311.pyc +0 -0
  68. pythonclaw-0.2.0/pythonclaw/templates/skills/data/youtube/youtube_info.py +167 -0
  69. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/CATEGORY.md +4 -0
  70. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/code_runner/SKILL.md +46 -0
  71. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/code_runner/__pycache__/run_code.cpython-311.pyc +0 -0
  72. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/code_runner/run_code.py +117 -0
  73. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/github/SKILL.md +52 -0
  74. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/github/__pycache__/gh.cpython-311.pyc +0 -0
  75. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/github/gh.py +165 -0
  76. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/http_request/SKILL.md +40 -0
  77. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/http_request/__pycache__/request.cpython-311.pyc +0 -0
  78. pythonclaw-0.2.0/pythonclaw/templates/skills/dev/http_request/request.py +90 -0
  79. pythonclaw-0.2.0/pythonclaw/templates/skills/google/CATEGORY.md +4 -0
  80. pythonclaw-0.2.0/pythonclaw/templates/skills/google/workspace/SKILL.md +98 -0
  81. pythonclaw-0.2.0/pythonclaw/templates/skills/google/workspace/check_setup.sh +52 -0
  82. pythonclaw-0.2.0/pythonclaw/templates/skills/meta/CATEGORY.md +4 -0
  83. pythonclaw-0.2.0/pythonclaw/templates/skills/meta/skill_creator/SKILL.md +151 -0
  84. pythonclaw-0.2.0/pythonclaw/templates/skills/system/CATEGORY.md +4 -0
  85. pythonclaw-0.2.0/pythonclaw/templates/skills/system/change_persona/SKILL.md +41 -0
  86. pythonclaw-0.2.0/pythonclaw/templates/skills/system/change_setting/SKILL.md +65 -0
  87. pythonclaw-0.2.0/pythonclaw/templates/skills/system/change_setting/__pycache__/update_config.cpython-311.pyc +0 -0
  88. pythonclaw-0.2.0/pythonclaw/templates/skills/system/change_setting/update_config.py +129 -0
  89. pythonclaw-0.2.0/pythonclaw/templates/skills/system/change_soul/SKILL.md +41 -0
  90. pythonclaw-0.2.0/pythonclaw/templates/skills/system/onboarding/SKILL.md +63 -0
  91. pythonclaw-0.2.0/pythonclaw/templates/skills/system/onboarding/__pycache__/write_identity.cpython-311.pyc +0 -0
  92. pythonclaw-0.2.0/pythonclaw/templates/skills/system/onboarding/write_identity.py +218 -0
  93. pythonclaw-0.2.0/pythonclaw/templates/skills/system/random/SKILL.md +33 -0
  94. pythonclaw-0.2.0/pythonclaw/templates/skills/system/random/__pycache__/random_util.cpython-311.pyc +0 -0
  95. pythonclaw-0.2.0/pythonclaw/templates/skills/system/random/random_util.py +45 -0
  96. pythonclaw-0.2.0/pythonclaw/templates/skills/system/time/SKILL.md +33 -0
  97. pythonclaw-0.2.0/pythonclaw/templates/skills/system/time/__pycache__/time_util.cpython-311.pyc +0 -0
  98. pythonclaw-0.2.0/pythonclaw/templates/skills/system/time/time_util.py +81 -0
  99. pythonclaw-0.2.0/pythonclaw/templates/skills/text/CATEGORY.md +4 -0
  100. pythonclaw-0.2.0/pythonclaw/templates/skills/text/translator/SKILL.md +47 -0
  101. pythonclaw-0.2.0/pythonclaw/templates/skills/text/translator/__pycache__/translate.cpython-311.pyc +0 -0
  102. pythonclaw-0.2.0/pythonclaw/templates/skills/text/translator/translate.py +66 -0
  103. pythonclaw-0.2.0/pythonclaw/templates/skills/web/CATEGORY.md +4 -0
  104. pythonclaw-0.2.0/pythonclaw/templates/skills/web/tavily/SKILL.md +61 -0
  105. pythonclaw-0.2.0/pythonclaw/templates/soul/SOUL.md +54 -0
  106. pythonclaw-0.2.0/pythonclaw/web/__init__.py +1 -0
  107. pythonclaw-0.2.0/pythonclaw/web/app.py +585 -0
  108. pythonclaw-0.2.0/pythonclaw/web/static/favicon.png +0 -0
  109. pythonclaw-0.2.0/pythonclaw/web/static/index.html +1318 -0
  110. pythonclaw-0.2.0/pythonclaw/web/static/logo.png +0 -0
  111. pythonclaw-0.2.0/pythonclaw.egg-info/PKG-INFO +410 -0
  112. pythonclaw-0.2.0/pythonclaw.egg-info/SOURCES.txt +120 -0
  113. pythonclaw-0.2.0/pythonclaw.egg-info/dependency_links.txt +1 -0
  114. pythonclaw-0.2.0/pythonclaw.egg-info/entry_points.txt +2 -0
  115. pythonclaw-0.2.0/pythonclaw.egg-info/requires.txt +45 -0
  116. pythonclaw-0.2.0/pythonclaw.egg-info/top_level.txt +1 -0
  117. pythonclaw-0.2.0/setup.cfg +4 -0
  118. pythonclaw-0.2.0/tests/test_compaction.py +331 -0
  119. pythonclaw-0.2.0/tests/test_persistence.py +297 -0
  120. pythonclaw-0.2.0/tests/test_rag_hybrid.py +400 -0
  121. pythonclaw-0.2.0/tests/test_skills.py +247 -0
  122. pythonclaw-0.2.0/tests/test_soul.py +435 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric Wang
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,410 @@
1
+ Metadata-Version: 2.4
2
+ Name: pythonclaw
3
+ Version: 0.2.0
4
+ Summary: OpenClaw reimagined in pure Python — autonomous AI agent with memory, RAG, skills, web dashboard, and multi-channel support.
5
+ Author-email: Eric Wang <wangchen2007915@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ericwang915/PythonClaw
8
+ Project-URL: Documentation, https://github.com/ericwang915/PythonClaw#readme
9
+ Project-URL: Repository, https://github.com/ericwang915/PythonClaw
10
+ Project-URL: Issues, https://github.com/ericwang915/PythonClaw/issues
11
+ Keywords: llm,agent,ai,autonomous,memory,rag,skills,telegram,chatbot,framework
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: openai
26
+ Provides-Extra: all
27
+ Requires-Dist: anthropic; extra == "all"
28
+ Requires-Dist: google-generativeai; extra == "all"
29
+ Requires-Dist: python-telegram-bot[job-queue]>=20.0; extra == "all"
30
+ Requires-Dist: discord.py>=2.3; extra == "all"
31
+ Requires-Dist: apscheduler>=3.10; extra == "all"
32
+ Requires-Dist: pyyaml>=6.0; extra == "all"
33
+ Requires-Dist: rank-bm25>=0.2; extra == "all"
34
+ Requires-Dist: numpy>=1.24; extra == "all"
35
+ Requires-Dist: scikit-learn>=1.3; extra == "all"
36
+ Requires-Dist: tavily-python; extra == "all"
37
+ Requires-Dist: fastapi>=0.100; extra == "all"
38
+ Requires-Dist: uvicorn[standard]>=0.20; extra == "all"
39
+ Requires-Dist: beautifulsoup4; extra == "all"
40
+ Requires-Dist: requests; extra == "all"
41
+ Provides-Extra: anthropic
42
+ Requires-Dist: anthropic; extra == "anthropic"
43
+ Provides-Extra: gemini
44
+ Requires-Dist: google-generativeai; extra == "gemini"
45
+ Provides-Extra: tavily
46
+ Requires-Dist: tavily-python; extra == "tavily"
47
+ Provides-Extra: web
48
+ Requires-Dist: fastapi>=0.100; extra == "web"
49
+ Requires-Dist: uvicorn[standard]>=0.20; extra == "web"
50
+ Provides-Extra: telegram
51
+ Requires-Dist: python-telegram-bot[job-queue]>=20.0; extra == "telegram"
52
+ Requires-Dist: apscheduler>=3.10; extra == "telegram"
53
+ Requires-Dist: pyyaml>=6.0; extra == "telegram"
54
+ Provides-Extra: discord
55
+ Requires-Dist: discord.py>=2.3; extra == "discord"
56
+ Requires-Dist: apscheduler>=3.10; extra == "discord"
57
+ Requires-Dist: pyyaml>=6.0; extra == "discord"
58
+ Provides-Extra: rag
59
+ Requires-Dist: rank-bm25>=0.2; extra == "rag"
60
+ Requires-Dist: numpy>=1.24; extra == "rag"
61
+ Requires-Dist: scikit-learn>=1.3; extra == "rag"
62
+ Dynamic: license-file
63
+
64
+ <p align="center">
65
+ <img src="assets/logo-300.png" alt="PythonClaw" width="160">
66
+ </p>
67
+
68
+ <h1 align="center">PythonClaw</h1>
69
+
70
+ <p align="center">
71
+ <strong>OpenClaw, reimagined in pure Python — purely Pythonic design.</strong><br>
72
+ Memory · RAG · Skills · Web Dashboard · Voice · Daemon · Multi-Channel
73
+ </p>
74
+
75
+ <p align="center">
76
+ <a href="https://github.com/ericwang915/PythonClaw/actions/workflows/ci.yml">
77
+ <img src="https://github.com/ericwang915/PythonClaw/actions/workflows/ci.yml/badge.svg" alt="CI">
78
+ </a>
79
+ <img src="https://img.shields.io/badge/python-3.10+-blue?logo=python&logoColor=white" alt="Python 3.10+">
80
+ <a href="LICENSE">
81
+ <img src="https://img.shields.io/github/license/ericwang915/PythonClaw" alt="MIT License">
82
+ </a>
83
+ <a href="https://github.com/ericwang915/PythonClaw/stargazers">
84
+ <img src="https://img.shields.io/github/stars/ericwang915/PythonClaw?style=social" alt="Stars">
85
+ </a>
86
+ </p>
87
+
88
+ <p align="center">
89
+ <em>The Python port of <a href="https://github.com/openclaw/openclaw">OpenClaw</a> — no Node.js, no Rust, no C extensions. Just Python.</em>
90
+ </p>
91
+
92
+ ---
93
+
94
+ ## Highlights
95
+
96
+ | | Feature | Details |
97
+ |---|---------|---------|
98
+ | 🧠 | **Provider-agnostic** | DeepSeek, Grok, Claude, Gemini, Kimi, GLM — or any OpenAI-compatible API |
99
+ | 🛠️ | **Three-tier skills** | Progressive loading: metadata → instructions → resources. Community marketplace via [SkillHub](https://www.skillhub.club) |
100
+ | 💾 | **Persistent memory** | Markdown-based long-term memory with daily logs and semantic recall |
101
+ | 🔍 | **Hybrid RAG** | BM25 + dense embeddings + RRF fusion + LLM re-ranking |
102
+ | 🌐 | **Web dashboard** | Browser UI for chat, config, skill catalog, identity editing, and marketplace |
103
+ | 🎙️ | **Voice input** | Deepgram speech-to-text in the web chat |
104
+ | ⏰ | **Cron jobs** | Schedule tasks via YAML or let the agent create its own |
105
+ | 📡 | **Multi-channel** | CLI, Web, Telegram, Discord — same agent, different interfaces |
106
+ | 🔄 | **Daemon mode** | PID-managed background process with `start` / `stop` / `status` |
107
+ | 🧬 | **Soul + Persona** | Separate core identity from swappable role presentation |
108
+
109
+ ---
110
+
111
+ ## Quick Start
112
+
113
+ ```bash
114
+ pip install pythonclaw
115
+
116
+ # First-time setup — choose your LLM provider and enter API key
117
+ pythonclaw onboard
118
+
119
+ # Start the agent daemon (web dashboard at http://localhost:7788)
120
+ pythonclaw start
121
+
122
+ # Interactive CLI chat
123
+ pythonclaw chat
124
+
125
+ # Stop the daemon
126
+ pythonclaw stop
127
+ ```
128
+
129
+ **From source:**
130
+
131
+ ```bash
132
+ git clone https://github.com/ericwang915/PythonClaw.git
133
+ cd PythonClaw
134
+ pip install -e ".[all]"
135
+ pythonclaw onboard
136
+ ```
137
+
138
+ ---
139
+
140
+ ## CLI Reference
141
+
142
+ | Command | Description |
143
+ |---------|-------------|
144
+ | `pythonclaw onboard` | Interactive setup wizard — choose LLM provider, enter API key |
145
+ | `pythonclaw start` | Start the agent as a background daemon |
146
+ | `pythonclaw start -f` | Start in foreground (no daemonize) |
147
+ | `pythonclaw start --channels telegram discord` | Start with messaging channels |
148
+ | `pythonclaw stop` | Stop the running daemon |
149
+ | `pythonclaw status` | Show daemon status (PID, uptime, port) |
150
+ | `pythonclaw chat` | Interactive CLI chat (foreground REPL) |
151
+ | `pythonclaw skill search <query>` | Search skills on [SkillHub](https://www.skillhub.club) |
152
+ | `pythonclaw skill browse` | Browse top-rated skills |
153
+ | `pythonclaw skill install <id>` | Install a community skill |
154
+ | `pythonclaw skill info <id>` | View skill details |
155
+
156
+ ### First Run
157
+
158
+ ```
159
+ $ pythonclaw start
160
+
161
+ ╔══════════════════════════════════════╗
162
+ ║ PythonClaw — Setup Wizard ║
163
+ ╚══════════════════════════════════════╝
164
+
165
+ Choose your LLM provider:
166
+
167
+ 1. DeepSeek
168
+ 2. Grok (xAI)
169
+ 3. Claude (Anthropic)
170
+ 4. Gemini (Google)
171
+ 5. Kimi (Moonshot)
172
+ 6. GLM (Zhipu / ChatGLM)
173
+
174
+ Enter number (1-6): 2
175
+ → Grok (xAI)
176
+
177
+ API Key: ********
178
+ → Key set (xai-****)
179
+
180
+ Validating... ✔ Valid!
181
+ ✔ Setup complete!
182
+
183
+ [PythonClaw] Daemon started (PID 12345).
184
+ [PythonClaw] Dashboard: http://localhost:7788
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Architecture
190
+
191
+ ```
192
+ ┌──────────────────────────────────────────────────────────┐
193
+ │ PythonClaw │
194
+ ├──────────┬───────────┬───────────┬───────────────────────┤
195
+ │ CLI │ Daemon │ Sessions │ Core │
196
+ │ │ │ │ │
197
+ │ onboard │ start / │ Store(MD) │ Agent │
198
+ │ chat │ stop / │ Manager │ ├─ Memory (Markdown) │
199
+ │ skill … │ status │ │ ├─ RAG (Hybrid) │
200
+ │ │ │ │ ├─ Skills (3-tier) │
201
+ │ Web UI ◄─┤ Channels │ │ ├─ Compaction │
202
+ │ Voice In │ Telegram │ │ ├─ Soul + Persona │
203
+ │ │ Discord │ │ └─ Tool Execution │
204
+ ├──────────┴───────────┴───────────┴───────────────────────┤
205
+ │ LLM Provider Abstraction Layer │
206
+ │ DeepSeek │ Grok │ Claude │ Gemini │ Kimi │ GLM │
207
+ ├──────────────────────────────────────────────────────────┤
208
+ │ SkillHub Marketplace (skillhub.club) │
209
+ └──────────────────────────────────────────────────────────┘
210
+ ```
211
+
212
+ ---
213
+
214
+ ## Web Dashboard
215
+
216
+ Start with `pythonclaw start` and open **http://localhost:7788**.
217
+
218
+ - **Dashboard** — agent status, soul/persona preview, tool list
219
+ - **Chat** — real-time chat with voice input (Deepgram)
220
+ - **Skill Catalog** — browse installed skills by category
221
+ - **Marketplace** — search and install skills from [SkillHub](https://www.skillhub.club)
222
+ - **Configuration** — edit LLM provider, API keys, and settings in-browser
223
+
224
+ ---
225
+
226
+ ## Configuration
227
+
228
+ All configuration lives in `pythonclaw.json` (auto-created by `pythonclaw onboard`).
229
+ See [`pythonclaw.example.json`](pythonclaw.example.json) for the full template.
230
+
231
+ ```jsonc
232
+ {
233
+ "llm": {
234
+ "provider": "grok",
235
+ "grok": { "apiKey": "xai-...", "model": "grok-3" }
236
+ },
237
+ "tavily": { "apiKey": "" },
238
+ "deepgram": { "apiKey": "" },
239
+ "web": { "host": "0.0.0.0", "port": 7788 },
240
+ "channels": {
241
+ "telegram": { "token": "" },
242
+ "discord": { "token": "" }
243
+ }
244
+ }
245
+ ```
246
+
247
+ Environment variables (e.g. `DEEPSEEK_API_KEY`, `TAVILY_API_KEY`) override JSON values.
248
+
249
+ ---
250
+
251
+ ## Supported LLM Providers
252
+
253
+ | Provider | Default Model | Install Extra |
254
+ |----------|---------------|---------------|
255
+ | **DeepSeek** | `deepseek-chat` | — |
256
+ | **Grok (xAI)** | `grok-3` | — |
257
+ | **Claude (Anthropic)** | `claude-sonnet-4-20250514` | `pip install pythonclaw[anthropic]` |
258
+ | **Gemini (Google)** | `gemini-2.0-flash` | `pip install pythonclaw[gemini]` |
259
+ | **Kimi (Moonshot)** | `moonshot-v1-128k` | — |
260
+ | **GLM (Zhipu)** | `glm-4-flash` | — |
261
+ | Any OpenAI-compatible | Custom | — |
262
+
263
+ ---
264
+
265
+ ## Skills
266
+
267
+ ### Three-Tier Progressive Loading
268
+
269
+ | Level | Loaded When | Content |
270
+ |-------|-------------|---------|
271
+ | **L1 — Metadata** | Always (startup) | `name` + `description` from YAML frontmatter |
272
+ | **L2 — Instructions** | Agent activates skill | Full SKILL.md body |
273
+ | **L3 — Resources** | As needed | Bundled scripts, schemas, data files |
274
+
275
+ ```yaml
276
+ ---
277
+ name: code_runner
278
+ description: Execute Python code safely in an isolated subprocess.
279
+ ---
280
+ # Code Runner
281
+
282
+ ## Instructions
283
+ Run `python {skill_path}/run_code.py "expression"`
284
+ ```
285
+
286
+ ### SkillHub Marketplace
287
+
288
+ Browse and install 22,000+ community skills from [skillhub.club](https://www.skillhub.club):
289
+
290
+ ```bash
291
+ pythonclaw skill search "database backup"
292
+ pythonclaw skill install <skill-id>
293
+ ```
294
+
295
+ Also accessible from the web dashboard **Marketplace** tab.
296
+
297
+ ---
298
+
299
+ ## Memory & RAG
300
+
301
+ ### Markdown Memory
302
+
303
+ ```
304
+ context/memory/
305
+ ├── MEMORY.md # Curated long-term memory
306
+ └── 2026-02-23.md # Daily append-only log
307
+ ```
308
+
309
+ ### Hybrid RAG Pipeline
310
+
311
+ ```
312
+ Query → BM25 (sparse) + Embeddings (dense) → RRF Fusion → LLM Re-ranker → Top-K
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Use as a Library
318
+
319
+ ```python
320
+ from pythonclaw import Agent
321
+ from pythonclaw.core.llm.openai_compatible import OpenAICompatibleProvider
322
+
323
+ provider = OpenAICompatibleProvider(
324
+ api_key="sk-...",
325
+ base_url="https://api.deepseek.com/v1",
326
+ model_name="deepseek-chat",
327
+ )
328
+
329
+ agent = Agent(provider=provider)
330
+ print(agent.chat("What is the capital of France?"))
331
+ ```
332
+
333
+ ---
334
+
335
+ ## Project Structure
336
+
337
+ ```
338
+ PythonClaw/
339
+ ├── pythonclaw/
340
+ │ ├── main.py # CLI entry (onboard/start/stop/status/chat/skill)
341
+ │ ├── onboard.py # Interactive setup wizard
342
+ │ ├── daemon.py # PID-based daemon lifecycle
343
+ │ ├── server.py # Multi-channel daemon server
344
+ │ ├── core/
345
+ │ │ ├── agent.py # Core reasoning loop
346
+ │ │ ├── tools.py # Tool schemas and execution
347
+ │ │ ├── skill_loader.py # Three-tier skill system
348
+ │ │ ├── skillhub.py # SkillHub marketplace client
349
+ │ │ ├── persistent_agent.py
350
+ │ │ ├── compaction.py # Context compaction
351
+ │ │ ├── llm/ # Provider adapters
352
+ │ │ ├── memory/ # Markdown memory
353
+ │ │ ├── knowledge/ # Knowledge-base RAG
354
+ │ │ └── retrieval/ # BM25 + dense + fusion + reranker
355
+ │ ├── channels/ # Telegram, Discord
356
+ │ ├── scheduler/ # Cron jobs, heartbeat
357
+ │ ├── web/ # FastAPI dashboard + static assets
358
+ │ └── templates/ # Built-in skill templates
359
+ ├── context/ # Runtime data (gitignored)
360
+ ├── pyproject.toml
361
+ ├── pythonclaw.example.json # Configuration template
362
+ └── LICENSE
363
+ ```
364
+
365
+ ---
366
+
367
+ ## Development
368
+
369
+ ```bash
370
+ git clone https://github.com/ericwang915/PythonClaw.git
371
+ cd PythonClaw
372
+ python -m venv .venv && source .venv/bin/activate
373
+ pip install -e ".[all]"
374
+ pytest tests/ -v
375
+ ```
376
+
377
+ ---
378
+
379
+ ## Contributing
380
+
381
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
382
+
383
+ ---
384
+
385
+ ## Comparison with OpenClaw
386
+
387
+ | Feature | OpenClaw | PythonClaw |
388
+ |---------|----------|------------|
389
+ | Language | TypeScript / Node.js | **Python** |
390
+ | Install | `npm i -g openclaw` | `pip install pythonclaw` |
391
+ | CLI | `openclaw start/stop` | `pythonclaw start/stop/status` |
392
+ | Dashboard | Web UI | Web UI (localhost:7788) |
393
+ | Memory | Markdown | Markdown (long-term + daily) |
394
+ | Skills | Plugin system | Three-tier + SkillHub marketplace |
395
+ | Channels | Discord, Telegram, WhatsApp | CLI, Web, Telegram, Discord |
396
+ | Voice | — | Deepgram STT |
397
+ | LLM Providers | OpenAI, Anthropic, Gemini | DeepSeek, Grok, Claude, Gemini, Kimi, GLM |
398
+ | Daemon | Background process | PID-managed (`start`/`stop`/`status`) |
399
+
400
+ ---
401
+
402
+ ## License
403
+
404
+ [MIT](LICENSE)
405
+
406
+ ---
407
+
408
+ <p align="center">
409
+ <sub>If PythonClaw helps you, consider giving it a ⭐</sub>
410
+ </p>