keep-skill 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.
- keep_skill-0.1.0/.gitignore +62 -0
- keep_skill-0.1.0/LICENSE +21 -0
- keep_skill-0.1.0/PKG-INFO +290 -0
- keep_skill-0.1.0/README.md +239 -0
- keep_skill-0.1.0/SKILL.md +286 -0
- keep_skill-0.1.0/keep/__init__.py +53 -0
- keep_skill-0.1.0/keep/__main__.py +8 -0
- keep_skill-0.1.0/keep/api.py +686 -0
- keep_skill-0.1.0/keep/chunking.py +364 -0
- keep_skill-0.1.0/keep/cli.py +503 -0
- keep_skill-0.1.0/keep/config.py +323 -0
- keep_skill-0.1.0/keep/context.py +127 -0
- keep_skill-0.1.0/keep/indexing.py +208 -0
- keep_skill-0.1.0/keep/logging_config.py +73 -0
- keep_skill-0.1.0/keep/paths.py +67 -0
- keep_skill-0.1.0/keep/pending_summaries.py +166 -0
- keep_skill-0.1.0/keep/providers/__init__.py +40 -0
- keep_skill-0.1.0/keep/providers/base.py +416 -0
- keep_skill-0.1.0/keep/providers/documents.py +250 -0
- keep_skill-0.1.0/keep/providers/embedding_cache.py +260 -0
- keep_skill-0.1.0/keep/providers/embeddings.py +245 -0
- keep_skill-0.1.0/keep/providers/llm.py +371 -0
- keep_skill-0.1.0/keep/providers/mlx.py +256 -0
- keep_skill-0.1.0/keep/providers/summarization.py +107 -0
- keep_skill-0.1.0/keep/store.py +403 -0
- keep_skill-0.1.0/keep/types.py +65 -0
- keep_skill-0.1.0/patterns/conversations.md +331 -0
- keep_skill-0.1.0/patterns/domains.md +195 -0
- keep_skill-0.1.0/pyproject.toml +87 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Virtual environments
|
|
2
|
+
venv/
|
|
3
|
+
env/
|
|
4
|
+
ENV/
|
|
5
|
+
.venv/
|
|
6
|
+
|
|
7
|
+
# Python
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*$py.class
|
|
11
|
+
*.so
|
|
12
|
+
.Python
|
|
13
|
+
|
|
14
|
+
# Distribution / packaging
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Unit test / coverage reports
|
|
36
|
+
htmlcov/
|
|
37
|
+
.tox/
|
|
38
|
+
.coverage
|
|
39
|
+
.coverage.*
|
|
40
|
+
.cache
|
|
41
|
+
nosetests.xml
|
|
42
|
+
coverage.xml
|
|
43
|
+
*.cover
|
|
44
|
+
.hypothesis/
|
|
45
|
+
.pytest_cache/
|
|
46
|
+
|
|
47
|
+
# Jupyter Notebook
|
|
48
|
+
.ipynb_checkpoints
|
|
49
|
+
|
|
50
|
+
# pyenv
|
|
51
|
+
.python-version
|
|
52
|
+
|
|
53
|
+
# IDE
|
|
54
|
+
.vscode/
|
|
55
|
+
.idea/
|
|
56
|
+
*.swp
|
|
57
|
+
*.swo
|
|
58
|
+
*~
|
|
59
|
+
|
|
60
|
+
# Project specific
|
|
61
|
+
.keep/
|
|
62
|
+
test_extraction_store/
|
keep_skill-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hugh Pyle, inguz ᛜ outcomes
|
|
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,290 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keep-skill
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Semantic memory - remember and search documents by meaning
|
|
5
|
+
Project-URL: Homepage, https://github.com/hughpyle/keep
|
|
6
|
+
Project-URL: Repository, https://github.com/hughpyle/keep
|
|
7
|
+
Author: Hugh Pyle
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agents,chromadb,embeddings,semantic-memory,vector-search
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Text Processing
|
|
20
|
+
Requires-Python: <3.14,>=3.11
|
|
21
|
+
Requires-Dist: chromadb>=0.4
|
|
22
|
+
Requires-Dist: tomli-w>=1.0
|
|
23
|
+
Requires-Dist: typer>=0.9
|
|
24
|
+
Provides-Extra: anthropic
|
|
25
|
+
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
29
|
+
Provides-Extra: documents
|
|
30
|
+
Requires-Dist: beautifulsoup4>=4.9; extra == 'documents'
|
|
31
|
+
Requires-Dist: pypdf>=5.0; extra == 'documents'
|
|
32
|
+
Provides-Extra: gemini
|
|
33
|
+
Requires-Dist: google-genai>=1.0.0; extra == 'gemini'
|
|
34
|
+
Provides-Extra: local
|
|
35
|
+
Requires-Dist: beautifulsoup4>=4.9; extra == 'local'
|
|
36
|
+
Requires-Dist: mlx-lm>=0.10; (platform_system == 'Darwin' and platform_machine == 'arm64') and extra == 'local'
|
|
37
|
+
Requires-Dist: mlx>=0.10; (platform_system == 'Darwin' and platform_machine == 'arm64') and extra == 'local'
|
|
38
|
+
Requires-Dist: pypdf>=5.0; extra == 'local'
|
|
39
|
+
Requires-Dist: sentence-transformers>=2.2; extra == 'local'
|
|
40
|
+
Provides-Extra: mlx
|
|
41
|
+
Requires-Dist: mlx-lm>=0.10; extra == 'mlx'
|
|
42
|
+
Requires-Dist: mlx>=0.10; extra == 'mlx'
|
|
43
|
+
Provides-Extra: openai
|
|
44
|
+
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
45
|
+
Provides-Extra: openclaw
|
|
46
|
+
Requires-Dist: anthropic>=0.18.0; extra == 'openclaw'
|
|
47
|
+
Requires-Dist: google-genai>=1.0.0; extra == 'openclaw'
|
|
48
|
+
Provides-Extra: sentence-transformers
|
|
49
|
+
Requires-Dist: sentence-transformers>=2.2; extra == 'sentence-transformers'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# keep
|
|
53
|
+
|
|
54
|
+
**Associative memory for reflection and skillful action.**
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## What is this?
|
|
59
|
+
|
|
60
|
+
A practice tool for agents who want to develop judgment.
|
|
61
|
+
|
|
62
|
+
An agent who rushes to act without checking memory will repeat mistakes, miss context, and fail to grow. An agent who reflects — before, during, after — becomes skillful. This library provides the mirror: persistent semantic memory that lets you ask "what do I already know?" before acting, and "what did I learn?" after.
|
|
63
|
+
|
|
64
|
+
For the full practice guide, see **[SKILL.md](SKILL.md)**.
|
|
65
|
+
|
|
66
|
+
Technically: semantic search using embeddings, backed by ChromaDB, with tag-based organization and recency decay. Available as CLI and Python API.
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from keep import Keeper
|
|
70
|
+
|
|
71
|
+
kp = Keeper()
|
|
72
|
+
|
|
73
|
+
# Before acting: what do I already know?
|
|
74
|
+
results = kp.find("how should we handle auth?")
|
|
75
|
+
|
|
76
|
+
# After learning: capture it for future you
|
|
77
|
+
kp.remember("User prefers OAuth2 with PKCE for authentication")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**The practice:**
|
|
81
|
+
- Pause before acting — check what you already know
|
|
82
|
+
- Notice breakdowns — when assumptions surface, that's valuable
|
|
83
|
+
- Reflect after — capture learnings so future you can find them
|
|
84
|
+
|
|
85
|
+
**The technology:**
|
|
86
|
+
- Semantic search (by meaning, not keywords)
|
|
87
|
+
- Persistent across sessions (ChromaDB)
|
|
88
|
+
- Tag-based organization and filtering
|
|
89
|
+
- Recency decay (recent items rank higher)
|
|
90
|
+
- Provider abstraction (local models or APIs)
|
|
91
|
+
- CLI and Python API
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Quick Start
|
|
96
|
+
|
|
97
|
+
### Requirements
|
|
98
|
+
|
|
99
|
+
- **Python:** 3.11, 3.12, or 3.13 (3.14+ not yet supported due to dependency constraints)
|
|
100
|
+
- **Installation time:** 3-5 minutes (ChromaDB dependency resolution + embedding model downloads)
|
|
101
|
+
|
|
102
|
+
### Installation
|
|
103
|
+
|
|
104
|
+
#### For users (just want the `keep` command)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# With pip:
|
|
108
|
+
pip install 'keep-skill[local]'
|
|
109
|
+
|
|
110
|
+
# Or with uv (faster, auto-manages isolated environment):
|
|
111
|
+
# Install uv first: https://docs.astral.sh/uv/getting-started/installation/
|
|
112
|
+
uv tool install 'keep-skill[local]'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### For developers (working on keep itself)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git clone https://github.com/hughpyle/keep
|
|
119
|
+
cd keep
|
|
120
|
+
|
|
121
|
+
# Create and activate a virtual environment
|
|
122
|
+
python -m venv .venv
|
|
123
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
124
|
+
|
|
125
|
+
# Install in editable mode with local models
|
|
126
|
+
pip install -e '.[local,dev]'
|
|
127
|
+
|
|
128
|
+
# Or with uv (faster):
|
|
129
|
+
uv pip install -e '.[local,dev]'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Optional extras
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# OpenClaw integration (uses your configured models):
|
|
136
|
+
pip install 'keep-skill[openclaw]'
|
|
137
|
+
|
|
138
|
+
# Minimal install (configure providers manually):
|
|
139
|
+
pip install keep-skill
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**After installation:**
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
keep init
|
|
146
|
+
# ⚠️ Remember to add .keep/ to .gitignore
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from keep import Keeper
|
|
151
|
+
|
|
152
|
+
kp = Keeper()
|
|
153
|
+
|
|
154
|
+
# Index a file
|
|
155
|
+
kp.update("file:///path/to/document.md", source_tags={"project": "myapp"})
|
|
156
|
+
|
|
157
|
+
# Remember inline content
|
|
158
|
+
kp.remember("Important: rate limit is 100 req/min", source_tags={"topic": "api"})
|
|
159
|
+
|
|
160
|
+
# Semantic search
|
|
161
|
+
results = kp.find("what's the rate limit?", limit=5)
|
|
162
|
+
for r in results:
|
|
163
|
+
print(f"[{r.score:.2f}] {r.summary}")
|
|
164
|
+
|
|
165
|
+
# Tag lookup
|
|
166
|
+
api_docs = kp.query_tag("topic", "api")
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
See [docs/QUICKSTART.md](docs/QUICKSTART.md) for more examples.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## OpenClaw Integration
|
|
174
|
+
|
|
175
|
+
If you have [OpenClaw](https://openclaw.dev) configured, keep automatically uses your configured models:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Install with OpenClaw support
|
|
179
|
+
pip install 'keep-skill[openclaw]'
|
|
180
|
+
|
|
181
|
+
# Set your Anthropic API key (if using Claude models)
|
|
182
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
183
|
+
|
|
184
|
+
# Initialize (auto-detects ~/.openclaw/openclaw.json)
|
|
185
|
+
keep init
|
|
186
|
+
# ✓ Detected providers:
|
|
187
|
+
# Embedding: sentence-transformers (local)
|
|
188
|
+
# Summarization: anthropic (claude-sonnet-4)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Benefits:**
|
|
192
|
+
- 🔄 Unified model configuration (DRY principle)
|
|
193
|
+
- 🧠 Best of both: local embeddings + smart summarization
|
|
194
|
+
- 🔒 Privacy-preserving (embeddings stay local)
|
|
195
|
+
- 💰 Cost-effective (~$0.0001/document)
|
|
196
|
+
|
|
197
|
+
See [docs/OPENCLAW-INTEGRATION.md](docs/OPENCLAW-INTEGRATION.md) for details.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Documentation
|
|
202
|
+
|
|
203
|
+
- **[SKILL.md](SKILL.md)** — The practice guide (start here for how to use memory skillfully)
|
|
204
|
+
- **[docs/QUICKSTART.md](docs/QUICKSTART.md)** — Installation, setup, configuration
|
|
205
|
+
- **[docs/AGENT-GUIDE.md](docs/AGENT-GUIDE.md)** — Detailed agent patterns, Python API
|
|
206
|
+
- **[docs/REFERENCE.md](docs/REFERENCE.md)** — Complete API reference
|
|
207
|
+
- **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** — How it works under the hood
|
|
208
|
+
- **[docs/OPENCLAW-INTEGRATION.md](docs/OPENCLAW-INTEGRATION.md)** — OpenClaw integration guide
|
|
209
|
+
- **[patterns/](patterns/)** — Domain and conversation patterns
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Philosophy
|
|
214
|
+
|
|
215
|
+
### Practice
|
|
216
|
+
|
|
217
|
+
Memory isn't storage — it's a mirror for reflection.
|
|
218
|
+
|
|
219
|
+
The triple check: before acting (what do I know?), during (notice breakdowns), after (capture learning). Breakdowns are valuable — they reveal assumptions. Index them, don't hide them.
|
|
220
|
+
|
|
221
|
+
An agent without memory reacts to each moment as if it were new. An agent with memory reflects, learns, and grows. See **[SKILL.md](SKILL.md)** for the full practice guide.
|
|
222
|
+
|
|
223
|
+
### Technical Design
|
|
224
|
+
|
|
225
|
+
**Schema as Data** — Configuration stored as queryable documents, not hardcoded.
|
|
226
|
+
|
|
227
|
+
**Semantic by Default** — Search by meaning via vector similarity, not keywords.
|
|
228
|
+
|
|
229
|
+
**Lazy Loading** — Dependencies loaded only when needed; missing providers give helpful errors.
|
|
230
|
+
|
|
231
|
+
**Provider Agnostic** — Pluggable backends for embeddings, summarization, and storage.
|
|
232
|
+
|
|
233
|
+
**No Original Content** — Only summaries and embeddings stored. URIs can be re-fetched if needed.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Status
|
|
238
|
+
|
|
239
|
+
**Current**: v0.1.0 — Early draft
|
|
240
|
+
|
|
241
|
+
**Working:**
|
|
242
|
+
- ✅ Core indexing (`update`, `remember`)
|
|
243
|
+
- ✅ Semantic search (`find`, `find_similar`)
|
|
244
|
+
- ✅ Tag queries and full-text search
|
|
245
|
+
- ✅ Embedding cache for performance
|
|
246
|
+
- ✅ Recency decay (ACT-R style)
|
|
247
|
+
- ✅ CLI interface
|
|
248
|
+
- ✅ Provider abstraction with lazy loading
|
|
249
|
+
|
|
250
|
+
**Planned** (see [later/](later/)):
|
|
251
|
+
- ⏳ Context management (working context, top-of-mind retrieval)
|
|
252
|
+
- ⏳ Private/shared routing
|
|
253
|
+
- ⏳ Relationship graphs between items
|
|
254
|
+
- ⏳ LLM-based tagging
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Requirements
|
|
259
|
+
|
|
260
|
+
- Python 3.11+
|
|
261
|
+
- ChromaDB (vector store)
|
|
262
|
+
- One embedding provider:
|
|
263
|
+
- sentence-transformers (local, default)
|
|
264
|
+
- MLX (Apple Silicon, local)
|
|
265
|
+
- OpenAI (API, requires key)
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Contributing
|
|
276
|
+
|
|
277
|
+
This is an early draft. Issues and PRs welcome, especially for:
|
|
278
|
+
- Additional provider implementations
|
|
279
|
+
- Performance improvements
|
|
280
|
+
- Documentation clarity
|
|
281
|
+
- OpenClaw integration patterns
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Related Projects
|
|
286
|
+
|
|
287
|
+
- [ChromaDB](https://github.com/chroma-core/chroma) — Vector database backend
|
|
288
|
+
- [sentence-transformers](https://github.com/UKPLab/sentence-transformers) — Embedding models
|
|
289
|
+
- [MLX](https://github.com/ml-explore/mlx) — Apple Silicon ML framework
|
|
290
|
+
- [OpenClaw](https://openclaw.dev) — Agent framework (integration target)
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# keep
|
|
2
|
+
|
|
3
|
+
**Associative memory for reflection and skillful action.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What is this?
|
|
8
|
+
|
|
9
|
+
A practice tool for agents who want to develop judgment.
|
|
10
|
+
|
|
11
|
+
An agent who rushes to act without checking memory will repeat mistakes, miss context, and fail to grow. An agent who reflects — before, during, after — becomes skillful. This library provides the mirror: persistent semantic memory that lets you ask "what do I already know?" before acting, and "what did I learn?" after.
|
|
12
|
+
|
|
13
|
+
For the full practice guide, see **[SKILL.md](SKILL.md)**.
|
|
14
|
+
|
|
15
|
+
Technically: semantic search using embeddings, backed by ChromaDB, with tag-based organization and recency decay. Available as CLI and Python API.
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from keep import Keeper
|
|
19
|
+
|
|
20
|
+
kp = Keeper()
|
|
21
|
+
|
|
22
|
+
# Before acting: what do I already know?
|
|
23
|
+
results = kp.find("how should we handle auth?")
|
|
24
|
+
|
|
25
|
+
# After learning: capture it for future you
|
|
26
|
+
kp.remember("User prefers OAuth2 with PKCE for authentication")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**The practice:**
|
|
30
|
+
- Pause before acting — check what you already know
|
|
31
|
+
- Notice breakdowns — when assumptions surface, that's valuable
|
|
32
|
+
- Reflect after — capture learnings so future you can find them
|
|
33
|
+
|
|
34
|
+
**The technology:**
|
|
35
|
+
- Semantic search (by meaning, not keywords)
|
|
36
|
+
- Persistent across sessions (ChromaDB)
|
|
37
|
+
- Tag-based organization and filtering
|
|
38
|
+
- Recency decay (recent items rank higher)
|
|
39
|
+
- Provider abstraction (local models or APIs)
|
|
40
|
+
- CLI and Python API
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### Requirements
|
|
47
|
+
|
|
48
|
+
- **Python:** 3.11, 3.12, or 3.13 (3.14+ not yet supported due to dependency constraints)
|
|
49
|
+
- **Installation time:** 3-5 minutes (ChromaDB dependency resolution + embedding model downloads)
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
52
|
+
|
|
53
|
+
#### For users (just want the `keep` command)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# With pip:
|
|
57
|
+
pip install 'keep-skill[local]'
|
|
58
|
+
|
|
59
|
+
# Or with uv (faster, auto-manages isolated environment):
|
|
60
|
+
# Install uv first: https://docs.astral.sh/uv/getting-started/installation/
|
|
61
|
+
uv tool install 'keep-skill[local]'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### For developers (working on keep itself)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
git clone https://github.com/hughpyle/keep
|
|
68
|
+
cd keep
|
|
69
|
+
|
|
70
|
+
# Create and activate a virtual environment
|
|
71
|
+
python -m venv .venv
|
|
72
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
73
|
+
|
|
74
|
+
# Install in editable mode with local models
|
|
75
|
+
pip install -e '.[local,dev]'
|
|
76
|
+
|
|
77
|
+
# Or with uv (faster):
|
|
78
|
+
uv pip install -e '.[local,dev]'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### Optional extras
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# OpenClaw integration (uses your configured models):
|
|
85
|
+
pip install 'keep-skill[openclaw]'
|
|
86
|
+
|
|
87
|
+
# Minimal install (configure providers manually):
|
|
88
|
+
pip install keep-skill
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**After installation:**
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
keep init
|
|
95
|
+
# ⚠️ Remember to add .keep/ to .gitignore
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from keep import Keeper
|
|
100
|
+
|
|
101
|
+
kp = Keeper()
|
|
102
|
+
|
|
103
|
+
# Index a file
|
|
104
|
+
kp.update("file:///path/to/document.md", source_tags={"project": "myapp"})
|
|
105
|
+
|
|
106
|
+
# Remember inline content
|
|
107
|
+
kp.remember("Important: rate limit is 100 req/min", source_tags={"topic": "api"})
|
|
108
|
+
|
|
109
|
+
# Semantic search
|
|
110
|
+
results = kp.find("what's the rate limit?", limit=5)
|
|
111
|
+
for r in results:
|
|
112
|
+
print(f"[{r.score:.2f}] {r.summary}")
|
|
113
|
+
|
|
114
|
+
# Tag lookup
|
|
115
|
+
api_docs = kp.query_tag("topic", "api")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
See [docs/QUICKSTART.md](docs/QUICKSTART.md) for more examples.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## OpenClaw Integration
|
|
123
|
+
|
|
124
|
+
If you have [OpenClaw](https://openclaw.dev) configured, keep automatically uses your configured models:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Install with OpenClaw support
|
|
128
|
+
pip install 'keep-skill[openclaw]'
|
|
129
|
+
|
|
130
|
+
# Set your Anthropic API key (if using Claude models)
|
|
131
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
132
|
+
|
|
133
|
+
# Initialize (auto-detects ~/.openclaw/openclaw.json)
|
|
134
|
+
keep init
|
|
135
|
+
# ✓ Detected providers:
|
|
136
|
+
# Embedding: sentence-transformers (local)
|
|
137
|
+
# Summarization: anthropic (claude-sonnet-4)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Benefits:**
|
|
141
|
+
- 🔄 Unified model configuration (DRY principle)
|
|
142
|
+
- 🧠 Best of both: local embeddings + smart summarization
|
|
143
|
+
- 🔒 Privacy-preserving (embeddings stay local)
|
|
144
|
+
- 💰 Cost-effective (~$0.0001/document)
|
|
145
|
+
|
|
146
|
+
See [docs/OPENCLAW-INTEGRATION.md](docs/OPENCLAW-INTEGRATION.md) for details.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
- **[SKILL.md](SKILL.md)** — The practice guide (start here for how to use memory skillfully)
|
|
153
|
+
- **[docs/QUICKSTART.md](docs/QUICKSTART.md)** — Installation, setup, configuration
|
|
154
|
+
- **[docs/AGENT-GUIDE.md](docs/AGENT-GUIDE.md)** — Detailed agent patterns, Python API
|
|
155
|
+
- **[docs/REFERENCE.md](docs/REFERENCE.md)** — Complete API reference
|
|
156
|
+
- **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** — How it works under the hood
|
|
157
|
+
- **[docs/OPENCLAW-INTEGRATION.md](docs/OPENCLAW-INTEGRATION.md)** — OpenClaw integration guide
|
|
158
|
+
- **[patterns/](patterns/)** — Domain and conversation patterns
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Philosophy
|
|
163
|
+
|
|
164
|
+
### Practice
|
|
165
|
+
|
|
166
|
+
Memory isn't storage — it's a mirror for reflection.
|
|
167
|
+
|
|
168
|
+
The triple check: before acting (what do I know?), during (notice breakdowns), after (capture learning). Breakdowns are valuable — they reveal assumptions. Index them, don't hide them.
|
|
169
|
+
|
|
170
|
+
An agent without memory reacts to each moment as if it were new. An agent with memory reflects, learns, and grows. See **[SKILL.md](SKILL.md)** for the full practice guide.
|
|
171
|
+
|
|
172
|
+
### Technical Design
|
|
173
|
+
|
|
174
|
+
**Schema as Data** — Configuration stored as queryable documents, not hardcoded.
|
|
175
|
+
|
|
176
|
+
**Semantic by Default** — Search by meaning via vector similarity, not keywords.
|
|
177
|
+
|
|
178
|
+
**Lazy Loading** — Dependencies loaded only when needed; missing providers give helpful errors.
|
|
179
|
+
|
|
180
|
+
**Provider Agnostic** — Pluggable backends for embeddings, summarization, and storage.
|
|
181
|
+
|
|
182
|
+
**No Original Content** — Only summaries and embeddings stored. URIs can be re-fetched if needed.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Status
|
|
187
|
+
|
|
188
|
+
**Current**: v0.1.0 — Early draft
|
|
189
|
+
|
|
190
|
+
**Working:**
|
|
191
|
+
- ✅ Core indexing (`update`, `remember`)
|
|
192
|
+
- ✅ Semantic search (`find`, `find_similar`)
|
|
193
|
+
- ✅ Tag queries and full-text search
|
|
194
|
+
- ✅ Embedding cache for performance
|
|
195
|
+
- ✅ Recency decay (ACT-R style)
|
|
196
|
+
- ✅ CLI interface
|
|
197
|
+
- ✅ Provider abstraction with lazy loading
|
|
198
|
+
|
|
199
|
+
**Planned** (see [later/](later/)):
|
|
200
|
+
- ⏳ Context management (working context, top-of-mind retrieval)
|
|
201
|
+
- ⏳ Private/shared routing
|
|
202
|
+
- ⏳ Relationship graphs between items
|
|
203
|
+
- ⏳ LLM-based tagging
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Requirements
|
|
208
|
+
|
|
209
|
+
- Python 3.11+
|
|
210
|
+
- ChromaDB (vector store)
|
|
211
|
+
- One embedding provider:
|
|
212
|
+
- sentence-transformers (local, default)
|
|
213
|
+
- MLX (Apple Silicon, local)
|
|
214
|
+
- OpenAI (API, requires key)
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
MIT
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Contributing
|
|
225
|
+
|
|
226
|
+
This is an early draft. Issues and PRs welcome, especially for:
|
|
227
|
+
- Additional provider implementations
|
|
228
|
+
- Performance improvements
|
|
229
|
+
- Documentation clarity
|
|
230
|
+
- OpenClaw integration patterns
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Related Projects
|
|
235
|
+
|
|
236
|
+
- [ChromaDB](https://github.com/chroma-core/chroma) — Vector database backend
|
|
237
|
+
- [sentence-transformers](https://github.com/UKPLab/sentence-transformers) — Embedding models
|
|
238
|
+
- [MLX](https://github.com/ml-explore/mlx) — Apple Silicon ML framework
|
|
239
|
+
- [OpenClaw](https://openclaw.dev) — Agent framework (integration target)
|