robot_lab-durable 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.envrc +1 -0
- data/.github/workflows/deploy-github-pages.yml +52 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +83 -0
- data/Rakefile +8 -0
- data/docs/index.md +62 -0
- data/docs/superpowers/plans/2026-05-06-durable-learning.md +1247 -0
- data/docs/superpowers/specs/2026-05-06-durable-learning-design.md +182 -0
- data/examples/33_stock_generator.rb +80 -0
- data/examples/33_stock_predictor.rb +304 -0
- data/lib/robot_lab/durable/entry.rb +49 -0
- data/lib/robot_lab/durable/learning.rb +39 -0
- data/lib/robot_lab/durable/reflector.rb +47 -0
- data/lib/robot_lab/durable/store.rb +119 -0
- data/lib/robot_lab/durable/version.rb +7 -0
- data/lib/robot_lab/durable.rb +24 -0
- data/lib/robot_lab/recall_knowledge.rb +30 -0
- data/lib/robot_lab/record_knowledge.rb +37 -0
- data/mkdocs.yml +116 -0
- metadata +82 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9bb9d48a0a10a6b049f34cb71625023be6373e403eae36b7964434443b9f74f2
|
|
4
|
+
data.tar.gz: b96330d170840c4e06b8ad349855e642bef12c4cb97b4a1b2d43fce0235df847
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 36b8be5148c65454a058575065f92692466bf4a5a28f6fbc77e5fca39aa1ffce9dda7f368a15dc23a5a93e480b72ae40d9e5bf892419692c75bfee6dbb3a49fc
|
|
7
|
+
data.tar.gz: a162fdc17422a862537fb826ff0260fffb66de5143eb37da28362d06834bc4efa66b322a9b8984fe653690f87cd5c230806dc1441c67e3d5720f04a96d8eade2
|
data/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export RR=`pwd`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Deploy Documentation to GitHub Pages
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- develop
|
|
7
|
+
paths:
|
|
8
|
+
- "docs/**"
|
|
9
|
+
- "mkdocs.yml"
|
|
10
|
+
- ".github/workflows/deploy-github-pages.yml"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
deploy:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Setup Python
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: 3.x
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
pip install mkdocs
|
|
35
|
+
pip install mkdocs-material
|
|
36
|
+
pip install mkdocs-macros-plugin
|
|
37
|
+
pip install mike
|
|
38
|
+
|
|
39
|
+
- name: Configure Git
|
|
40
|
+
run: |
|
|
41
|
+
git config --local user.email "action@github.com"
|
|
42
|
+
git config --local user.name "GitHub Action"
|
|
43
|
+
|
|
44
|
+
- name: Build MkDocs site
|
|
45
|
+
run: mkdocs build
|
|
46
|
+
|
|
47
|
+
- name: Deploy to GitHub Pages
|
|
48
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
49
|
+
with:
|
|
50
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
51
|
+
publish_dir: ./site
|
|
52
|
+
keep_files: true
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dewayne VanHoozer
|
|
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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# robot_lab-durable
|
|
2
|
+
|
|
3
|
+
Cross-session durable learning for the [RobotLab](https://github.com/MadBomber/robot_lab) LLM agent framework.
|
|
4
|
+
|
|
5
|
+
> [!CAUTION]
|
|
6
|
+
> This gem is under active development. APIs may change without notice.
|
|
7
|
+
|
|
8
|
+
## What it provides
|
|
9
|
+
|
|
10
|
+
- **`Durable::Entry`** — immutable, confidence-tracked knowledge record
|
|
11
|
+
- **`Durable::Store`** — YAML-backed, file-locked per-domain knowledge persistence in `~/.robot_lab/durable/`
|
|
12
|
+
- **`Durable::Reflector`** — promotes session-level learnings into the durable store at end-of-run
|
|
13
|
+
- **`Durable::Learning`** — mixin included into `RobotLab::Robot`; enabled via `learn: true, learn_domain:` constructor params
|
|
14
|
+
- **`RecallKnowledge`** tool — lets robots query the durable store before making decisions
|
|
15
|
+
- **`RecordKnowledge`** tool — lets robots write new knowledge during a session
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Add to your Gemfile:
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
gem "robot_lab"
|
|
23
|
+
gem "robot_lab-durable"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick Example
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
require "robot_lab"
|
|
30
|
+
require "robot_lab/durable"
|
|
31
|
+
|
|
32
|
+
robot = RobotLab.build(
|
|
33
|
+
name: "advisor",
|
|
34
|
+
system_prompt: "You are a financial advisor that learns from each session.",
|
|
35
|
+
learn: true,
|
|
36
|
+
learn_domain: "finance"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# RecallKnowledge and RecordKnowledge tools are automatically available.
|
|
40
|
+
# At the end of each run, the Reflector promotes learned facts to
|
|
41
|
+
# ~/.robot_lab/durable/finance.yml for use in future sessions.
|
|
42
|
+
result = robot.run("What do you know about my risk tolerance?")
|
|
43
|
+
puts result.last_text_content
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## How It Works
|
|
47
|
+
|
|
48
|
+
When `learn: true` and `learn_domain:` are set, the robot gains two built-in tools:
|
|
49
|
+
|
|
50
|
+
- **`RecallKnowledge`** — queries the domain's YAML store for relevant past knowledge before responding
|
|
51
|
+
- **`RecordKnowledge`** — writes new knowledge entries during a session
|
|
52
|
+
|
|
53
|
+
At the end of each run, `Durable::Reflector` promotes session-level learnings into the persistent store with confidence scoring and deduplication.
|
|
54
|
+
|
|
55
|
+
## Knowledge Persistence
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
~/.robot_lab/durable/
|
|
59
|
+
finance.yml # per-domain YAML store
|
|
60
|
+
support.yml
|
|
61
|
+
...
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Each entry records: `content`, `confidence`, `category`, `domain`, `use_count`, `created_at`, and `updated_at`.
|
|
65
|
+
|
|
66
|
+
Knowledge confidence grows as the same fact is recalled and confirmed across sessions. Low-confidence entries are pruned automatically over time.
|
|
67
|
+
|
|
68
|
+
## Relationship to `robot.learn()`
|
|
69
|
+
|
|
70
|
+
`robot.learn()` is a core RobotLab method that accumulates observations within a single session in memory. `robot_lab-durable` extends this by persisting those observations to disk across sessions, making the robot's learning accumulate over its lifetime rather than resetting each run.
|
|
71
|
+
|
|
72
|
+
## Links
|
|
73
|
+
|
|
74
|
+
- [RobotLab Core](https://github.com/MadBomber/robot_lab)
|
|
75
|
+
- [RubyGems](https://rubygems.org/gems/robot_lab-durable)
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT License - Copyright (c) 2025 Dewayne VanHoozer
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
|
|
83
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/MadBomber/robot_lab-durable.
|
data/Rakefile
ADDED
data/docs/index.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# robot_lab-durable
|
|
2
|
+
|
|
3
|
+
Cross-session durable learning for the [RobotLab](https://github.com/MadBomber/robot_lab) LLM agent framework.
|
|
4
|
+
|
|
5
|
+
> [!CAUTION]
|
|
6
|
+
> This gem is under active development. APIs may change without notice.
|
|
7
|
+
|
|
8
|
+
## What it provides
|
|
9
|
+
|
|
10
|
+
- **`Durable::Entry`** — immutable, confidence-tracked knowledge record
|
|
11
|
+
- **`Durable::Store`** — YAML-backed, file-locked per-domain knowledge persistence in `~/.robot_lab/durable/`
|
|
12
|
+
- **`Durable::Reflector`** — promotes session-level learnings into the durable store at end-of-run
|
|
13
|
+
- **`Durable::Learning`** — mixin included into `RobotLab::Robot`; enabled via `learn: true, learn_domain:` constructor params
|
|
14
|
+
- **`RecallKnowledge`** tool — lets robots query the durable store before making decisions
|
|
15
|
+
- **`RecordKnowledge`** tool — lets robots write new knowledge during a session
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Add to your Gemfile:
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
gem "robot_lab"
|
|
23
|
+
gem "robot_lab-durable"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick Example
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
require "robot_lab"
|
|
30
|
+
require "robot_lab/durable"
|
|
31
|
+
|
|
32
|
+
robot = RobotLab.build(
|
|
33
|
+
name: "advisor",
|
|
34
|
+
system_prompt: "You are a financial advisor that learns from each session.",
|
|
35
|
+
learn: true,
|
|
36
|
+
learn_domain: "finance"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# RecallKnowledge and RecordKnowledge tools are automatically available.
|
|
40
|
+
# At the end of each run, the Reflector promotes learned facts to
|
|
41
|
+
# ~/.robot_lab/durable/finance.yml for use in future sessions.
|
|
42
|
+
result = robot.run("What do you know about my risk tolerance?")
|
|
43
|
+
puts result.last_text_content
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Knowledge Persistence
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
~/.robot_lab/durable/
|
|
50
|
+
finance.yml # per-domain YAML store
|
|
51
|
+
support.yml
|
|
52
|
+
...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Each entry records `content`, `confidence`, `category`, `domain`, `use_count`, `created_at`, and `updated_at`.
|
|
56
|
+
|
|
57
|
+
## Links
|
|
58
|
+
|
|
59
|
+
- [Implementation Plan](superpowers/plans/2026-05-06-durable-learning.md)
|
|
60
|
+
- [Design Spec](superpowers/specs/2026-05-06-durable-learning-design.md)
|
|
61
|
+
- [RobotLab Core](https://github.com/MadBomber/robot_lab)
|
|
62
|
+
- [RubyGems](https://rubygems.org/gems/robot_lab-durable)
|