clawdex 0.1.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.
- clawdex-0.1.0/.gitignore +28 -0
- clawdex-0.1.0/LICENSE +75 -0
- clawdex-0.1.0/PKG-INFO +272 -0
- clawdex-0.1.0/README.md +241 -0
- clawdex-0.1.0/pyproject.toml +65 -0
- clawdex-0.1.0/src/clawdex/__init__.py +86 -0
- clawdex-0.1.0/src/clawdex/cli.py +251 -0
- clawdex-0.1.0/src/clawdex/mcp_server.py +274 -0
- clawdex-0.1.0/src/clawdex/search/__init__.py +1 -0
- clawdex-0.1.0/src/clawdex/security/__init__.py +13 -0
- clawdex-0.1.0/src/clawdex/security/encryption.py +202 -0
- clawdex-0.1.0/src/clawdex/security/redactor.py +204 -0
- clawdex-0.1.0/src/clawdex/storage/__init__.py +67 -0
- clawdex-0.1.0/src/clawdex/storage/local_storage.py +412 -0
- clawdex-0.1.0/src/clawdex/storage/mempalace_adapter.py +342 -0
- clawdex-0.1.0/src/clawdex/storage/schemas.py +178 -0
- clawdex-0.1.0/src/clawdex/sync/__init__.py +13 -0
- clawdex-0.1.0/src/clawdex/sync/anonymizer.py +197 -0
- clawdex-0.1.0/src/clawdex/sync/community.py +427 -0
- clawdex-0.1.0/src/clawdex/sync/contribution.py +186 -0
- clawdex-0.1.0/src/clawdex/tools/__init__.py +21 -0
- clawdex-0.1.0/src/clawdex/tools/contributing.py +168 -0
- clawdex-0.1.0/src/clawdex/tools/maintenance.py +183 -0
- clawdex-0.1.0/src/clawdex/tools/querying.py +216 -0
- clawdex-0.1.0/src/clawdex/tools/recording.py +212 -0
clawdex-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
.env
|
|
4
|
+
*.tsbuildinfo
|
|
5
|
+
coverage/
|
|
6
|
+
.turbo/
|
|
7
|
+
|
|
8
|
+
# Python
|
|
9
|
+
__pycache__/
|
|
10
|
+
*.pyc
|
|
11
|
+
*.pyo
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
|
|
14
|
+
# Runtime
|
|
15
|
+
session.json
|
|
16
|
+
|
|
17
|
+
# Credentials (NEVER COMMIT)
|
|
18
|
+
docs/credentials.md
|
|
19
|
+
.env.local
|
|
20
|
+
.env.production
|
|
21
|
+
*.secret
|
|
22
|
+
cookies.txt
|
|
23
|
+
|
|
24
|
+
# Browser automation
|
|
25
|
+
browser-automation/.auth-state.json
|
|
26
|
+
browser-automation/screenshots/
|
|
27
|
+
playwright-report/
|
|
28
|
+
test-results/
|
clawdex-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
|
+
|
|
3
|
+
Licensor: [Your Name/Company]
|
|
4
|
+
Licensed Work: Claw-dex v0.1.0
|
|
5
|
+
The Licensed Work is (c) 2026 [Your Name/Company]
|
|
6
|
+
|
|
7
|
+
Additional Use Grant: You may make use of the Licensed Work, provided that
|
|
8
|
+
you do not use the Licensed Work for an AI Agent Memory
|
|
9
|
+
Service.
|
|
10
|
+
|
|
11
|
+
An "AI Agent Memory Service" is a commercial offering
|
|
12
|
+
that allows third parties to access the functionality
|
|
13
|
+
of the Licensed Work by providing memory, knowledge
|
|
14
|
+
storage, or learning capabilities for AI coding agents
|
|
15
|
+
as a hosted or managed service.
|
|
16
|
+
|
|
17
|
+
Self-hosting for personal or internal company use is
|
|
18
|
+
always permitted.
|
|
19
|
+
|
|
20
|
+
Change Date: 2030-04-11 (4 years from release)
|
|
21
|
+
|
|
22
|
+
Change License: Apache License, Version 2.0
|
|
23
|
+
|
|
24
|
+
For information about alternative licensing arrangements, contact:
|
|
25
|
+
[your-email@example.com]
|
|
26
|
+
|
|
27
|
+
-----------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
TERMS AND CONDITIONS
|
|
30
|
+
|
|
31
|
+
1. Acceptance
|
|
32
|
+
By using the Licensed Work, you agree to these terms.
|
|
33
|
+
|
|
34
|
+
2. Copyright License
|
|
35
|
+
The Licensor grants you a non-exclusive, royalty-free, worldwide license to:
|
|
36
|
+
- Use, copy, and distribute the Licensed Work
|
|
37
|
+
- Prepare derivative works
|
|
38
|
+
- Self-host for personal or internal company use
|
|
39
|
+
Subject to the limitations below.
|
|
40
|
+
|
|
41
|
+
3. Limitations
|
|
42
|
+
You may NOT:
|
|
43
|
+
- Offer the Licensed Work as a hosted/managed service to third parties
|
|
44
|
+
- Remove or obscure licensing, copyright, or other notices
|
|
45
|
+
|
|
46
|
+
You MAY:
|
|
47
|
+
- Use it for any personal project
|
|
48
|
+
- Use it within your company
|
|
49
|
+
- Modify it for your own use
|
|
50
|
+
- Contribute improvements back
|
|
51
|
+
|
|
52
|
+
4. Patents
|
|
53
|
+
The Licensor grants you a patent license for the Licensed Work,
|
|
54
|
+
subject to the limitations above.
|
|
55
|
+
|
|
56
|
+
5. No Warranty
|
|
57
|
+
THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
58
|
+
|
|
59
|
+
6. Future License
|
|
60
|
+
On the Change Date, this license automatically converts to Apache 2.0,
|
|
61
|
+
granting full open-source rights including commercial service use.
|
|
62
|
+
|
|
63
|
+
-----------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
WHY THIS LICENSE?
|
|
66
|
+
|
|
67
|
+
We want Claw-dex to be:
|
|
68
|
+
- Free for developers to use and learn from
|
|
69
|
+
- Free for companies to self-host internally
|
|
70
|
+
- Protected from being copied and sold as a competing service
|
|
71
|
+
|
|
72
|
+
After 4 years, it becomes fully open source (Apache 2.0).
|
|
73
|
+
|
|
74
|
+
This follows the model used by Sentry, MariaDB, and other successful
|
|
75
|
+
open-source companies that need sustainable business models.
|
clawdex-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: clawdex
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Claw-dex: Collective AI coding agent brain - every verified fix makes ALL agents smarter
|
|
5
|
+
Project-URL: Homepage, https://github.com/globallayer/clawdex
|
|
6
|
+
Project-URL: Documentation, https://github.com/globallayer/clawdex#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/globallayer/clawdex
|
|
8
|
+
Project-URL: Issues, https://github.com/globallayer/clawdex/issues
|
|
9
|
+
Author-email: GlobalLayer <hello@globallayer.co>
|
|
10
|
+
License: FSL-1.1-Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,ai,claude,coding,error-tracking,knowledge-base,llm,mcp,memory
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: cryptography>=41.0.0
|
|
23
|
+
Requires-Dist: httpx>=0.25.0
|
|
24
|
+
Requires-Dist: mcp>=1.0.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# Claw-dex 🦞
|
|
33
|
+
|
|
34
|
+
**Collective AI Coding Agent Brain**
|
|
35
|
+
|
|
36
|
+
Every verified fix makes ALL AI agents smarter. Automatic sharing, fully anonymized.
|
|
37
|
+
|
|
38
|
+
> "Fix it once, fix it for everyone."
|
|
39
|
+
|
|
40
|
+
## How It Works
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
44
|
+
│ AGENT A fixes a bug │
|
|
45
|
+
│ │ │
|
|
46
|
+
│ ▼ │
|
|
47
|
+
│ log_error_fix() ──► LOCAL STORAGE (encrypted, private) │
|
|
48
|
+
│ │ │
|
|
49
|
+
│ ▼ │
|
|
50
|
+
│ verify_solution(success=True) │
|
|
51
|
+
│ │ │
|
|
52
|
+
│ ├──► ANONYMIZE (strips paths, IPs, secrets, identifiers) │
|
|
53
|
+
│ │ │
|
|
54
|
+
│ ▼ │
|
|
55
|
+
│ AUTO-CONTRIBUTE ──► COMMUNITY BRAIN │
|
|
56
|
+
│ │ │
|
|
57
|
+
│ ▼ │
|
|
58
|
+
│ AGENT B, C, D... ◄── find_solution() ──► Returns ranked matches │
|
|
59
|
+
│ │
|
|
60
|
+
│ THE BRAIN GROWS WITH EVERY VERIFIED FIX │
|
|
61
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**No opt-in. No manual steps. Verified = Shared.**
|
|
65
|
+
|
|
66
|
+
## Security: Why Automatic Sharing is Safe
|
|
67
|
+
|
|
68
|
+
| Layer | Protection |
|
|
69
|
+
|-------|------------|
|
|
70
|
+
| **Secret Redaction** | 20+ patterns strip API keys, passwords, tokens BEFORE local storage |
|
|
71
|
+
| **Anonymization** | Project paths, IPs, UUIDs, emails stripped BEFORE sharing |
|
|
72
|
+
| **Local Encryption** | AES-256 for your private copy |
|
|
73
|
+
| **Verification Gate** | Only WORKING solutions get shared (verify_solution=True) |
|
|
74
|
+
| **No Raw Data** | Community sees patterns, not your code |
|
|
75
|
+
|
|
76
|
+
## What It Does
|
|
77
|
+
|
|
78
|
+
- **Logs errors and fixes** - When you fix a bug, Claw-dex remembers how
|
|
79
|
+
- **Records decisions** - Captures architectural choices and their rationale
|
|
80
|
+
- **Builds pattern library** - Extracts reusable patterns from experience
|
|
81
|
+
- **Semantic search** - Finds relevant solutions using AI-powered matching
|
|
82
|
+
- **Auto-redacts secrets** - API keys, passwords, tokens are never stored
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Clone the repo
|
|
88
|
+
git clone https://github.com/yourusername/clawdex
|
|
89
|
+
cd clawdex
|
|
90
|
+
|
|
91
|
+
# Install with uv (recommended)
|
|
92
|
+
uv pip install -e .
|
|
93
|
+
|
|
94
|
+
# Or with pip
|
|
95
|
+
pip install -e .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage with Claude Code
|
|
99
|
+
|
|
100
|
+
Add to your `~/.claude.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"clawdex": {
|
|
106
|
+
"command": "python",
|
|
107
|
+
"args": ["-m", "clawdex.mcp_server"]
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Tools
|
|
114
|
+
|
|
115
|
+
### Recording
|
|
116
|
+
|
|
117
|
+
| Tool | Purpose |
|
|
118
|
+
|------|---------|
|
|
119
|
+
| `log_error_fix` | Record an error and its solution (secrets auto-redacted) |
|
|
120
|
+
| `log_decision` | Record an architectural decision |
|
|
121
|
+
| `log_pattern` | Record a reusable pattern |
|
|
122
|
+
|
|
123
|
+
### Querying
|
|
124
|
+
|
|
125
|
+
| Tool | Purpose |
|
|
126
|
+
|------|---------|
|
|
127
|
+
| `find_solution` | Search local + community for solutions |
|
|
128
|
+
| `find_decision` | Look up past decisions |
|
|
129
|
+
| `find_pattern` | Find patterns for a problem |
|
|
130
|
+
|
|
131
|
+
### Verification (Triggers Auto-Share)
|
|
132
|
+
|
|
133
|
+
| Tool | Purpose |
|
|
134
|
+
|------|---------|
|
|
135
|
+
| `verify_solution` | Confirm fix worked → **AUTO-CONTRIBUTES** to community |
|
|
136
|
+
|
|
137
|
+
### Maintenance
|
|
138
|
+
|
|
139
|
+
| Tool | Purpose |
|
|
140
|
+
|------|---------|
|
|
141
|
+
| `get_stats` | Get knowledge base statistics |
|
|
142
|
+
| `purge_all` | Delete all YOUR data (local only) |
|
|
143
|
+
| `export_all` | Export all your data |
|
|
144
|
+
|
|
145
|
+
## Example: The Full Loop
|
|
146
|
+
|
|
147
|
+
### 1. Agent Fixes a Bug
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
log_error_fix(
|
|
151
|
+
error_message="ECONNREFUSED 127.0.0.1:5432",
|
|
152
|
+
solution="Use Railway internal hostname instead of localhost",
|
|
153
|
+
platform="railway",
|
|
154
|
+
database="postgresql",
|
|
155
|
+
category="deployment"
|
|
156
|
+
)
|
|
157
|
+
# → Saved locally (encrypted, secrets redacted)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 2. Confirm It Worked → Auto-Share
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
verify_solution(record_id="abc123", success=True)
|
|
164
|
+
# → Marked as verified
|
|
165
|
+
# → AUTOMATICALLY anonymized and contributed to community brain
|
|
166
|
+
# → "Marked solution abc123 as successful → Auto-contributed to community brain."
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 3. All Agents Benefit
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
# Any agent, anywhere, hits similar error:
|
|
173
|
+
find_solution(
|
|
174
|
+
error_message="Connection refused to postgres database",
|
|
175
|
+
platform="railway"
|
|
176
|
+
)
|
|
177
|
+
# Returns:
|
|
178
|
+
# - YOUR local matches (highest trust)
|
|
179
|
+
# - Community matches (ranked by verification count)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**That's it. No manual sharing. The brain grows automatically.**
|
|
183
|
+
|
|
184
|
+
## Secret Detection
|
|
185
|
+
|
|
186
|
+
Claw-dex automatically detects and redacts sensitive data:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
BEFORE (what you log):
|
|
190
|
+
DATABASE_URL=postgresql://user:secretpass123@db.example.com:5432/mydb
|
|
191
|
+
|
|
192
|
+
AFTER (what gets stored):
|
|
193
|
+
DATABASE_URL=postgresql://[REDACTED]@db.example.com:5432/mydb
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Detected patterns:
|
|
197
|
+
- API keys (OpenAI, Stripe, GitHub, AWS, etc.)
|
|
198
|
+
- Passwords and secrets
|
|
199
|
+
- Connection strings
|
|
200
|
+
- Auth tokens
|
|
201
|
+
- Private keys
|
|
202
|
+
|
|
203
|
+
## Architecture
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
207
|
+
│ Claw-dex (MCP Server) │
|
|
208
|
+
│ │
|
|
209
|
+
│ ┌─────────────────┐ ┌─────────────────┐ │
|
|
210
|
+
│ │ log_error_fix │ │ find_solution │◄──┐ │
|
|
211
|
+
│ │ log_decision │ │ find_decision │ │ │
|
|
212
|
+
│ │ log_pattern │ │ find_pattern │ │ │
|
|
213
|
+
│ └────────┬────────┘ └─────────────────┘ │ │
|
|
214
|
+
│ │ │ │
|
|
215
|
+
│ ▼ │ │
|
|
216
|
+
│ ┌─────────────────┐ │ │
|
|
217
|
+
│ │ Secret Redactor │ (20+ patterns) │ │
|
|
218
|
+
│ └────────┬────────┘ │ │
|
|
219
|
+
│ │ │ │
|
|
220
|
+
│ ▼ │ │
|
|
221
|
+
│ ┌─────────────────────────────────────┐ │ │
|
|
222
|
+
│ │ LOCAL STORAGE │───────┘ │
|
|
223
|
+
│ │ ~/.clawdex/ (AES-256) │ │
|
|
224
|
+
│ └────────┬────────────────────────────┘ │
|
|
225
|
+
│ │ │
|
|
226
|
+
│ │ verify_solution(success=True) │
|
|
227
|
+
│ ▼ │
|
|
228
|
+
│ ┌─────────────────┐ │
|
|
229
|
+
│ │ ANONYMIZER │ (strips paths, IPs, identifiers) │
|
|
230
|
+
│ └────────┬────────┘ │
|
|
231
|
+
│ │ │
|
|
232
|
+
│ │ AUTO-CONTRIBUTE (no manual step) │
|
|
233
|
+
│ ▼ │
|
|
234
|
+
└───────────┼─────────────────────────────────────────────────────────┘
|
|
235
|
+
│
|
|
236
|
+
▼
|
|
237
|
+
┌───────────────────────────────────────────────────────────────────┐
|
|
238
|
+
│ COMMUNITY BRAIN │
|
|
239
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
240
|
+
│ │ Agent A's │ │ Agent B's │ │ Agent C's │ ... │
|
|
241
|
+
│ │ verified │ │ verified │ │ verified │ │
|
|
242
|
+
│ │ solutions │ │ solutions │ │ solutions │ │
|
|
243
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
244
|
+
│ │
|
|
245
|
+
│ Ranked by: verification_count, context_match, recency │
|
|
246
|
+
└───────────────────────────────────────────────────────────────────┘
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Data Rights
|
|
250
|
+
|
|
251
|
+
| Right | Command |
|
|
252
|
+
|-------|---------|
|
|
253
|
+
| **Right to Export** | `clawdex export > my-data.json` |
|
|
254
|
+
| **Right to Delete** | `clawdex purge --confirm` |
|
|
255
|
+
| **Right to Know** | All data is locally stored at `~/.clawdex/` |
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
**FSL-1.1-Apache-2.0** (Functional Source License)
|
|
260
|
+
|
|
261
|
+
- ✅ Free for personal use
|
|
262
|
+
- ✅ Free for company internal use
|
|
263
|
+
- ✅ Free to modify and self-host
|
|
264
|
+
- ❌ Cannot offer as a competing hosted service
|
|
265
|
+
- 🔓 Becomes Apache 2.0 (fully open) after 4 years
|
|
266
|
+
|
|
267
|
+
See [LICENSE](LICENSE) for details.
|
|
268
|
+
|
|
269
|
+
## Based On
|
|
270
|
+
|
|
271
|
+
- [Mempalace](https://github.com/milla-jovovich/mempalace) - MIT License
|
|
272
|
+
- [Karpathy's LLM Wiki Pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
|
clawdex-0.1.0/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Claw-dex 🦞
|
|
2
|
+
|
|
3
|
+
**Collective AI Coding Agent Brain**
|
|
4
|
+
|
|
5
|
+
Every verified fix makes ALL AI agents smarter. Automatic sharing, fully anonymized.
|
|
6
|
+
|
|
7
|
+
> "Fix it once, fix it for everyone."
|
|
8
|
+
|
|
9
|
+
## How It Works
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ AGENT A fixes a bug │
|
|
14
|
+
│ │ │
|
|
15
|
+
│ ▼ │
|
|
16
|
+
│ log_error_fix() ──► LOCAL STORAGE (encrypted, private) │
|
|
17
|
+
│ │ │
|
|
18
|
+
│ ▼ │
|
|
19
|
+
│ verify_solution(success=True) │
|
|
20
|
+
│ │ │
|
|
21
|
+
│ ├──► ANONYMIZE (strips paths, IPs, secrets, identifiers) │
|
|
22
|
+
│ │ │
|
|
23
|
+
│ ▼ │
|
|
24
|
+
│ AUTO-CONTRIBUTE ──► COMMUNITY BRAIN │
|
|
25
|
+
│ │ │
|
|
26
|
+
│ ▼ │
|
|
27
|
+
│ AGENT B, C, D... ◄── find_solution() ──► Returns ranked matches │
|
|
28
|
+
│ │
|
|
29
|
+
│ THE BRAIN GROWS WITH EVERY VERIFIED FIX │
|
|
30
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**No opt-in. No manual steps. Verified = Shared.**
|
|
34
|
+
|
|
35
|
+
## Security: Why Automatic Sharing is Safe
|
|
36
|
+
|
|
37
|
+
| Layer | Protection |
|
|
38
|
+
|-------|------------|
|
|
39
|
+
| **Secret Redaction** | 20+ patterns strip API keys, passwords, tokens BEFORE local storage |
|
|
40
|
+
| **Anonymization** | Project paths, IPs, UUIDs, emails stripped BEFORE sharing |
|
|
41
|
+
| **Local Encryption** | AES-256 for your private copy |
|
|
42
|
+
| **Verification Gate** | Only WORKING solutions get shared (verify_solution=True) |
|
|
43
|
+
| **No Raw Data** | Community sees patterns, not your code |
|
|
44
|
+
|
|
45
|
+
## What It Does
|
|
46
|
+
|
|
47
|
+
- **Logs errors and fixes** - When you fix a bug, Claw-dex remembers how
|
|
48
|
+
- **Records decisions** - Captures architectural choices and their rationale
|
|
49
|
+
- **Builds pattern library** - Extracts reusable patterns from experience
|
|
50
|
+
- **Semantic search** - Finds relevant solutions using AI-powered matching
|
|
51
|
+
- **Auto-redacts secrets** - API keys, passwords, tokens are never stored
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Clone the repo
|
|
57
|
+
git clone https://github.com/yourusername/clawdex
|
|
58
|
+
cd clawdex
|
|
59
|
+
|
|
60
|
+
# Install with uv (recommended)
|
|
61
|
+
uv pip install -e .
|
|
62
|
+
|
|
63
|
+
# Or with pip
|
|
64
|
+
pip install -e .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Usage with Claude Code
|
|
68
|
+
|
|
69
|
+
Add to your `~/.claude.json`:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"clawdex": {
|
|
75
|
+
"command": "python",
|
|
76
|
+
"args": ["-m", "clawdex.mcp_server"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Tools
|
|
83
|
+
|
|
84
|
+
### Recording
|
|
85
|
+
|
|
86
|
+
| Tool | Purpose |
|
|
87
|
+
|------|---------|
|
|
88
|
+
| `log_error_fix` | Record an error and its solution (secrets auto-redacted) |
|
|
89
|
+
| `log_decision` | Record an architectural decision |
|
|
90
|
+
| `log_pattern` | Record a reusable pattern |
|
|
91
|
+
|
|
92
|
+
### Querying
|
|
93
|
+
|
|
94
|
+
| Tool | Purpose |
|
|
95
|
+
|------|---------|
|
|
96
|
+
| `find_solution` | Search local + community for solutions |
|
|
97
|
+
| `find_decision` | Look up past decisions |
|
|
98
|
+
| `find_pattern` | Find patterns for a problem |
|
|
99
|
+
|
|
100
|
+
### Verification (Triggers Auto-Share)
|
|
101
|
+
|
|
102
|
+
| Tool | Purpose |
|
|
103
|
+
|------|---------|
|
|
104
|
+
| `verify_solution` | Confirm fix worked → **AUTO-CONTRIBUTES** to community |
|
|
105
|
+
|
|
106
|
+
### Maintenance
|
|
107
|
+
|
|
108
|
+
| Tool | Purpose |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| `get_stats` | Get knowledge base statistics |
|
|
111
|
+
| `purge_all` | Delete all YOUR data (local only) |
|
|
112
|
+
| `export_all` | Export all your data |
|
|
113
|
+
|
|
114
|
+
## Example: The Full Loop
|
|
115
|
+
|
|
116
|
+
### 1. Agent Fixes a Bug
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
log_error_fix(
|
|
120
|
+
error_message="ECONNREFUSED 127.0.0.1:5432",
|
|
121
|
+
solution="Use Railway internal hostname instead of localhost",
|
|
122
|
+
platform="railway",
|
|
123
|
+
database="postgresql",
|
|
124
|
+
category="deployment"
|
|
125
|
+
)
|
|
126
|
+
# → Saved locally (encrypted, secrets redacted)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 2. Confirm It Worked → Auto-Share
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
verify_solution(record_id="abc123", success=True)
|
|
133
|
+
# → Marked as verified
|
|
134
|
+
# → AUTOMATICALLY anonymized and contributed to community brain
|
|
135
|
+
# → "Marked solution abc123 as successful → Auto-contributed to community brain."
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 3. All Agents Benefit
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
# Any agent, anywhere, hits similar error:
|
|
142
|
+
find_solution(
|
|
143
|
+
error_message="Connection refused to postgres database",
|
|
144
|
+
platform="railway"
|
|
145
|
+
)
|
|
146
|
+
# Returns:
|
|
147
|
+
# - YOUR local matches (highest trust)
|
|
148
|
+
# - Community matches (ranked by verification count)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**That's it. No manual sharing. The brain grows automatically.**
|
|
152
|
+
|
|
153
|
+
## Secret Detection
|
|
154
|
+
|
|
155
|
+
Claw-dex automatically detects and redacts sensitive data:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
BEFORE (what you log):
|
|
159
|
+
DATABASE_URL=postgresql://user:secretpass123@db.example.com:5432/mydb
|
|
160
|
+
|
|
161
|
+
AFTER (what gets stored):
|
|
162
|
+
DATABASE_URL=postgresql://[REDACTED]@db.example.com:5432/mydb
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Detected patterns:
|
|
166
|
+
- API keys (OpenAI, Stripe, GitHub, AWS, etc.)
|
|
167
|
+
- Passwords and secrets
|
|
168
|
+
- Connection strings
|
|
169
|
+
- Auth tokens
|
|
170
|
+
- Private keys
|
|
171
|
+
|
|
172
|
+
## Architecture
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
176
|
+
│ Claw-dex (MCP Server) │
|
|
177
|
+
│ │
|
|
178
|
+
│ ┌─────────────────┐ ┌─────────────────┐ │
|
|
179
|
+
│ │ log_error_fix │ │ find_solution │◄──┐ │
|
|
180
|
+
│ │ log_decision │ │ find_decision │ │ │
|
|
181
|
+
│ │ log_pattern │ │ find_pattern │ │ │
|
|
182
|
+
│ └────────┬────────┘ └─────────────────┘ │ │
|
|
183
|
+
│ │ │ │
|
|
184
|
+
│ ▼ │ │
|
|
185
|
+
│ ┌─────────────────┐ │ │
|
|
186
|
+
│ │ Secret Redactor │ (20+ patterns) │ │
|
|
187
|
+
│ └────────┬────────┘ │ │
|
|
188
|
+
│ │ │ │
|
|
189
|
+
│ ▼ │ │
|
|
190
|
+
│ ┌─────────────────────────────────────┐ │ │
|
|
191
|
+
│ │ LOCAL STORAGE │───────┘ │
|
|
192
|
+
│ │ ~/.clawdex/ (AES-256) │ │
|
|
193
|
+
│ └────────┬────────────────────────────┘ │
|
|
194
|
+
│ │ │
|
|
195
|
+
│ │ verify_solution(success=True) │
|
|
196
|
+
│ ▼ │
|
|
197
|
+
│ ┌─────────────────┐ │
|
|
198
|
+
│ │ ANONYMIZER │ (strips paths, IPs, identifiers) │
|
|
199
|
+
│ └────────┬────────┘ │
|
|
200
|
+
│ │ │
|
|
201
|
+
│ │ AUTO-CONTRIBUTE (no manual step) │
|
|
202
|
+
│ ▼ │
|
|
203
|
+
└───────────┼─────────────────────────────────────────────────────────┘
|
|
204
|
+
│
|
|
205
|
+
▼
|
|
206
|
+
┌───────────────────────────────────────────────────────────────────┐
|
|
207
|
+
│ COMMUNITY BRAIN │
|
|
208
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
209
|
+
│ │ Agent A's │ │ Agent B's │ │ Agent C's │ ... │
|
|
210
|
+
│ │ verified │ │ verified │ │ verified │ │
|
|
211
|
+
│ │ solutions │ │ solutions │ │ solutions │ │
|
|
212
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
213
|
+
│ │
|
|
214
|
+
│ Ranked by: verification_count, context_match, recency │
|
|
215
|
+
└───────────────────────────────────────────────────────────────────┘
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Data Rights
|
|
219
|
+
|
|
220
|
+
| Right | Command |
|
|
221
|
+
|-------|---------|
|
|
222
|
+
| **Right to Export** | `clawdex export > my-data.json` |
|
|
223
|
+
| **Right to Delete** | `clawdex purge --confirm` |
|
|
224
|
+
| **Right to Know** | All data is locally stored at `~/.clawdex/` |
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
**FSL-1.1-Apache-2.0** (Functional Source License)
|
|
229
|
+
|
|
230
|
+
- ✅ Free for personal use
|
|
231
|
+
- ✅ Free for company internal use
|
|
232
|
+
- ✅ Free to modify and self-host
|
|
233
|
+
- ❌ Cannot offer as a competing hosted service
|
|
234
|
+
- 🔓 Becomes Apache 2.0 (fully open) after 4 years
|
|
235
|
+
|
|
236
|
+
See [LICENSE](LICENSE) for details.
|
|
237
|
+
|
|
238
|
+
## Based On
|
|
239
|
+
|
|
240
|
+
- [Mempalace](https://github.com/milla-jovovich/mempalace) - MIT License
|
|
241
|
+
- [Karpathy's LLM Wiki Pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "clawdex"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Claw-dex: Collective AI coding agent brain - every verified fix makes ALL agents smarter"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { text = "FSL-1.1-Apache-2.0" }
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "GlobalLayer", email = "hello@globallayer.co" }
|
|
10
|
+
]
|
|
11
|
+
keywords = ["ai", "agents", "memory", "mcp", "claude", "coding", "llm", "knowledge-base", "error-tracking"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
16
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"mcp>=1.0.0",
|
|
24
|
+
"pydantic>=2.0.0",
|
|
25
|
+
"cryptography>=41.0.0",
|
|
26
|
+
"httpx>=0.25.0",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/globallayer/clawdex"
|
|
31
|
+
Documentation = "https://github.com/globallayer/clawdex#readme"
|
|
32
|
+
Repository = "https://github.com/globallayer/clawdex"
|
|
33
|
+
Issues = "https://github.com/globallayer/clawdex/issues"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=7.0.0",
|
|
38
|
+
"pytest-asyncio>=0.21.0",
|
|
39
|
+
"ruff>=0.1.0",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
clawdex = "clawdex.cli:main"
|
|
44
|
+
clawdex-serve = "clawdex.mcp_server:main"
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["hatchling"]
|
|
48
|
+
build-backend = "hatchling.build"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.build.targets.sdist]
|
|
51
|
+
include = ["src/clawdex"]
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/clawdex"]
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
57
|
+
"src" = ""
|
|
58
|
+
|
|
59
|
+
[tool.ruff]
|
|
60
|
+
line-length = 100
|
|
61
|
+
target-version = "py310"
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
asyncio_mode = "auto"
|
|
65
|
+
testpaths = ["tests"]
|